{-# 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.GetAPNSChannel
(
getAPNSChannel
, GetAPNSChannel
, gacApplicationId
, getAPNSChannelResponse
, GetAPNSChannelResponse
, gacrsResponseStatus
, gacrsAPNSChannelResponse
) 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 GetAPNSChannel = GetAPNSChannel'
{ _gacApplicationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAPNSChannel
:: Text
-> GetAPNSChannel
getAPNSChannel pApplicationId_ =
GetAPNSChannel' {_gacApplicationId = pApplicationId_}
gacApplicationId :: Lens' GetAPNSChannel Text
gacApplicationId = lens _gacApplicationId (\ s a -> s{_gacApplicationId = a})
instance AWSRequest GetAPNSChannel where
type Rs GetAPNSChannel = GetAPNSChannelResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetAPNSChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetAPNSChannel where
instance NFData GetAPNSChannel where
instance ToHeaders GetAPNSChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetAPNSChannel where
toPath GetAPNSChannel'{..}
= mconcat
["/v1/apps/", toBS _gacApplicationId,
"/channels/apns"]
instance ToQuery GetAPNSChannel where
toQuery = const mempty
data GetAPNSChannelResponse = GetAPNSChannelResponse'
{ _gacrsResponseStatus :: !Int
, _gacrsAPNSChannelResponse :: !APNSChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAPNSChannelResponse
:: Int
-> APNSChannelResponse
-> GetAPNSChannelResponse
getAPNSChannelResponse pResponseStatus_ pAPNSChannelResponse_ =
GetAPNSChannelResponse'
{ _gacrsResponseStatus = pResponseStatus_
, _gacrsAPNSChannelResponse = pAPNSChannelResponse_
}
gacrsResponseStatus :: Lens' GetAPNSChannelResponse Int
gacrsResponseStatus = lens _gacrsResponseStatus (\ s a -> s{_gacrsResponseStatus = a})
gacrsAPNSChannelResponse :: Lens' GetAPNSChannelResponse APNSChannelResponse
gacrsAPNSChannelResponse = lens _gacrsAPNSChannelResponse (\ s a -> s{_gacrsAPNSChannelResponse = a})
instance NFData GetAPNSChannelResponse where