{-# 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.KMS.ListRetirableGrants
(
listRetirableGrants
, ListRetirableGrants
, lrgMarker
, lrgLimit
, lrgRetiringPrincipal
, listGrantsResponse
, ListGrantsResponse
, lgTruncated
, lgGrants
, lgNextMarker
) where
import Network.AWS.KMS.Types
import Network.AWS.KMS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListRetirableGrants = ListRetirableGrants'
{ _lrgMarker :: !(Maybe Text)
, _lrgLimit :: !(Maybe Nat)
, _lrgRetiringPrincipal :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRetirableGrants
:: Text
-> ListRetirableGrants
listRetirableGrants pRetiringPrincipal_ =
ListRetirableGrants'
{ _lrgMarker = Nothing
, _lrgLimit = Nothing
, _lrgRetiringPrincipal = pRetiringPrincipal_
}
lrgMarker :: Lens' ListRetirableGrants (Maybe Text)
lrgMarker = lens _lrgMarker (\ s a -> s{_lrgMarker = a});
lrgLimit :: Lens' ListRetirableGrants (Maybe Natural)
lrgLimit = lens _lrgLimit (\ s a -> s{_lrgLimit = a}) . mapping _Nat;
lrgRetiringPrincipal :: Lens' ListRetirableGrants Text
lrgRetiringPrincipal = lens _lrgRetiringPrincipal (\ s a -> s{_lrgRetiringPrincipal = a});
instance AWSRequest ListRetirableGrants where
type Rs ListRetirableGrants = ListGrantsResponse
request = postJSON kms
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable ListRetirableGrants
instance NFData ListRetirableGrants
instance ToHeaders ListRetirableGrants where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("TrentService.ListRetirableGrants" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListRetirableGrants where
toJSON ListRetirableGrants'{..}
= object
(catMaybes
[("Marker" .=) <$> _lrgMarker,
("Limit" .=) <$> _lrgLimit,
Just ("RetiringPrincipal" .= _lrgRetiringPrincipal)])
instance ToPath ListRetirableGrants where
toPath = const "/"
instance ToQuery ListRetirableGrants where
toQuery = const mempty