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