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