{-# 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.UnlinkIdentity
(
unlinkIdentity
, UnlinkIdentity
, uiIdentityId
, uiLogins
, uiLoginsToRemove
, unlinkIdentityResponse
, UnlinkIdentityResponse
) 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 UnlinkIdentity = UnlinkIdentity'
{ _uiIdentityId :: !Text
, _uiLogins :: !(Map Text Text)
, _uiLoginsToRemove :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
unlinkIdentity
:: Text
-> UnlinkIdentity
unlinkIdentity pIdentityId_ =
UnlinkIdentity'
{ _uiIdentityId = pIdentityId_
, _uiLogins = mempty
, _uiLoginsToRemove = mempty
}
uiIdentityId :: Lens' UnlinkIdentity Text
uiIdentityId = lens _uiIdentityId (\ s a -> s{_uiIdentityId = a});
uiLogins :: Lens' UnlinkIdentity (HashMap Text Text)
uiLogins = lens _uiLogins (\ s a -> s{_uiLogins = a}) . _Map;
uiLoginsToRemove :: Lens' UnlinkIdentity [Text]
uiLoginsToRemove = lens _uiLoginsToRemove (\ s a -> s{_uiLoginsToRemove = a}) . _Coerce;
instance AWSRequest UnlinkIdentity where
type Rs UnlinkIdentity = UnlinkIdentityResponse
request = postJSON cognitoIdentity
response = receiveNull UnlinkIdentityResponse'
instance Hashable UnlinkIdentity
instance NFData UnlinkIdentity
instance ToHeaders UnlinkIdentity where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityService.UnlinkIdentity" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UnlinkIdentity where
toJSON UnlinkIdentity'{..}
= object
(catMaybes
[Just ("IdentityId" .= _uiIdentityId),
Just ("Logins" .= _uiLogins),
Just ("LoginsToRemove" .= _uiLoginsToRemove)])
instance ToPath UnlinkIdentity where
toPath = const "/"
instance ToQuery UnlinkIdentity where
toQuery = const mempty
data UnlinkIdentityResponse =
UnlinkIdentityResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
unlinkIdentityResponse
:: UnlinkIdentityResponse
unlinkIdentityResponse = UnlinkIdentityResponse'
instance NFData UnlinkIdentityResponse