{-# 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.RevokeGrant
(
revokeGrant
, RevokeGrant
, rKeyId
, rGrantId
, revokeGrantResponse
, RevokeGrantResponse
) 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 RevokeGrant = RevokeGrant'
{ _rKeyId :: !Text
, _rGrantId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
revokeGrant
:: Text
-> Text
-> RevokeGrant
revokeGrant pKeyId_ pGrantId_ =
RevokeGrant'
{ _rKeyId = pKeyId_
, _rGrantId = pGrantId_
}
rKeyId :: Lens' RevokeGrant Text
rKeyId = lens _rKeyId (\ s a -> s{_rKeyId = a});
rGrantId :: Lens' RevokeGrant Text
rGrantId = lens _rGrantId (\ s a -> s{_rGrantId = a});
instance AWSRequest RevokeGrant where
type Rs RevokeGrant = RevokeGrantResponse
request = postJSON kms
response = receiveNull RevokeGrantResponse'
instance Hashable RevokeGrant
instance NFData RevokeGrant
instance ToHeaders RevokeGrant where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("TrentService.RevokeGrant" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RevokeGrant where
toJSON RevokeGrant'{..}
= object
(catMaybes
[Just ("KeyId" .= _rKeyId),
Just ("GrantId" .= _rGrantId)])
instance ToPath RevokeGrant where
toPath = const "/"
instance ToQuery RevokeGrant where
toQuery = const mempty
data RevokeGrantResponse =
RevokeGrantResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
revokeGrantResponse
:: RevokeGrantResponse
revokeGrantResponse = RevokeGrantResponse'
instance NFData RevokeGrantResponse