module Network.AWS.CognitoIdentity.MergeDeveloperIdentities
(
mergeDeveloperIdentities
, MergeDeveloperIdentities
, mdiSourceUserIdentifier
, mdiDestinationUserIdentifier
, mdiDeveloperProviderName
, mdiIdentityPoolId
, mergeDeveloperIdentitiesResponse
, MergeDeveloperIdentitiesResponse
, mdirsIdentityId
, mdirsResponseStatus
) 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 MergeDeveloperIdentities = MergeDeveloperIdentities'
{ _mdiSourceUserIdentifier :: !Text
, _mdiDestinationUserIdentifier :: !Text
, _mdiDeveloperProviderName :: !Text
, _mdiIdentityPoolId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
mergeDeveloperIdentities
:: Text
-> Text
-> Text
-> Text
-> MergeDeveloperIdentities
mergeDeveloperIdentities pSourceUserIdentifier_ pDestinationUserIdentifier_ pDeveloperProviderName_ pIdentityPoolId_ =
MergeDeveloperIdentities'
{ _mdiSourceUserIdentifier = pSourceUserIdentifier_
, _mdiDestinationUserIdentifier = pDestinationUserIdentifier_
, _mdiDeveloperProviderName = pDeveloperProviderName_
, _mdiIdentityPoolId = pIdentityPoolId_
}
mdiSourceUserIdentifier :: Lens' MergeDeveloperIdentities Text
mdiSourceUserIdentifier = lens _mdiSourceUserIdentifier (\ s a -> s{_mdiSourceUserIdentifier = a});
mdiDestinationUserIdentifier :: Lens' MergeDeveloperIdentities Text
mdiDestinationUserIdentifier = lens _mdiDestinationUserIdentifier (\ s a -> s{_mdiDestinationUserIdentifier = a});
mdiDeveloperProviderName :: Lens' MergeDeveloperIdentities Text
mdiDeveloperProviderName = lens _mdiDeveloperProviderName (\ s a -> s{_mdiDeveloperProviderName = a});
mdiIdentityPoolId :: Lens' MergeDeveloperIdentities Text
mdiIdentityPoolId = lens _mdiIdentityPoolId (\ s a -> s{_mdiIdentityPoolId = a});
instance AWSRequest MergeDeveloperIdentities where
type Rs MergeDeveloperIdentities =
MergeDeveloperIdentitiesResponse
request = postJSON cognitoIdentity
response
= receiveJSON
(\ s h x ->
MergeDeveloperIdentitiesResponse' <$>
(x .?> "IdentityId") <*> (pure (fromEnum s)))
instance ToHeaders MergeDeveloperIdentities where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityService.MergeDeveloperIdentities"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON MergeDeveloperIdentities where
toJSON MergeDeveloperIdentities'{..}
= object
(catMaybes
[Just
("SourceUserIdentifier" .= _mdiSourceUserIdentifier),
Just
("DestinationUserIdentifier" .=
_mdiDestinationUserIdentifier),
Just
("DeveloperProviderName" .=
_mdiDeveloperProviderName),
Just ("IdentityPoolId" .= _mdiIdentityPoolId)])
instance ToPath MergeDeveloperIdentities where
toPath = const "/"
instance ToQuery MergeDeveloperIdentities where
toQuery = const mempty
data MergeDeveloperIdentitiesResponse = MergeDeveloperIdentitiesResponse'
{ _mdirsIdentityId :: !(Maybe Text)
, _mdirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
mergeDeveloperIdentitiesResponse
:: Int
-> MergeDeveloperIdentitiesResponse
mergeDeveloperIdentitiesResponse pResponseStatus_ =
MergeDeveloperIdentitiesResponse'
{ _mdirsIdentityId = Nothing
, _mdirsResponseStatus = pResponseStatus_
}
mdirsIdentityId :: Lens' MergeDeveloperIdentitiesResponse (Maybe Text)
mdirsIdentityId = lens _mdirsIdentityId (\ s a -> s{_mdirsIdentityId = a});
mdirsResponseStatus :: Lens' MergeDeveloperIdentitiesResponse Int
mdirsResponseStatus = lens _mdirsResponseStatus (\ s a -> s{_mdirsResponseStatus = a});