{-# 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.XRay.PutEncryptionConfig
(
putEncryptionConfig
, PutEncryptionConfig
, pecKeyId
, pecType
, putEncryptionConfigResponse
, PutEncryptionConfigResponse
, pecrsEncryptionConfig
, pecrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.XRay.Types
import Network.AWS.XRay.Types.Product
data PutEncryptionConfig = PutEncryptionConfig'
{ _pecKeyId :: !(Maybe Text)
, _pecType :: !EncryptionType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putEncryptionConfig
:: EncryptionType
-> PutEncryptionConfig
putEncryptionConfig pType_ =
PutEncryptionConfig' {_pecKeyId = Nothing, _pecType = pType_}
pecKeyId :: Lens' PutEncryptionConfig (Maybe Text)
pecKeyId = lens _pecKeyId (\ s a -> s{_pecKeyId = a})
pecType :: Lens' PutEncryptionConfig EncryptionType
pecType = lens _pecType (\ s a -> s{_pecType = a})
instance AWSRequest PutEncryptionConfig where
type Rs PutEncryptionConfig =
PutEncryptionConfigResponse
request = postJSON xRay
response
= receiveJSON
(\ s h x ->
PutEncryptionConfigResponse' <$>
(x .?> "EncryptionConfig") <*> (pure (fromEnum s)))
instance Hashable PutEncryptionConfig where
instance NFData PutEncryptionConfig where
instance ToHeaders PutEncryptionConfig where
toHeaders = const mempty
instance ToJSON PutEncryptionConfig where
toJSON PutEncryptionConfig'{..}
= object
(catMaybes
[("KeyId" .=) <$> _pecKeyId,
Just ("Type" .= _pecType)])
instance ToPath PutEncryptionConfig where
toPath = const "/PutEncryptionConfig"
instance ToQuery PutEncryptionConfig where
toQuery = const mempty
data PutEncryptionConfigResponse = PutEncryptionConfigResponse'
{ _pecrsEncryptionConfig :: !(Maybe EncryptionConfig)
, _pecrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putEncryptionConfigResponse
:: Int
-> PutEncryptionConfigResponse
putEncryptionConfigResponse pResponseStatus_ =
PutEncryptionConfigResponse'
{_pecrsEncryptionConfig = Nothing, _pecrsResponseStatus = pResponseStatus_}
pecrsEncryptionConfig :: Lens' PutEncryptionConfigResponse (Maybe EncryptionConfig)
pecrsEncryptionConfig = lens _pecrsEncryptionConfig (\ s a -> s{_pecrsEncryptionConfig = a})
pecrsResponseStatus :: Lens' PutEncryptionConfigResponse Int
pecrsResponseStatus = lens _pecrsResponseStatus (\ s a -> s{_pecrsResponseStatus = a})
instance NFData PutEncryptionConfigResponse where