{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.SNS.CheckIfPhoneNumberIsOptedOut
(
checkIfPhoneNumberIsOptedOut
, CheckIfPhoneNumberIsOptedOut
, cipniooPhoneNumber
, checkIfPhoneNumberIsOptedOutResponse
, CheckIfPhoneNumberIsOptedOutResponse
, cipnioorsIsOptedOut
, cipnioorsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SNS.Types
import Network.AWS.SNS.Types.Product
newtype CheckIfPhoneNumberIsOptedOut = CheckIfPhoneNumberIsOptedOut'
{ _cipniooPhoneNumber :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
checkIfPhoneNumberIsOptedOut
:: Text
-> CheckIfPhoneNumberIsOptedOut
checkIfPhoneNumberIsOptedOut pPhoneNumber_ =
CheckIfPhoneNumberIsOptedOut' {_cipniooPhoneNumber = pPhoneNumber_}
cipniooPhoneNumber :: Lens' CheckIfPhoneNumberIsOptedOut Text
cipniooPhoneNumber = lens _cipniooPhoneNumber (\ s a -> s{_cipniooPhoneNumber = a})
instance AWSRequest CheckIfPhoneNumberIsOptedOut
where
type Rs CheckIfPhoneNumberIsOptedOut =
CheckIfPhoneNumberIsOptedOutResponse
request = postQuery sns
response
= receiveXMLWrapper
"CheckIfPhoneNumberIsOptedOutResult"
(\ s h x ->
CheckIfPhoneNumberIsOptedOutResponse' <$>
(x .@? "isOptedOut") <*> (pure (fromEnum s)))
instance Hashable CheckIfPhoneNumberIsOptedOut where
instance NFData CheckIfPhoneNumberIsOptedOut where
instance ToHeaders CheckIfPhoneNumberIsOptedOut where
toHeaders = const mempty
instance ToPath CheckIfPhoneNumberIsOptedOut where
toPath = const "/"
instance ToQuery CheckIfPhoneNumberIsOptedOut where
toQuery CheckIfPhoneNumberIsOptedOut'{..}
= mconcat
["Action" =:
("CheckIfPhoneNumberIsOptedOut" :: ByteString),
"Version" =: ("2010-03-31" :: ByteString),
"phoneNumber" =: _cipniooPhoneNumber]
data CheckIfPhoneNumberIsOptedOutResponse = CheckIfPhoneNumberIsOptedOutResponse'
{ _cipnioorsIsOptedOut :: !(Maybe Bool)
, _cipnioorsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
checkIfPhoneNumberIsOptedOutResponse
:: Int
-> CheckIfPhoneNumberIsOptedOutResponse
checkIfPhoneNumberIsOptedOutResponse pResponseStatus_ =
CheckIfPhoneNumberIsOptedOutResponse'
{ _cipnioorsIsOptedOut = Nothing
, _cipnioorsResponseStatus = pResponseStatus_
}
cipnioorsIsOptedOut :: Lens' CheckIfPhoneNumberIsOptedOutResponse (Maybe Bool)
cipnioorsIsOptedOut = lens _cipnioorsIsOptedOut (\ s a -> s{_cipnioorsIsOptedOut = a})
cipnioorsResponseStatus :: Lens' CheckIfPhoneNumberIsOptedOutResponse Int
cipnioorsResponseStatus = lens _cipnioorsResponseStatus (\ s a -> s{_cipnioorsResponseStatus = a})
instance NFData CheckIfPhoneNumberIsOptedOutResponse
where