{-# 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.UpdateAPNSVoipChannel
(
updateAPNSVoipChannel
, UpdateAPNSVoipChannel
, uavcApplicationId
, uavcAPNSVoipChannelRequest
, updateAPNSVoipChannelResponse
, UpdateAPNSVoipChannelResponse
, uavcrsResponseStatus
, uavcrsAPNSVoipChannelResponse
) 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 UpdateAPNSVoipChannel = UpdateAPNSVoipChannel'
{ _uavcApplicationId :: !Text
, _uavcAPNSVoipChannelRequest :: !APNSVoipChannelRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSVoipChannel
:: Text
-> APNSVoipChannelRequest
-> UpdateAPNSVoipChannel
updateAPNSVoipChannel pApplicationId_ pAPNSVoipChannelRequest_ =
UpdateAPNSVoipChannel'
{ _uavcApplicationId = pApplicationId_
, _uavcAPNSVoipChannelRequest = pAPNSVoipChannelRequest_
}
uavcApplicationId :: Lens' UpdateAPNSVoipChannel Text
uavcApplicationId = lens _uavcApplicationId (\ s a -> s{_uavcApplicationId = a})
uavcAPNSVoipChannelRequest :: Lens' UpdateAPNSVoipChannel APNSVoipChannelRequest
uavcAPNSVoipChannelRequest = lens _uavcAPNSVoipChannelRequest (\ s a -> s{_uavcAPNSVoipChannelRequest = a})
instance AWSRequest UpdateAPNSVoipChannel where
type Rs UpdateAPNSVoipChannel =
UpdateAPNSVoipChannelResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateAPNSVoipChannelResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateAPNSVoipChannel where
instance NFData UpdateAPNSVoipChannel where
instance ToHeaders UpdateAPNSVoipChannel where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateAPNSVoipChannel where
toJSON UpdateAPNSVoipChannel'{..}
= object
(catMaybes
[Just
("APNSVoipChannelRequest" .=
_uavcAPNSVoipChannelRequest)])
instance ToPath UpdateAPNSVoipChannel where
toPath UpdateAPNSVoipChannel'{..}
= mconcat
["/v1/apps/", toBS _uavcApplicationId,
"/channels/apns_voip"]
instance ToQuery UpdateAPNSVoipChannel where
toQuery = const mempty
data UpdateAPNSVoipChannelResponse = UpdateAPNSVoipChannelResponse'
{ _uavcrsResponseStatus :: !Int
, _uavcrsAPNSVoipChannelResponse :: !APNSVoipChannelResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateAPNSVoipChannelResponse
:: Int
-> APNSVoipChannelResponse
-> UpdateAPNSVoipChannelResponse
updateAPNSVoipChannelResponse pResponseStatus_ pAPNSVoipChannelResponse_ =
UpdateAPNSVoipChannelResponse'
{ _uavcrsResponseStatus = pResponseStatus_
, _uavcrsAPNSVoipChannelResponse = pAPNSVoipChannelResponse_
}
uavcrsResponseStatus :: Lens' UpdateAPNSVoipChannelResponse Int
uavcrsResponseStatus = lens _uavcrsResponseStatus (\ s a -> s{_uavcrsResponseStatus = a})
uavcrsAPNSVoipChannelResponse :: Lens' UpdateAPNSVoipChannelResponse APNSVoipChannelResponse
uavcrsAPNSVoipChannelResponse = lens _uavcrsAPNSVoipChannelResponse (\ s a -> s{_uavcrsAPNSVoipChannelResponse = a})
instance NFData UpdateAPNSVoipChannelResponse where