{-# 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.RetireGrant
(
retireGrant
, RetireGrant
, rgKeyId
, rgGrantId
, rgGrantToken
, retireGrantResponse
, RetireGrantResponse
) 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 RetireGrant = RetireGrant'
{ _rgKeyId :: !(Maybe Text)
, _rgGrantId :: !(Maybe Text)
, _rgGrantToken :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retireGrant
:: RetireGrant
retireGrant =
RetireGrant'
{ _rgKeyId = Nothing
, _rgGrantId = Nothing
, _rgGrantToken = Nothing
}
rgKeyId :: Lens' RetireGrant (Maybe Text)
rgKeyId = lens _rgKeyId (\ s a -> s{_rgKeyId = a});
rgGrantId :: Lens' RetireGrant (Maybe Text)
rgGrantId = lens _rgGrantId (\ s a -> s{_rgGrantId = a});
rgGrantToken :: Lens' RetireGrant (Maybe Text)
rgGrantToken = lens _rgGrantToken (\ s a -> s{_rgGrantToken = a});
instance AWSRequest RetireGrant where
type Rs RetireGrant = RetireGrantResponse
request = postJSON kms
response = receiveNull RetireGrantResponse'
instance Hashable RetireGrant
instance NFData RetireGrant
instance ToHeaders RetireGrant where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("TrentService.RetireGrant" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RetireGrant where
toJSON RetireGrant'{..}
= object
(catMaybes
[("KeyId" .=) <$> _rgKeyId,
("GrantId" .=) <$> _rgGrantId,
("GrantToken" .=) <$> _rgGrantToken])
instance ToPath RetireGrant where
toPath = const "/"
instance ToQuery RetireGrant where
toQuery = const mempty
data RetireGrantResponse =
RetireGrantResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
retireGrantResponse
:: RetireGrantResponse
retireGrantResponse = RetireGrantResponse'
instance NFData RetireGrantResponse