{-# 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.UpdateAPNSSandboxChannel
(
updateAPNSSandboxChannel
, UpdateAPNSSandboxChannel
, uascApplicationId
, uascAPNSSandboxChannelRequest
, updateAPNSSandboxChannelResponse
, UpdateAPNSSandboxChannelResponse
, uascrsResponseStatus
, uascrsAPNSSandboxChannelResponse
) 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 UpdateAPNSSandboxChannel = UpdateAPNSSandboxChannel'
{ _uascApplicationId :: !Text
, _uascAPNSSandboxChannelRequest :: !APNSSandboxChannelRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSSandboxChannel
:: Text
-> APNSSandboxChannelRequest
-> UpdateAPNSSandboxChannel
updateAPNSSandboxChannel pApplicationId_ pAPNSSandboxChannelRequest_ =
UpdateAPNSSandboxChannel'
{ _uascApplicationId = pApplicationId_
, _uascAPNSSandboxChannelRequest = pAPNSSandboxChannelRequest_
}
uascApplicationId :: Lens' UpdateAPNSSandboxChannel Text
uascApplicationId = lens _uascApplicationId (\ s a -> s{_uascApplicationId = a})
uascAPNSSandboxChannelRequest :: Lens' UpdateAPNSSandboxChannel APNSSandboxChannelRequest
uascAPNSSandboxChannelRequest = lens _uascAPNSSandboxChannelRequest (\ s a -> s{_uascAPNSSandboxChannelRequest = a})
instance AWSRequest UpdateAPNSSandboxChannel where
type Rs UpdateAPNSSandboxChannel =
UpdateAPNSSandboxChannelResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateAPNSSandboxChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateAPNSSandboxChannel where
instance NFData UpdateAPNSSandboxChannel where
instance ToHeaders UpdateAPNSSandboxChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateAPNSSandboxChannel where
toJSON UpdateAPNSSandboxChannel'{..}
= object
(catMaybes
[Just
("APNSSandboxChannelRequest" .=
_uascAPNSSandboxChannelRequest)])
instance ToPath UpdateAPNSSandboxChannel where
toPath UpdateAPNSSandboxChannel'{..}
= mconcat
["/v1/apps/", toBS _uascApplicationId,
"/channels/apns_sandbox"]
instance ToQuery UpdateAPNSSandboxChannel where
toQuery = const mempty
data UpdateAPNSSandboxChannelResponse = UpdateAPNSSandboxChannelResponse'
{ _uascrsResponseStatus :: !Int
, _uascrsAPNSSandboxChannelResponse :: !APNSSandboxChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSSandboxChannelResponse
:: Int
-> APNSSandboxChannelResponse
-> UpdateAPNSSandboxChannelResponse
updateAPNSSandboxChannelResponse pResponseStatus_ pAPNSSandboxChannelResponse_ =
UpdateAPNSSandboxChannelResponse'
{ _uascrsResponseStatus = pResponseStatus_
, _uascrsAPNSSandboxChannelResponse = pAPNSSandboxChannelResponse_
}
uascrsResponseStatus :: Lens' UpdateAPNSSandboxChannelResponse Int
uascrsResponseStatus = lens _uascrsResponseStatus (\ s a -> s{_uascrsResponseStatus = a})
uascrsAPNSSandboxChannelResponse :: Lens' UpdateAPNSSandboxChannelResponse APNSSandboxChannelResponse
uascrsAPNSSandboxChannelResponse = lens _uascrsAPNSSandboxChannelResponse (\ s a -> s{_uascrsAPNSSandboxChannelResponse = a})
instance NFData UpdateAPNSSandboxChannelResponse
where