{-# 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.UpdateGCMChannel
(
updateGCMChannel
, UpdateGCMChannel
, ugcApplicationId
, ugcGCMChannelRequest
, updateGCMChannelResponse
, UpdateGCMChannelResponse
, ugcrsResponseStatus
, ugcrsGCMChannelResponse
) 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 UpdateGCMChannel = UpdateGCMChannel'
{ _ugcApplicationId :: !Text
, _ugcGCMChannelRequest :: !GCMChannelRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGCMChannel
:: Text
-> GCMChannelRequest
-> UpdateGCMChannel
updateGCMChannel pApplicationId_ pGCMChannelRequest_ =
UpdateGCMChannel'
{ _ugcApplicationId = pApplicationId_
, _ugcGCMChannelRequest = pGCMChannelRequest_
}
ugcApplicationId :: Lens' UpdateGCMChannel Text
ugcApplicationId = lens _ugcApplicationId (\ s a -> s{_ugcApplicationId = a})
ugcGCMChannelRequest :: Lens' UpdateGCMChannel GCMChannelRequest
ugcGCMChannelRequest = lens _ugcGCMChannelRequest (\ s a -> s{_ugcGCMChannelRequest = a})
instance AWSRequest UpdateGCMChannel where
type Rs UpdateGCMChannel = UpdateGCMChannelResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateGCMChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateGCMChannel where
instance NFData UpdateGCMChannel where
instance ToHeaders UpdateGCMChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateGCMChannel where
toJSON UpdateGCMChannel'{..}
= object
(catMaybes
[Just
("GCMChannelRequest" .= _ugcGCMChannelRequest)])
instance ToPath UpdateGCMChannel where
toPath UpdateGCMChannel'{..}
= mconcat
["/v1/apps/", toBS _ugcApplicationId,
"/channels/gcm"]
instance ToQuery UpdateGCMChannel where
toQuery = const mempty
data UpdateGCMChannelResponse = UpdateGCMChannelResponse'
{ _ugcrsResponseStatus :: !Int
, _ugcrsGCMChannelResponse :: !GCMChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGCMChannelResponse
:: Int
-> GCMChannelResponse
-> UpdateGCMChannelResponse
updateGCMChannelResponse pResponseStatus_ pGCMChannelResponse_ =
UpdateGCMChannelResponse'
{ _ugcrsResponseStatus = pResponseStatus_
, _ugcrsGCMChannelResponse = pGCMChannelResponse_
}
ugcrsResponseStatus :: Lens' UpdateGCMChannelResponse Int
ugcrsResponseStatus = lens _ugcrsResponseStatus (\ s a -> s{_ugcrsResponseStatus = a})
ugcrsGCMChannelResponse :: Lens' UpdateGCMChannelResponse GCMChannelResponse
ugcrsGCMChannelResponse = lens _ugcrsGCMChannelResponse (\ s a -> s{_ugcrsGCMChannelResponse = a})
instance NFData UpdateGCMChannelResponse where