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