{-# 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.OptInPhoneNumber
(
optInPhoneNumber
, OptInPhoneNumber
, oipnPhoneNumber
, optInPhoneNumberResponse
, OptInPhoneNumberResponse
, oipnrsResponseStatus
) 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 OptInPhoneNumber = OptInPhoneNumber'
{ _oipnPhoneNumber :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
optInPhoneNumber
:: Text
-> OptInPhoneNumber
optInPhoneNumber pPhoneNumber_ =
OptInPhoneNumber' {_oipnPhoneNumber = pPhoneNumber_}
oipnPhoneNumber :: Lens' OptInPhoneNumber Text
oipnPhoneNumber = lens _oipnPhoneNumber (\ s a -> s{_oipnPhoneNumber = a})
instance AWSRequest OptInPhoneNumber where
type Rs OptInPhoneNumber = OptInPhoneNumberResponse
request = postQuery sns
response
= receiveXMLWrapper "OptInPhoneNumberResult"
(\ s h x ->
OptInPhoneNumberResponse' <$> (pure (fromEnum s)))
instance Hashable OptInPhoneNumber where
instance NFData OptInPhoneNumber where
instance ToHeaders OptInPhoneNumber where
toHeaders = const mempty
instance ToPath OptInPhoneNumber where
toPath = const "/"
instance ToQuery OptInPhoneNumber where
toQuery OptInPhoneNumber'{..}
= mconcat
["Action" =: ("OptInPhoneNumber" :: ByteString),
"Version" =: ("2010-03-31" :: ByteString),
"phoneNumber" =: _oipnPhoneNumber]
newtype OptInPhoneNumberResponse = OptInPhoneNumberResponse'
{ _oipnrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
optInPhoneNumberResponse
:: Int
-> OptInPhoneNumberResponse
optInPhoneNumberResponse pResponseStatus_ =
OptInPhoneNumberResponse' {_oipnrsResponseStatus = pResponseStatus_}
oipnrsResponseStatus :: Lens' OptInPhoneNumberResponse Int
oipnrsResponseStatus = lens _oipnrsResponseStatus (\ s a -> s{_oipnrsResponseStatus = a})
instance NFData OptInPhoneNumberResponse where