{-# 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.UpdateAPNSChannel
(
updateAPNSChannel
, UpdateAPNSChannel
, uacApplicationId
, uacAPNSChannelRequest
, updateAPNSChannelResponse
, UpdateAPNSChannelResponse
, uacrsResponseStatus
, uacrsAPNSChannelResponse
) 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 UpdateAPNSChannel = UpdateAPNSChannel'
{ _uacApplicationId :: !Text
, _uacAPNSChannelRequest :: !APNSChannelRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSChannel
:: Text
-> APNSChannelRequest
-> UpdateAPNSChannel
updateAPNSChannel pApplicationId_ pAPNSChannelRequest_ =
UpdateAPNSChannel'
{ _uacApplicationId = pApplicationId_
, _uacAPNSChannelRequest = pAPNSChannelRequest_
}
uacApplicationId :: Lens' UpdateAPNSChannel Text
uacApplicationId = lens _uacApplicationId (\ s a -> s{_uacApplicationId = a})
uacAPNSChannelRequest :: Lens' UpdateAPNSChannel APNSChannelRequest
uacAPNSChannelRequest = lens _uacAPNSChannelRequest (\ s a -> s{_uacAPNSChannelRequest = a})
instance AWSRequest UpdateAPNSChannel where
type Rs UpdateAPNSChannel = UpdateAPNSChannelResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateAPNSChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateAPNSChannel where
instance NFData UpdateAPNSChannel where
instance ToHeaders UpdateAPNSChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateAPNSChannel where
toJSON UpdateAPNSChannel'{..}
= object
(catMaybes
[Just
("APNSChannelRequest" .= _uacAPNSChannelRequest)])
instance ToPath UpdateAPNSChannel where
toPath UpdateAPNSChannel'{..}
= mconcat
["/v1/apps/", toBS _uacApplicationId,
"/channels/apns"]
instance ToQuery UpdateAPNSChannel where
toQuery = const mempty
data UpdateAPNSChannelResponse = UpdateAPNSChannelResponse'
{ _uacrsResponseStatus :: !Int
, _uacrsAPNSChannelResponse :: !APNSChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSChannelResponse
:: Int
-> APNSChannelResponse
-> UpdateAPNSChannelResponse
updateAPNSChannelResponse pResponseStatus_ pAPNSChannelResponse_ =
UpdateAPNSChannelResponse'
{ _uacrsResponseStatus = pResponseStatus_
, _uacrsAPNSChannelResponse = pAPNSChannelResponse_
}
uacrsResponseStatus :: Lens' UpdateAPNSChannelResponse Int
uacrsResponseStatus = lens _uacrsResponseStatus (\ s a -> s{_uacrsResponseStatus = a})
uacrsAPNSChannelResponse :: Lens' UpdateAPNSChannelResponse APNSChannelResponse
uacrsAPNSChannelResponse = lens _uacrsAPNSChannelResponse (\ s a -> s{_uacrsAPNSChannelResponse = a})
instance NFData UpdateAPNSChannelResponse where