{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SNS.CreateSMSSandboxPhoneNumber
(
CreateSMSSandboxPhoneNumber (..),
newCreateSMSSandboxPhoneNumber,
createSMSSandboxPhoneNumber_languageCode,
createSMSSandboxPhoneNumber_phoneNumber,
CreateSMSSandboxPhoneNumberResponse (..),
newCreateSMSSandboxPhoneNumberResponse,
createSMSSandboxPhoneNumberResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types
data CreateSMSSandboxPhoneNumber = CreateSMSSandboxPhoneNumber'
{
CreateSMSSandboxPhoneNumber -> Maybe LanguageCodeString
languageCode :: Prelude.Maybe LanguageCodeString,
CreateSMSSandboxPhoneNumber -> Text
phoneNumber :: Prelude.Text
}
deriving (CreateSMSSandboxPhoneNumber -> CreateSMSSandboxPhoneNumber -> Bool
(CreateSMSSandboxPhoneNumber
-> CreateSMSSandboxPhoneNumber -> Bool)
-> (CreateSMSSandboxPhoneNumber
-> CreateSMSSandboxPhoneNumber -> Bool)
-> Eq CreateSMSSandboxPhoneNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSMSSandboxPhoneNumber -> CreateSMSSandboxPhoneNumber -> Bool
$c/= :: CreateSMSSandboxPhoneNumber -> CreateSMSSandboxPhoneNumber -> Bool
== :: CreateSMSSandboxPhoneNumber -> CreateSMSSandboxPhoneNumber -> Bool
$c== :: CreateSMSSandboxPhoneNumber -> CreateSMSSandboxPhoneNumber -> Bool
Prelude.Eq, ReadPrec [CreateSMSSandboxPhoneNumber]
ReadPrec CreateSMSSandboxPhoneNumber
Int -> ReadS CreateSMSSandboxPhoneNumber
ReadS [CreateSMSSandboxPhoneNumber]
(Int -> ReadS CreateSMSSandboxPhoneNumber)
-> ReadS [CreateSMSSandboxPhoneNumber]
-> ReadPrec CreateSMSSandboxPhoneNumber
-> ReadPrec [CreateSMSSandboxPhoneNumber]
-> Read CreateSMSSandboxPhoneNumber
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSMSSandboxPhoneNumber]
$creadListPrec :: ReadPrec [CreateSMSSandboxPhoneNumber]
readPrec :: ReadPrec CreateSMSSandboxPhoneNumber
$creadPrec :: ReadPrec CreateSMSSandboxPhoneNumber
readList :: ReadS [CreateSMSSandboxPhoneNumber]
$creadList :: ReadS [CreateSMSSandboxPhoneNumber]
readsPrec :: Int -> ReadS CreateSMSSandboxPhoneNumber
$creadsPrec :: Int -> ReadS CreateSMSSandboxPhoneNumber
Prelude.Read, Int -> CreateSMSSandboxPhoneNumber -> ShowS
[CreateSMSSandboxPhoneNumber] -> ShowS
CreateSMSSandboxPhoneNumber -> String
(Int -> CreateSMSSandboxPhoneNumber -> ShowS)
-> (CreateSMSSandboxPhoneNumber -> String)
-> ([CreateSMSSandboxPhoneNumber] -> ShowS)
-> Show CreateSMSSandboxPhoneNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSMSSandboxPhoneNumber] -> ShowS
$cshowList :: [CreateSMSSandboxPhoneNumber] -> ShowS
show :: CreateSMSSandboxPhoneNumber -> String
$cshow :: CreateSMSSandboxPhoneNumber -> String
showsPrec :: Int -> CreateSMSSandboxPhoneNumber -> ShowS
$cshowsPrec :: Int -> CreateSMSSandboxPhoneNumber -> ShowS
Prelude.Show, (forall x.
CreateSMSSandboxPhoneNumber -> Rep CreateSMSSandboxPhoneNumber x)
-> (forall x.
Rep CreateSMSSandboxPhoneNumber x -> CreateSMSSandboxPhoneNumber)
-> Generic CreateSMSSandboxPhoneNumber
forall x.
Rep CreateSMSSandboxPhoneNumber x -> CreateSMSSandboxPhoneNumber
forall x.
CreateSMSSandboxPhoneNumber -> Rep CreateSMSSandboxPhoneNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSMSSandboxPhoneNumber x -> CreateSMSSandboxPhoneNumber
$cfrom :: forall x.
CreateSMSSandboxPhoneNumber -> Rep CreateSMSSandboxPhoneNumber x
Prelude.Generic)
newCreateSMSSandboxPhoneNumber ::
Prelude.Text ->
CreateSMSSandboxPhoneNumber
newCreateSMSSandboxPhoneNumber :: Text -> CreateSMSSandboxPhoneNumber
newCreateSMSSandboxPhoneNumber Text
pPhoneNumber_ =
CreateSMSSandboxPhoneNumber' :: Maybe LanguageCodeString -> Text -> CreateSMSSandboxPhoneNumber
CreateSMSSandboxPhoneNumber'
{ $sel:languageCode:CreateSMSSandboxPhoneNumber' :: Maybe LanguageCodeString
languageCode =
Maybe LanguageCodeString
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:CreateSMSSandboxPhoneNumber' :: Text
phoneNumber = Text
pPhoneNumber_
}
createSMSSandboxPhoneNumber_languageCode :: Lens.Lens' CreateSMSSandboxPhoneNumber (Prelude.Maybe LanguageCodeString)
createSMSSandboxPhoneNumber_languageCode :: (Maybe LanguageCodeString -> f (Maybe LanguageCodeString))
-> CreateSMSSandboxPhoneNumber -> f CreateSMSSandboxPhoneNumber
createSMSSandboxPhoneNumber_languageCode = (CreateSMSSandboxPhoneNumber -> Maybe LanguageCodeString)
-> (CreateSMSSandboxPhoneNumber
-> Maybe LanguageCodeString -> CreateSMSSandboxPhoneNumber)
-> Lens
CreateSMSSandboxPhoneNumber
CreateSMSSandboxPhoneNumber
(Maybe LanguageCodeString)
(Maybe LanguageCodeString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSMSSandboxPhoneNumber' {Maybe LanguageCodeString
languageCode :: Maybe LanguageCodeString
$sel:languageCode:CreateSMSSandboxPhoneNumber' :: CreateSMSSandboxPhoneNumber -> Maybe LanguageCodeString
languageCode} -> Maybe LanguageCodeString
languageCode) (\s :: CreateSMSSandboxPhoneNumber
s@CreateSMSSandboxPhoneNumber' {} Maybe LanguageCodeString
a -> CreateSMSSandboxPhoneNumber
s {$sel:languageCode:CreateSMSSandboxPhoneNumber' :: Maybe LanguageCodeString
languageCode = Maybe LanguageCodeString
a} :: CreateSMSSandboxPhoneNumber)
createSMSSandboxPhoneNumber_phoneNumber :: Lens.Lens' CreateSMSSandboxPhoneNumber Prelude.Text
createSMSSandboxPhoneNumber_phoneNumber :: (Text -> f Text)
-> CreateSMSSandboxPhoneNumber -> f CreateSMSSandboxPhoneNumber
createSMSSandboxPhoneNumber_phoneNumber = (CreateSMSSandboxPhoneNumber -> Text)
-> (CreateSMSSandboxPhoneNumber
-> Text -> CreateSMSSandboxPhoneNumber)
-> Lens
CreateSMSSandboxPhoneNumber CreateSMSSandboxPhoneNumber Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSMSSandboxPhoneNumber' {Text
phoneNumber :: Text
$sel:phoneNumber:CreateSMSSandboxPhoneNumber' :: CreateSMSSandboxPhoneNumber -> Text
phoneNumber} -> Text
phoneNumber) (\s :: CreateSMSSandboxPhoneNumber
s@CreateSMSSandboxPhoneNumber' {} Text
a -> CreateSMSSandboxPhoneNumber
s {$sel:phoneNumber:CreateSMSSandboxPhoneNumber' :: Text
phoneNumber = Text
a} :: CreateSMSSandboxPhoneNumber)
instance Core.AWSRequest CreateSMSSandboxPhoneNumber where
type
AWSResponse CreateSMSSandboxPhoneNumber =
CreateSMSSandboxPhoneNumberResponse
request :: CreateSMSSandboxPhoneNumber -> Request CreateSMSSandboxPhoneNumber
request = Service
-> CreateSMSSandboxPhoneNumber
-> Request CreateSMSSandboxPhoneNumber
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateSMSSandboxPhoneNumber
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSMSSandboxPhoneNumber)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateSMSSandboxPhoneNumber))
-> Logger
-> Service
-> Proxy CreateSMSSandboxPhoneNumber
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSMSSandboxPhoneNumber)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateSMSSandboxPhoneNumberResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> CreateSMSSandboxPhoneNumberResponse
CreateSMSSandboxPhoneNumberResponse'
(Int -> CreateSMSSandboxPhoneNumberResponse)
-> Either String Int
-> Either String CreateSMSSandboxPhoneNumberResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateSMSSandboxPhoneNumber
instance Prelude.NFData CreateSMSSandboxPhoneNumber
instance Core.ToHeaders CreateSMSSandboxPhoneNumber where
toHeaders :: CreateSMSSandboxPhoneNumber -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateSMSSandboxPhoneNumber -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateSMSSandboxPhoneNumber where
toPath :: CreateSMSSandboxPhoneNumber -> ByteString
toPath = ByteString -> CreateSMSSandboxPhoneNumber -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateSMSSandboxPhoneNumber where
toQuery :: CreateSMSSandboxPhoneNumber -> QueryString
toQuery CreateSMSSandboxPhoneNumber' {Maybe LanguageCodeString
Text
phoneNumber :: Text
languageCode :: Maybe LanguageCodeString
$sel:phoneNumber:CreateSMSSandboxPhoneNumber' :: CreateSMSSandboxPhoneNumber -> Text
$sel:languageCode:CreateSMSSandboxPhoneNumber' :: CreateSMSSandboxPhoneNumber -> Maybe LanguageCodeString
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CreateSMSSandboxPhoneNumber" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"LanguageCode" ByteString -> Maybe LanguageCodeString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LanguageCodeString
languageCode,
ByteString
"PhoneNumber" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
phoneNumber
]
data CreateSMSSandboxPhoneNumberResponse = CreateSMSSandboxPhoneNumberResponse'
{
CreateSMSSandboxPhoneNumberResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool
(CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool)
-> (CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool)
-> Eq CreateSMSSandboxPhoneNumberResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool
$c/= :: CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool
== :: CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool
$c== :: CreateSMSSandboxPhoneNumberResponse
-> CreateSMSSandboxPhoneNumberResponse -> Bool
Prelude.Eq, ReadPrec [CreateSMSSandboxPhoneNumberResponse]
ReadPrec CreateSMSSandboxPhoneNumberResponse
Int -> ReadS CreateSMSSandboxPhoneNumberResponse
ReadS [CreateSMSSandboxPhoneNumberResponse]
(Int -> ReadS CreateSMSSandboxPhoneNumberResponse)
-> ReadS [CreateSMSSandboxPhoneNumberResponse]
-> ReadPrec CreateSMSSandboxPhoneNumberResponse
-> ReadPrec [CreateSMSSandboxPhoneNumberResponse]
-> Read CreateSMSSandboxPhoneNumberResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSMSSandboxPhoneNumberResponse]
$creadListPrec :: ReadPrec [CreateSMSSandboxPhoneNumberResponse]
readPrec :: ReadPrec CreateSMSSandboxPhoneNumberResponse
$creadPrec :: ReadPrec CreateSMSSandboxPhoneNumberResponse
readList :: ReadS [CreateSMSSandboxPhoneNumberResponse]
$creadList :: ReadS [CreateSMSSandboxPhoneNumberResponse]
readsPrec :: Int -> ReadS CreateSMSSandboxPhoneNumberResponse
$creadsPrec :: Int -> ReadS CreateSMSSandboxPhoneNumberResponse
Prelude.Read, Int -> CreateSMSSandboxPhoneNumberResponse -> ShowS
[CreateSMSSandboxPhoneNumberResponse] -> ShowS
CreateSMSSandboxPhoneNumberResponse -> String
(Int -> CreateSMSSandboxPhoneNumberResponse -> ShowS)
-> (CreateSMSSandboxPhoneNumberResponse -> String)
-> ([CreateSMSSandboxPhoneNumberResponse] -> ShowS)
-> Show CreateSMSSandboxPhoneNumberResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSMSSandboxPhoneNumberResponse] -> ShowS
$cshowList :: [CreateSMSSandboxPhoneNumberResponse] -> ShowS
show :: CreateSMSSandboxPhoneNumberResponse -> String
$cshow :: CreateSMSSandboxPhoneNumberResponse -> String
showsPrec :: Int -> CreateSMSSandboxPhoneNumberResponse -> ShowS
$cshowsPrec :: Int -> CreateSMSSandboxPhoneNumberResponse -> ShowS
Prelude.Show, (forall x.
CreateSMSSandboxPhoneNumberResponse
-> Rep CreateSMSSandboxPhoneNumberResponse x)
-> (forall x.
Rep CreateSMSSandboxPhoneNumberResponse x
-> CreateSMSSandboxPhoneNumberResponse)
-> Generic CreateSMSSandboxPhoneNumberResponse
forall x.
Rep CreateSMSSandboxPhoneNumberResponse x
-> CreateSMSSandboxPhoneNumberResponse
forall x.
CreateSMSSandboxPhoneNumberResponse
-> Rep CreateSMSSandboxPhoneNumberResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSMSSandboxPhoneNumberResponse x
-> CreateSMSSandboxPhoneNumberResponse
$cfrom :: forall x.
CreateSMSSandboxPhoneNumberResponse
-> Rep CreateSMSSandboxPhoneNumberResponse x
Prelude.Generic)
newCreateSMSSandboxPhoneNumberResponse ::
Prelude.Int ->
CreateSMSSandboxPhoneNumberResponse
newCreateSMSSandboxPhoneNumberResponse :: Int -> CreateSMSSandboxPhoneNumberResponse
newCreateSMSSandboxPhoneNumberResponse Int
pHttpStatus_ =
CreateSMSSandboxPhoneNumberResponse' :: Int -> CreateSMSSandboxPhoneNumberResponse
CreateSMSSandboxPhoneNumberResponse'
{ $sel:httpStatus:CreateSMSSandboxPhoneNumberResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createSMSSandboxPhoneNumberResponse_httpStatus :: Lens.Lens' CreateSMSSandboxPhoneNumberResponse Prelude.Int
createSMSSandboxPhoneNumberResponse_httpStatus :: (Int -> f Int)
-> CreateSMSSandboxPhoneNumberResponse
-> f CreateSMSSandboxPhoneNumberResponse
createSMSSandboxPhoneNumberResponse_httpStatus = (CreateSMSSandboxPhoneNumberResponse -> Int)
-> (CreateSMSSandboxPhoneNumberResponse
-> Int -> CreateSMSSandboxPhoneNumberResponse)
-> Lens
CreateSMSSandboxPhoneNumberResponse
CreateSMSSandboxPhoneNumberResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSMSSandboxPhoneNumberResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSMSSandboxPhoneNumberResponse' :: CreateSMSSandboxPhoneNumberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSMSSandboxPhoneNumberResponse
s@CreateSMSSandboxPhoneNumberResponse' {} Int
a -> CreateSMSSandboxPhoneNumberResponse
s {$sel:httpStatus:CreateSMSSandboxPhoneNumberResponse' :: Int
httpStatus = Int
a} :: CreateSMSSandboxPhoneNumberResponse)
instance
Prelude.NFData
CreateSMSSandboxPhoneNumberResponse