{-# 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.CognitoSync.BulkPublish
(
bulkPublish
, BulkPublish
, bpIdentityPoolId
, bulkPublishResponse
, BulkPublishResponse
, bprsIdentityPoolId
, bprsResponseStatus
) where
import Network.AWS.CognitoSync.Types
import Network.AWS.CognitoSync.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype BulkPublish = BulkPublish'
{ _bpIdentityPoolId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
bulkPublish
:: Text
-> BulkPublish
bulkPublish pIdentityPoolId_ =
BulkPublish' {_bpIdentityPoolId = pIdentityPoolId_}
bpIdentityPoolId :: Lens' BulkPublish Text
bpIdentityPoolId = lens _bpIdentityPoolId (\ s a -> s{_bpIdentityPoolId = a})
instance AWSRequest BulkPublish where
type Rs BulkPublish = BulkPublishResponse
request = postJSON cognitoSync
response
= receiveJSON
(\ s h x ->
BulkPublishResponse' <$>
(x .?> "IdentityPoolId") <*> (pure (fromEnum s)))
instance Hashable BulkPublish where
instance NFData BulkPublish where
instance ToHeaders BulkPublish where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON BulkPublish where
toJSON = const (Object mempty)
instance ToPath BulkPublish where
toPath BulkPublish'{..}
= mconcat
["/identitypools/", toBS _bpIdentityPoolId,
"/bulkpublish"]
instance ToQuery BulkPublish where
toQuery = const mempty
data BulkPublishResponse = BulkPublishResponse'
{ _bprsIdentityPoolId :: !(Maybe Text)
, _bprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
bulkPublishResponse
:: Int
-> BulkPublishResponse
bulkPublishResponse pResponseStatus_ =
BulkPublishResponse'
{_bprsIdentityPoolId = Nothing, _bprsResponseStatus = pResponseStatus_}
bprsIdentityPoolId :: Lens' BulkPublishResponse (Maybe Text)
bprsIdentityPoolId = lens _bprsIdentityPoolId (\ s a -> s{_bprsIdentityPoolId = a})
bprsResponseStatus :: Lens' BulkPublishResponse Int
bprsResponseStatus = lens _bprsResponseStatus (\ s a -> s{_bprsResponseStatus = a})
instance NFData BulkPublishResponse where