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.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 Sv UnlinkIdentity = CognitoIdentity
type Rs UnlinkIdentity = UnlinkIdentityResponse
request = postJSON
response = receiveNull UnlinkIdentityResponse'
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
["IdentityId" .= _uiIdentityId,
"Logins" .= _uiLogins,
"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'