module Network.AWS.Pinpoint.GetEmailChannel
(
getEmailChannel
, GetEmailChannel
, gecApplicationId
, getEmailChannelResponse
, GetEmailChannelResponse
, gecrsResponseStatus
, gecrsEmailChannelResponse
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetEmailChannel = GetEmailChannel'
{ _gecApplicationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getEmailChannel
:: Text
-> GetEmailChannel
getEmailChannel pApplicationId_ =
GetEmailChannel' {_gecApplicationId = pApplicationId_}
gecApplicationId :: Lens' GetEmailChannel Text
gecApplicationId = lens _gecApplicationId (\ s a -> s{_gecApplicationId = a});
instance AWSRequest GetEmailChannel where
type Rs GetEmailChannel = GetEmailChannelResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetEmailChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetEmailChannel where
instance NFData GetEmailChannel where
instance ToHeaders GetEmailChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetEmailChannel where
toPath GetEmailChannel'{..}
= mconcat
["/v1/apps/", toBS _gecApplicationId,
"/channels/email"]
instance ToQuery GetEmailChannel where
toQuery = const mempty
data GetEmailChannelResponse = GetEmailChannelResponse'
{ _gecrsResponseStatus :: !Int
, _gecrsEmailChannelResponse :: !EmailChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getEmailChannelResponse
:: Int
-> EmailChannelResponse
-> GetEmailChannelResponse
getEmailChannelResponse pResponseStatus_ pEmailChannelResponse_ =
GetEmailChannelResponse'
{ _gecrsResponseStatus = pResponseStatus_
, _gecrsEmailChannelResponse = pEmailChannelResponse_
}
gecrsResponseStatus :: Lens' GetEmailChannelResponse Int
gecrsResponseStatus = lens _gecrsResponseStatus (\ s a -> s{_gecrsResponseStatus = a});
gecrsEmailChannelResponse :: Lens' GetEmailChannelResponse EmailChannelResponse
gecrsEmailChannelResponse = lens _gecrsEmailChannelResponse (\ s a -> s{_gecrsEmailChannelResponse = a});
instance NFData GetEmailChannelResponse where