module Network.AWS.CognitoSync.DescribeIdentityPoolUsage
(
describeIdentityPoolUsage
, DescribeIdentityPoolUsage
, dipuIdentityPoolId
, describeIdentityPoolUsageResponse
, DescribeIdentityPoolUsageResponse
, dipursIdentityPoolUsage
, dipursStatus
) where
import Network.AWS.CognitoSync.Types
import Network.AWS.CognitoSync.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeIdentityPoolUsage = DescribeIdentityPoolUsage'
{ _dipuIdentityPoolId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeIdentityPoolUsage
:: Text
-> DescribeIdentityPoolUsage
describeIdentityPoolUsage pIdentityPoolId_ =
DescribeIdentityPoolUsage'
{ _dipuIdentityPoolId = pIdentityPoolId_
}
dipuIdentityPoolId :: Lens' DescribeIdentityPoolUsage Text
dipuIdentityPoolId = lens _dipuIdentityPoolId (\ s a -> s{_dipuIdentityPoolId = a});
instance AWSRequest DescribeIdentityPoolUsage where
type Rs DescribeIdentityPoolUsage =
DescribeIdentityPoolUsageResponse
request = get cognitoSync
response
= receiveJSON
(\ s h x ->
DescribeIdentityPoolUsageResponse' <$>
(x .?> "IdentityPoolUsage") <*> (pure (fromEnum s)))
instance ToHeaders DescribeIdentityPoolUsage where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath DescribeIdentityPoolUsage where
toPath DescribeIdentityPoolUsage'{..}
= mconcat
["/identitypools/", toBS _dipuIdentityPoolId]
instance ToQuery DescribeIdentityPoolUsage where
toQuery = const mempty
data DescribeIdentityPoolUsageResponse = DescribeIdentityPoolUsageResponse'
{ _dipursIdentityPoolUsage :: !(Maybe IdentityPoolUsage)
, _dipursStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeIdentityPoolUsageResponse
:: Int
-> DescribeIdentityPoolUsageResponse
describeIdentityPoolUsageResponse pStatus_ =
DescribeIdentityPoolUsageResponse'
{ _dipursIdentityPoolUsage = Nothing
, _dipursStatus = pStatus_
}
dipursIdentityPoolUsage :: Lens' DescribeIdentityPoolUsageResponse (Maybe IdentityPoolUsage)
dipursIdentityPoolUsage = lens _dipursIdentityPoolUsage (\ s a -> s{_dipursIdentityPoolUsage = a});
dipursStatus :: Lens' DescribeIdentityPoolUsageResponse Int
dipursStatus = lens _dipursStatus (\ s a -> s{_dipursStatus = a});