{-# 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.SES.ListCustomVerificationEmailTemplates
(
listCustomVerificationEmailTemplates
, ListCustomVerificationEmailTemplates
, lcvetNextToken
, lcvetMaxResults
, listCustomVerificationEmailTemplatesResponse
, ListCustomVerificationEmailTemplatesResponse
, lcvetrsNextToken
, lcvetrsCustomVerificationEmailTemplates
, lcvetrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SES.Types
import Network.AWS.SES.Types.Product
data ListCustomVerificationEmailTemplates = ListCustomVerificationEmailTemplates'
{ _lcvetNextToken :: !(Maybe Text)
, _lcvetMaxResults :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listCustomVerificationEmailTemplates
:: ListCustomVerificationEmailTemplates
listCustomVerificationEmailTemplates =
ListCustomVerificationEmailTemplates'
{_lcvetNextToken = Nothing, _lcvetMaxResults = Nothing}
lcvetNextToken :: Lens' ListCustomVerificationEmailTemplates (Maybe Text)
lcvetNextToken = lens _lcvetNextToken (\ s a -> s{_lcvetNextToken = a})
lcvetMaxResults :: Lens' ListCustomVerificationEmailTemplates (Maybe Natural)
lcvetMaxResults = lens _lcvetMaxResults (\ s a -> s{_lcvetMaxResults = a}) . mapping _Nat
instance AWSPager
ListCustomVerificationEmailTemplates
where
page rq rs
| stop (rs ^. lcvetrsNextToken) = Nothing
| stop
(rs ^. lcvetrsCustomVerificationEmailTemplates)
= Nothing
| otherwise =
Just $ rq & lcvetNextToken .~ rs ^. lcvetrsNextToken
instance AWSRequest
ListCustomVerificationEmailTemplates
where
type Rs ListCustomVerificationEmailTemplates =
ListCustomVerificationEmailTemplatesResponse
request = postQuery ses
response
= receiveXMLWrapper
"ListCustomVerificationEmailTemplatesResult"
(\ s h x ->
ListCustomVerificationEmailTemplatesResponse' <$>
(x .@? "NextToken") <*>
(x .@? "CustomVerificationEmailTemplates" .!@ mempty
>>= may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable
ListCustomVerificationEmailTemplates
where
instance NFData ListCustomVerificationEmailTemplates
where
instance ToHeaders
ListCustomVerificationEmailTemplates
where
toHeaders = const mempty
instance ToPath ListCustomVerificationEmailTemplates
where
toPath = const "/"
instance ToQuery ListCustomVerificationEmailTemplates
where
toQuery ListCustomVerificationEmailTemplates'{..}
= mconcat
["Action" =:
("ListCustomVerificationEmailTemplates" ::
ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"NextToken" =: _lcvetNextToken,
"MaxResults" =: _lcvetMaxResults]
data ListCustomVerificationEmailTemplatesResponse = ListCustomVerificationEmailTemplatesResponse'
{ _lcvetrsNextToken :: !(Maybe Text)
, _lcvetrsCustomVerificationEmailTemplates :: !(Maybe [CustomVerificationEmailTemplate])
, _lcvetrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listCustomVerificationEmailTemplatesResponse
:: Int
-> ListCustomVerificationEmailTemplatesResponse
listCustomVerificationEmailTemplatesResponse pResponseStatus_ =
ListCustomVerificationEmailTemplatesResponse'
{ _lcvetrsNextToken = Nothing
, _lcvetrsCustomVerificationEmailTemplates = Nothing
, _lcvetrsResponseStatus = pResponseStatus_
}
lcvetrsNextToken :: Lens' ListCustomVerificationEmailTemplatesResponse (Maybe Text)
lcvetrsNextToken = lens _lcvetrsNextToken (\ s a -> s{_lcvetrsNextToken = a})
lcvetrsCustomVerificationEmailTemplates :: Lens' ListCustomVerificationEmailTemplatesResponse [CustomVerificationEmailTemplate]
lcvetrsCustomVerificationEmailTemplates = lens _lcvetrsCustomVerificationEmailTemplates (\ s a -> s{_lcvetrsCustomVerificationEmailTemplates = a}) . _Default . _Coerce
lcvetrsResponseStatus :: Lens' ListCustomVerificationEmailTemplatesResponse Int
lcvetrsResponseStatus = lens _lcvetrsResponseStatus (\ s a -> s{_lcvetrsResponseStatus = a})
instance NFData
ListCustomVerificationEmailTemplatesResponse
where