{-# 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.CognitoIdentity.SetIdentityPoolRoles
(
setIdentityPoolRoles
, SetIdentityPoolRoles
, siprIdentityPoolId
, siprRoles
, setIdentityPoolRolesResponse
, SetIdentityPoolRolesResponse
) where
import Network.AWS.CognitoIdentity.Types
import Network.AWS.CognitoIdentity.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SetIdentityPoolRoles = SetIdentityPoolRoles'
{ _siprIdentityPoolId :: !Text
, _siprRoles :: !(Map Text Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
setIdentityPoolRoles
:: Text
-> SetIdentityPoolRoles
setIdentityPoolRoles pIdentityPoolId_ =
SetIdentityPoolRoles'
{ _siprIdentityPoolId = pIdentityPoolId_
, _siprRoles = mempty
}
siprIdentityPoolId :: Lens' SetIdentityPoolRoles Text
siprIdentityPoolId = lens _siprIdentityPoolId (\ s a -> s{_siprIdentityPoolId = a});
siprRoles :: Lens' SetIdentityPoolRoles (HashMap Text Text)
siprRoles = lens _siprRoles (\ s a -> s{_siprRoles = a}) . _Map;
instance AWSRequest SetIdentityPoolRoles where
type Rs SetIdentityPoolRoles =
SetIdentityPoolRolesResponse
request = postJSON cognitoIdentity
response = receiveNull SetIdentityPoolRolesResponse'
instance Hashable SetIdentityPoolRoles
instance NFData SetIdentityPoolRoles
instance ToHeaders SetIdentityPoolRoles where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityService.SetIdentityPoolRoles" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SetIdentityPoolRoles where
toJSON SetIdentityPoolRoles'{..}
= object
(catMaybes
[Just ("IdentityPoolId" .= _siprIdentityPoolId),
Just ("Roles" .= _siprRoles)])
instance ToPath SetIdentityPoolRoles where
toPath = const "/"
instance ToQuery SetIdentityPoolRoles where
toQuery = const mempty
data SetIdentityPoolRolesResponse =
SetIdentityPoolRolesResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
setIdentityPoolRolesResponse
:: SetIdentityPoolRolesResponse
setIdentityPoolRolesResponse = SetIdentityPoolRolesResponse'
instance NFData SetIdentityPoolRolesResponse