{-# 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.ListPhoneNumbersOptedOut
(
listPhoneNumbersOptedOut
, ListPhoneNumbersOptedOut
, lpnooNextToken
, listPhoneNumbersOptedOutResponse
, ListPhoneNumbersOptedOutResponse
, lpnoorsPhoneNumbers
, lpnoorsNextToken
, lpnoorsResponseStatus
) 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 ListPhoneNumbersOptedOut = ListPhoneNumbersOptedOut'
{ _lpnooNextToken :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listPhoneNumbersOptedOut
:: ListPhoneNumbersOptedOut
listPhoneNumbersOptedOut = ListPhoneNumbersOptedOut' {_lpnooNextToken = Nothing}
lpnooNextToken :: Lens' ListPhoneNumbersOptedOut (Maybe Text)
lpnooNextToken = lens _lpnooNextToken (\ s a -> s{_lpnooNextToken = a})
instance AWSRequest ListPhoneNumbersOptedOut where
type Rs ListPhoneNumbersOptedOut =
ListPhoneNumbersOptedOutResponse
request = postQuery sns
response
= receiveXMLWrapper "ListPhoneNumbersOptedOutResult"
(\ s h x ->
ListPhoneNumbersOptedOutResponse' <$>
(x .@? "phoneNumbers" .!@ mempty >>=
may (parseXMLList "member"))
<*> (x .@? "nextToken")
<*> (pure (fromEnum s)))
instance Hashable ListPhoneNumbersOptedOut where
instance NFData ListPhoneNumbersOptedOut where
instance ToHeaders ListPhoneNumbersOptedOut where
toHeaders = const mempty
instance ToPath ListPhoneNumbersOptedOut where
toPath = const "/"
instance ToQuery ListPhoneNumbersOptedOut where
toQuery ListPhoneNumbersOptedOut'{..}
= mconcat
["Action" =:
("ListPhoneNumbersOptedOut" :: ByteString),
"Version" =: ("2010-03-31" :: ByteString),
"nextToken" =: _lpnooNextToken]
data ListPhoneNumbersOptedOutResponse = ListPhoneNumbersOptedOutResponse'
{ _lpnoorsPhoneNumbers :: !(Maybe [Text])
, _lpnoorsNextToken :: !(Maybe Text)
, _lpnoorsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listPhoneNumbersOptedOutResponse
:: Int
-> ListPhoneNumbersOptedOutResponse
listPhoneNumbersOptedOutResponse pResponseStatus_ =
ListPhoneNumbersOptedOutResponse'
{ _lpnoorsPhoneNumbers = Nothing
, _lpnoorsNextToken = Nothing
, _lpnoorsResponseStatus = pResponseStatus_
}
lpnoorsPhoneNumbers :: Lens' ListPhoneNumbersOptedOutResponse [Text]
lpnoorsPhoneNumbers = lens _lpnoorsPhoneNumbers (\ s a -> s{_lpnoorsPhoneNumbers = a}) . _Default . _Coerce
lpnoorsNextToken :: Lens' ListPhoneNumbersOptedOutResponse (Maybe Text)
lpnoorsNextToken = lens _lpnoorsNextToken (\ s a -> s{_lpnoorsNextToken = a})
lpnoorsResponseStatus :: Lens' ListPhoneNumbersOptedOutResponse Int
lpnoorsResponseStatus = lens _lpnoorsResponseStatus (\ s a -> s{_lpnoorsResponseStatus = a})
instance NFData ListPhoneNumbersOptedOutResponse
where