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