{-# 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.UpdateEndpointsBatch
(
updateEndpointsBatch
, UpdateEndpointsBatch
, uebApplicationId
, uebEndpointBatchRequest
, updateEndpointsBatchResponse
, UpdateEndpointsBatchResponse
, uebrsResponseStatus
, uebrsMessageBody
) 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 UpdateEndpointsBatch = UpdateEndpointsBatch'
{ _uebApplicationId :: !Text
, _uebEndpointBatchRequest :: !EndpointBatchRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEndpointsBatch
:: Text
-> EndpointBatchRequest
-> UpdateEndpointsBatch
updateEndpointsBatch pApplicationId_ pEndpointBatchRequest_ =
UpdateEndpointsBatch'
{ _uebApplicationId = pApplicationId_
, _uebEndpointBatchRequest = pEndpointBatchRequest_
}
uebApplicationId :: Lens' UpdateEndpointsBatch Text
uebApplicationId = lens _uebApplicationId (\ s a -> s{_uebApplicationId = a})
uebEndpointBatchRequest :: Lens' UpdateEndpointsBatch EndpointBatchRequest
uebEndpointBatchRequest = lens _uebEndpointBatchRequest (\ s a -> s{_uebEndpointBatchRequest = a})
instance AWSRequest UpdateEndpointsBatch where
type Rs UpdateEndpointsBatch =
UpdateEndpointsBatchResponse
request = putJSON pinpoint
response
= receiveJSON
(\ s h x ->
UpdateEndpointsBatchResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable UpdateEndpointsBatch where
instance NFData UpdateEndpointsBatch where
instance ToHeaders UpdateEndpointsBatch where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateEndpointsBatch where
toJSON UpdateEndpointsBatch'{..}
= object
(catMaybes
[Just
("EndpointBatchRequest" .=
_uebEndpointBatchRequest)])
instance ToPath UpdateEndpointsBatch where
toPath UpdateEndpointsBatch'{..}
= mconcat
["/v1/apps/", toBS _uebApplicationId, "/endpoints"]
instance ToQuery UpdateEndpointsBatch where
toQuery = const mempty
data UpdateEndpointsBatchResponse = UpdateEndpointsBatchResponse'
{ _uebrsResponseStatus :: !Int
, _uebrsMessageBody :: !MessageBody
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateEndpointsBatchResponse
:: Int
-> MessageBody
-> UpdateEndpointsBatchResponse
updateEndpointsBatchResponse pResponseStatus_ pMessageBody_ =
UpdateEndpointsBatchResponse'
{_uebrsResponseStatus = pResponseStatus_, _uebrsMessageBody = pMessageBody_}
uebrsResponseStatus :: Lens' UpdateEndpointsBatchResponse Int
uebrsResponseStatus = lens _uebrsResponseStatus (\ s a -> s{_uebrsResponseStatus = a})
uebrsMessageBody :: Lens' UpdateEndpointsBatchResponse MessageBody
uebrsMessageBody = lens _uebrsMessageBody (\ s a -> s{_uebrsMessageBody = a})
instance NFData UpdateEndpointsBatchResponse where