{-# 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.Pinpoint.UpdateEmailChannel
(
updateEmailChannel
, UpdateEmailChannel
, uecApplicationId
, uecEmailChannelRequest
, updateEmailChannelResponse
, UpdateEmailChannelResponse
, uecrsResponseStatus
, uecrsEmailChannelResponse
) 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
data UpdateEmailChannel = UpdateEmailChannel'
{ _uecApplicationId :: !Text
, _uecEmailChannelRequest :: !EmailChannelRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEmailChannel
:: Text
-> EmailChannelRequest
-> UpdateEmailChannel
updateEmailChannel pApplicationId_ pEmailChannelRequest_ =
UpdateEmailChannel'
{ _uecApplicationId = pApplicationId_
, _uecEmailChannelRequest = pEmailChannelRequest_
}
uecApplicationId :: Lens' UpdateEmailChannel Text
uecApplicationId = lens _uecApplicationId (\ s a -> s{_uecApplicationId = a})
uecEmailChannelRequest :: Lens' UpdateEmailChannel EmailChannelRequest
uecEmailChannelRequest = lens _uecEmailChannelRequest (\ s a -> s{_uecEmailChannelRequest = a})
instance AWSRequest UpdateEmailChannel where
type Rs UpdateEmailChannel =
UpdateEmailChannelResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateEmailChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateEmailChannel where
instance NFData UpdateEmailChannel where
instance ToHeaders UpdateEmailChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateEmailChannel where
toJSON UpdateEmailChannel'{..}
= object
(catMaybes
[Just
("EmailChannelRequest" .= _uecEmailChannelRequest)])
instance ToPath UpdateEmailChannel where
toPath UpdateEmailChannel'{..}
= mconcat
["/v1/apps/", toBS _uecApplicationId,
"/channels/email"]
instance ToQuery UpdateEmailChannel where
toQuery = const mempty
data UpdateEmailChannelResponse = UpdateEmailChannelResponse'
{ _uecrsResponseStatus :: !Int
, _uecrsEmailChannelResponse :: !EmailChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEmailChannelResponse
:: Int
-> EmailChannelResponse
-> UpdateEmailChannelResponse
updateEmailChannelResponse pResponseStatus_ pEmailChannelResponse_ =
UpdateEmailChannelResponse'
{ _uecrsResponseStatus = pResponseStatus_
, _uecrsEmailChannelResponse = pEmailChannelResponse_
}
uecrsResponseStatus :: Lens' UpdateEmailChannelResponse Int
uecrsResponseStatus = lens _uecrsResponseStatus (\ s a -> s{_uecrsResponseStatus = a})
uecrsEmailChannelResponse :: Lens' UpdateEmailChannelResponse EmailChannelResponse
uecrsEmailChannelResponse = lens _uecrsEmailChannelResponse (\ s a -> s{_uecrsEmailChannelResponse = a})
instance NFData UpdateEmailChannelResponse where