{-# 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.CognitoIdentityProvider.AddCustomAttributes
(
addCustomAttributes
, AddCustomAttributes
, acaUserPoolId
, acaCustomAttributes
, addCustomAttributesResponse
, AddCustomAttributesResponse
, acarsResponseStatus
) where
import Network.AWS.CognitoIdentityProvider.Types
import Network.AWS.CognitoIdentityProvider.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddCustomAttributes = AddCustomAttributes'
{ _acaUserPoolId :: !Text
, _acaCustomAttributes :: !(List1 SchemaAttributeType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addCustomAttributes
:: Text
-> NonEmpty SchemaAttributeType
-> AddCustomAttributes
addCustomAttributes pUserPoolId_ pCustomAttributes_ =
AddCustomAttributes'
{ _acaUserPoolId = pUserPoolId_
, _acaCustomAttributes = _List1 # pCustomAttributes_
}
acaUserPoolId :: Lens' AddCustomAttributes Text
acaUserPoolId = lens _acaUserPoolId (\ s a -> s{_acaUserPoolId = a})
acaCustomAttributes :: Lens' AddCustomAttributes (NonEmpty SchemaAttributeType)
acaCustomAttributes = lens _acaCustomAttributes (\ s a -> s{_acaCustomAttributes = a}) . _List1
instance AWSRequest AddCustomAttributes where
type Rs AddCustomAttributes =
AddCustomAttributesResponse
request = postJSON cognitoIdentityProvider
response
= receiveEmpty
(\ s h x ->
AddCustomAttributesResponse' <$> (pure (fromEnum s)))
instance Hashable AddCustomAttributes where
instance NFData AddCustomAttributes where
instance ToHeaders AddCustomAttributes where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityProviderService.AddCustomAttributes"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddCustomAttributes where
toJSON AddCustomAttributes'{..}
= object
(catMaybes
[Just ("UserPoolId" .= _acaUserPoolId),
Just ("CustomAttributes" .= _acaCustomAttributes)])
instance ToPath AddCustomAttributes where
toPath = const "/"
instance ToQuery AddCustomAttributes where
toQuery = const mempty
newtype AddCustomAttributesResponse = AddCustomAttributesResponse'
{ _acarsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addCustomAttributesResponse
:: Int
-> AddCustomAttributesResponse
addCustomAttributesResponse pResponseStatus_ =
AddCustomAttributesResponse' {_acarsResponseStatus = pResponseStatus_}
acarsResponseStatus :: Lens' AddCustomAttributesResponse Int
acarsResponseStatus = lens _acarsResponseStatus (\ s a -> s{_acarsResponseStatus = a})
instance NFData AddCustomAttributesResponse where