{-# 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.CheckIfPhoneNumberIsOptedOut
(
CheckIfPhoneNumberIsOptedOut (..),
newCheckIfPhoneNumberIsOptedOut,
checkIfPhoneNumberIsOptedOut_phoneNumber,
CheckIfPhoneNumberIsOptedOutResponse (..),
newCheckIfPhoneNumberIsOptedOutResponse,
checkIfPhoneNumberIsOptedOutResponse_isOptedOut,
checkIfPhoneNumberIsOptedOutResponse_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 CheckIfPhoneNumberIsOptedOut = CheckIfPhoneNumberIsOptedOut'
{
CheckIfPhoneNumberIsOptedOut -> Text
phoneNumber :: Prelude.Text
}
deriving (CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool
(CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool)
-> (CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool)
-> Eq CheckIfPhoneNumberIsOptedOut
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool
$c/= :: CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool
== :: CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool
$c== :: CheckIfPhoneNumberIsOptedOut
-> CheckIfPhoneNumberIsOptedOut -> Bool
Prelude.Eq, ReadPrec [CheckIfPhoneNumberIsOptedOut]
ReadPrec CheckIfPhoneNumberIsOptedOut
Int -> ReadS CheckIfPhoneNumberIsOptedOut
ReadS [CheckIfPhoneNumberIsOptedOut]
(Int -> ReadS CheckIfPhoneNumberIsOptedOut)
-> ReadS [CheckIfPhoneNumberIsOptedOut]
-> ReadPrec CheckIfPhoneNumberIsOptedOut
-> ReadPrec [CheckIfPhoneNumberIsOptedOut]
-> Read CheckIfPhoneNumberIsOptedOut
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckIfPhoneNumberIsOptedOut]
$creadListPrec :: ReadPrec [CheckIfPhoneNumberIsOptedOut]
readPrec :: ReadPrec CheckIfPhoneNumberIsOptedOut
$creadPrec :: ReadPrec CheckIfPhoneNumberIsOptedOut
readList :: ReadS [CheckIfPhoneNumberIsOptedOut]
$creadList :: ReadS [CheckIfPhoneNumberIsOptedOut]
readsPrec :: Int -> ReadS CheckIfPhoneNumberIsOptedOut
$creadsPrec :: Int -> ReadS CheckIfPhoneNumberIsOptedOut
Prelude.Read, Int -> CheckIfPhoneNumberIsOptedOut -> ShowS
[CheckIfPhoneNumberIsOptedOut] -> ShowS
CheckIfPhoneNumberIsOptedOut -> String
(Int -> CheckIfPhoneNumberIsOptedOut -> ShowS)
-> (CheckIfPhoneNumberIsOptedOut -> String)
-> ([CheckIfPhoneNumberIsOptedOut] -> ShowS)
-> Show CheckIfPhoneNumberIsOptedOut
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckIfPhoneNumberIsOptedOut] -> ShowS
$cshowList :: [CheckIfPhoneNumberIsOptedOut] -> ShowS
show :: CheckIfPhoneNumberIsOptedOut -> String
$cshow :: CheckIfPhoneNumberIsOptedOut -> String
showsPrec :: Int -> CheckIfPhoneNumberIsOptedOut -> ShowS
$cshowsPrec :: Int -> CheckIfPhoneNumberIsOptedOut -> ShowS
Prelude.Show, (forall x.
CheckIfPhoneNumberIsOptedOut -> Rep CheckIfPhoneNumberIsOptedOut x)
-> (forall x.
Rep CheckIfPhoneNumberIsOptedOut x -> CheckIfPhoneNumberIsOptedOut)
-> Generic CheckIfPhoneNumberIsOptedOut
forall x.
Rep CheckIfPhoneNumberIsOptedOut x -> CheckIfPhoneNumberIsOptedOut
forall x.
CheckIfPhoneNumberIsOptedOut -> Rep CheckIfPhoneNumberIsOptedOut x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckIfPhoneNumberIsOptedOut x -> CheckIfPhoneNumberIsOptedOut
$cfrom :: forall x.
CheckIfPhoneNumberIsOptedOut -> Rep CheckIfPhoneNumberIsOptedOut x
Prelude.Generic)
newCheckIfPhoneNumberIsOptedOut ::
Prelude.Text ->
CheckIfPhoneNumberIsOptedOut
newCheckIfPhoneNumberIsOptedOut :: Text -> CheckIfPhoneNumberIsOptedOut
newCheckIfPhoneNumberIsOptedOut Text
pPhoneNumber_ =
CheckIfPhoneNumberIsOptedOut' :: Text -> CheckIfPhoneNumberIsOptedOut
CheckIfPhoneNumberIsOptedOut'
{ $sel:phoneNumber:CheckIfPhoneNumberIsOptedOut' :: Text
phoneNumber =
Text
pPhoneNumber_
}
checkIfPhoneNumberIsOptedOut_phoneNumber :: Lens.Lens' CheckIfPhoneNumberIsOptedOut Prelude.Text
checkIfPhoneNumberIsOptedOut_phoneNumber :: (Text -> f Text)
-> CheckIfPhoneNumberIsOptedOut -> f CheckIfPhoneNumberIsOptedOut
checkIfPhoneNumberIsOptedOut_phoneNumber = (CheckIfPhoneNumberIsOptedOut -> Text)
-> (CheckIfPhoneNumberIsOptedOut
-> Text -> CheckIfPhoneNumberIsOptedOut)
-> Lens
CheckIfPhoneNumberIsOptedOut CheckIfPhoneNumberIsOptedOut Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckIfPhoneNumberIsOptedOut' {Text
phoneNumber :: Text
$sel:phoneNumber:CheckIfPhoneNumberIsOptedOut' :: CheckIfPhoneNumberIsOptedOut -> Text
phoneNumber} -> Text
phoneNumber) (\s :: CheckIfPhoneNumberIsOptedOut
s@CheckIfPhoneNumberIsOptedOut' {} Text
a -> CheckIfPhoneNumberIsOptedOut
s {$sel:phoneNumber:CheckIfPhoneNumberIsOptedOut' :: Text
phoneNumber = Text
a} :: CheckIfPhoneNumberIsOptedOut)
instance Core.AWSRequest CheckIfPhoneNumberIsOptedOut where
type
AWSResponse CheckIfPhoneNumberIsOptedOut =
CheckIfPhoneNumberIsOptedOutResponse
request :: CheckIfPhoneNumberIsOptedOut
-> Request CheckIfPhoneNumberIsOptedOut
request = Service
-> CheckIfPhoneNumberIsOptedOut
-> Request CheckIfPhoneNumberIsOptedOut
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CheckIfPhoneNumberIsOptedOut
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckIfPhoneNumberIsOptedOut)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CheckIfPhoneNumberIsOptedOut))
-> Logger
-> Service
-> Proxy CheckIfPhoneNumberIsOptedOut
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CheckIfPhoneNumberIsOptedOut)))
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
"CheckIfPhoneNumberIsOptedOutResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool -> Int -> CheckIfPhoneNumberIsOptedOutResponse
CheckIfPhoneNumberIsOptedOutResponse'
(Maybe Bool -> Int -> CheckIfPhoneNumberIsOptedOutResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> CheckIfPhoneNumberIsOptedOutResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"isOptedOut")
Either String (Int -> CheckIfPhoneNumberIsOptedOutResponse)
-> Either String Int
-> Either String CheckIfPhoneNumberIsOptedOutResponse
forall (f :: * -> *) a b. Applicative f => 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
CheckIfPhoneNumberIsOptedOut
instance Prelude.NFData CheckIfPhoneNumberIsOptedOut
instance Core.ToHeaders CheckIfPhoneNumberIsOptedOut where
toHeaders :: CheckIfPhoneNumberIsOptedOut -> ResponseHeaders
toHeaders = ResponseHeaders -> CheckIfPhoneNumberIsOptedOut -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CheckIfPhoneNumberIsOptedOut where
toPath :: CheckIfPhoneNumberIsOptedOut -> ByteString
toPath = ByteString -> CheckIfPhoneNumberIsOptedOut -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CheckIfPhoneNumberIsOptedOut where
toQuery :: CheckIfPhoneNumberIsOptedOut -> QueryString
toQuery CheckIfPhoneNumberIsOptedOut' {Text
phoneNumber :: Text
$sel:phoneNumber:CheckIfPhoneNumberIsOptedOut' :: CheckIfPhoneNumberIsOptedOut -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"CheckIfPhoneNumberIsOptedOut" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"phoneNumber" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
phoneNumber
]
data CheckIfPhoneNumberIsOptedOutResponse = CheckIfPhoneNumberIsOptedOutResponse'
{
CheckIfPhoneNumberIsOptedOutResponse -> Maybe Bool
isOptedOut :: Prelude.Maybe Prelude.Bool,
CheckIfPhoneNumberIsOptedOutResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool
(CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool)
-> (CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool)
-> Eq CheckIfPhoneNumberIsOptedOutResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool
$c/= :: CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool
== :: CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool
$c== :: CheckIfPhoneNumberIsOptedOutResponse
-> CheckIfPhoneNumberIsOptedOutResponse -> Bool
Prelude.Eq, ReadPrec [CheckIfPhoneNumberIsOptedOutResponse]
ReadPrec CheckIfPhoneNumberIsOptedOutResponse
Int -> ReadS CheckIfPhoneNumberIsOptedOutResponse
ReadS [CheckIfPhoneNumberIsOptedOutResponse]
(Int -> ReadS CheckIfPhoneNumberIsOptedOutResponse)
-> ReadS [CheckIfPhoneNumberIsOptedOutResponse]
-> ReadPrec CheckIfPhoneNumberIsOptedOutResponse
-> ReadPrec [CheckIfPhoneNumberIsOptedOutResponse]
-> Read CheckIfPhoneNumberIsOptedOutResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckIfPhoneNumberIsOptedOutResponse]
$creadListPrec :: ReadPrec [CheckIfPhoneNumberIsOptedOutResponse]
readPrec :: ReadPrec CheckIfPhoneNumberIsOptedOutResponse
$creadPrec :: ReadPrec CheckIfPhoneNumberIsOptedOutResponse
readList :: ReadS [CheckIfPhoneNumberIsOptedOutResponse]
$creadList :: ReadS [CheckIfPhoneNumberIsOptedOutResponse]
readsPrec :: Int -> ReadS CheckIfPhoneNumberIsOptedOutResponse
$creadsPrec :: Int -> ReadS CheckIfPhoneNumberIsOptedOutResponse
Prelude.Read, Int -> CheckIfPhoneNumberIsOptedOutResponse -> ShowS
[CheckIfPhoneNumberIsOptedOutResponse] -> ShowS
CheckIfPhoneNumberIsOptedOutResponse -> String
(Int -> CheckIfPhoneNumberIsOptedOutResponse -> ShowS)
-> (CheckIfPhoneNumberIsOptedOutResponse -> String)
-> ([CheckIfPhoneNumberIsOptedOutResponse] -> ShowS)
-> Show CheckIfPhoneNumberIsOptedOutResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckIfPhoneNumberIsOptedOutResponse] -> ShowS
$cshowList :: [CheckIfPhoneNumberIsOptedOutResponse] -> ShowS
show :: CheckIfPhoneNumberIsOptedOutResponse -> String
$cshow :: CheckIfPhoneNumberIsOptedOutResponse -> String
showsPrec :: Int -> CheckIfPhoneNumberIsOptedOutResponse -> ShowS
$cshowsPrec :: Int -> CheckIfPhoneNumberIsOptedOutResponse -> ShowS
Prelude.Show, (forall x.
CheckIfPhoneNumberIsOptedOutResponse
-> Rep CheckIfPhoneNumberIsOptedOutResponse x)
-> (forall x.
Rep CheckIfPhoneNumberIsOptedOutResponse x
-> CheckIfPhoneNumberIsOptedOutResponse)
-> Generic CheckIfPhoneNumberIsOptedOutResponse
forall x.
Rep CheckIfPhoneNumberIsOptedOutResponse x
-> CheckIfPhoneNumberIsOptedOutResponse
forall x.
CheckIfPhoneNumberIsOptedOutResponse
-> Rep CheckIfPhoneNumberIsOptedOutResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckIfPhoneNumberIsOptedOutResponse x
-> CheckIfPhoneNumberIsOptedOutResponse
$cfrom :: forall x.
CheckIfPhoneNumberIsOptedOutResponse
-> Rep CheckIfPhoneNumberIsOptedOutResponse x
Prelude.Generic)
newCheckIfPhoneNumberIsOptedOutResponse ::
Prelude.Int ->
CheckIfPhoneNumberIsOptedOutResponse
newCheckIfPhoneNumberIsOptedOutResponse :: Int -> CheckIfPhoneNumberIsOptedOutResponse
newCheckIfPhoneNumberIsOptedOutResponse Int
pHttpStatus_ =
CheckIfPhoneNumberIsOptedOutResponse' :: Maybe Bool -> Int -> CheckIfPhoneNumberIsOptedOutResponse
CheckIfPhoneNumberIsOptedOutResponse'
{ $sel:isOptedOut:CheckIfPhoneNumberIsOptedOutResponse' :: Maybe Bool
isOptedOut =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CheckIfPhoneNumberIsOptedOutResponse' :: Int
httpStatus = Int
pHttpStatus_
}
checkIfPhoneNumberIsOptedOutResponse_isOptedOut :: Lens.Lens' CheckIfPhoneNumberIsOptedOutResponse (Prelude.Maybe Prelude.Bool)
checkIfPhoneNumberIsOptedOutResponse_isOptedOut :: (Maybe Bool -> f (Maybe Bool))
-> CheckIfPhoneNumberIsOptedOutResponse
-> f CheckIfPhoneNumberIsOptedOutResponse
checkIfPhoneNumberIsOptedOutResponse_isOptedOut = (CheckIfPhoneNumberIsOptedOutResponse -> Maybe Bool)
-> (CheckIfPhoneNumberIsOptedOutResponse
-> Maybe Bool -> CheckIfPhoneNumberIsOptedOutResponse)
-> Lens
CheckIfPhoneNumberIsOptedOutResponse
CheckIfPhoneNumberIsOptedOutResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckIfPhoneNumberIsOptedOutResponse' {Maybe Bool
isOptedOut :: Maybe Bool
$sel:isOptedOut:CheckIfPhoneNumberIsOptedOutResponse' :: CheckIfPhoneNumberIsOptedOutResponse -> Maybe Bool
isOptedOut} -> Maybe Bool
isOptedOut) (\s :: CheckIfPhoneNumberIsOptedOutResponse
s@CheckIfPhoneNumberIsOptedOutResponse' {} Maybe Bool
a -> CheckIfPhoneNumberIsOptedOutResponse
s {$sel:isOptedOut:CheckIfPhoneNumberIsOptedOutResponse' :: Maybe Bool
isOptedOut = Maybe Bool
a} :: CheckIfPhoneNumberIsOptedOutResponse)
checkIfPhoneNumberIsOptedOutResponse_httpStatus :: Lens.Lens' CheckIfPhoneNumberIsOptedOutResponse Prelude.Int
checkIfPhoneNumberIsOptedOutResponse_httpStatus :: (Int -> f Int)
-> CheckIfPhoneNumberIsOptedOutResponse
-> f CheckIfPhoneNumberIsOptedOutResponse
checkIfPhoneNumberIsOptedOutResponse_httpStatus = (CheckIfPhoneNumberIsOptedOutResponse -> Int)
-> (CheckIfPhoneNumberIsOptedOutResponse
-> Int -> CheckIfPhoneNumberIsOptedOutResponse)
-> Lens
CheckIfPhoneNumberIsOptedOutResponse
CheckIfPhoneNumberIsOptedOutResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckIfPhoneNumberIsOptedOutResponse' {Int
httpStatus :: Int
$sel:httpStatus:CheckIfPhoneNumberIsOptedOutResponse' :: CheckIfPhoneNumberIsOptedOutResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CheckIfPhoneNumberIsOptedOutResponse
s@CheckIfPhoneNumberIsOptedOutResponse' {} Int
a -> CheckIfPhoneNumberIsOptedOutResponse
s {$sel:httpStatus:CheckIfPhoneNumberIsOptedOutResponse' :: Int
httpStatus = Int
a} :: CheckIfPhoneNumberIsOptedOutResponse)
instance
Prelude.NFData
CheckIfPhoneNumberIsOptedOutResponse