{-# 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.GetGCMChannel
(
getGCMChannel
, GetGCMChannel
, ggcApplicationId
, getGCMChannelResponse
, GetGCMChannelResponse
, ggcrsResponseStatus
, ggcrsGCMChannelResponse
) 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 GetGCMChannel = GetGCMChannel'
{ _ggcApplicationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGCMChannel
:: Text
-> GetGCMChannel
getGCMChannel pApplicationId_ =
GetGCMChannel' {_ggcApplicationId = pApplicationId_}
ggcApplicationId :: Lens' GetGCMChannel Text
ggcApplicationId = lens _ggcApplicationId (\ s a -> s{_ggcApplicationId = a})
instance AWSRequest GetGCMChannel where
type Rs GetGCMChannel = GetGCMChannelResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetGCMChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetGCMChannel where
instance NFData GetGCMChannel where
instance ToHeaders GetGCMChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetGCMChannel where
toPath GetGCMChannel'{..}
= mconcat
["/v1/apps/", toBS _ggcApplicationId,
"/channels/gcm"]
instance ToQuery GetGCMChannel where
toQuery = const mempty
data GetGCMChannelResponse = GetGCMChannelResponse'
{ _ggcrsResponseStatus :: !Int
, _ggcrsGCMChannelResponse :: !GCMChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGCMChannelResponse
:: Int
-> GCMChannelResponse
-> GetGCMChannelResponse
getGCMChannelResponse pResponseStatus_ pGCMChannelResponse_ =
GetGCMChannelResponse'
{ _ggcrsResponseStatus = pResponseStatus_
, _ggcrsGCMChannelResponse = pGCMChannelResponse_
}
ggcrsResponseStatus :: Lens' GetGCMChannelResponse Int
ggcrsResponseStatus = lens _ggcrsResponseStatus (\ s a -> s{_ggcrsResponseStatus = a})
ggcrsGCMChannelResponse :: Lens' GetGCMChannelResponse GCMChannelResponse
ggcrsGCMChannelResponse = lens _ggcrsGCMChannelResponse (\ s a -> s{_ggcrsGCMChannelResponse = a})
instance NFData GetGCMChannelResponse where