{-# 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.DescribeIdentity
(
describeIdentity
, DescribeIdentity
, diIdentityId
, identityDescription
, IdentityDescription
, idLastModifiedDate
, idCreationDate
, idLogins
, idIdentityId
) 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
newtype DescribeIdentity = DescribeIdentity'
{ _diIdentityId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeIdentity
:: Text
-> DescribeIdentity
describeIdentity pIdentityId_ =
DescribeIdentity'
{ _diIdentityId = pIdentityId_
}
diIdentityId :: Lens' DescribeIdentity Text
diIdentityId = lens _diIdentityId (\ s a -> s{_diIdentityId = a});
instance AWSRequest DescribeIdentity where
type Rs DescribeIdentity = IdentityDescription
request = postJSON cognitoIdentity
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable DescribeIdentity
instance NFData DescribeIdentity
instance ToHeaders DescribeIdentity where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSCognitoIdentityService.DescribeIdentity" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeIdentity where
toJSON DescribeIdentity'{..}
= object
(catMaybes [Just ("IdentityId" .= _diIdentityId)])
instance ToPath DescribeIdentity where
toPath = const "/"
instance ToQuery DescribeIdentity where
toQuery = const mempty