{-# 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.S3.PutBucketEncryption
(
putBucketEncryption
, PutBucketEncryption
, pbeContentMD5
, pbeBucket
, pbeServerSideEncryptionConfiguration
, putBucketEncryptionResponse
, PutBucketEncryptionResponse
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.S3.Types
import Network.AWS.S3.Types.Product
data PutBucketEncryption = PutBucketEncryption'
{ _pbeContentMD5 :: !(Maybe Text)
, _pbeBucket :: !BucketName
, _pbeServerSideEncryptionConfiguration :: !ServerSideEncryptionConfiguration
} deriving (Eq, Show, Data, Typeable, Generic)
putBucketEncryption
:: BucketName
-> ServerSideEncryptionConfiguration
-> PutBucketEncryption
putBucketEncryption pBucket_ pServerSideEncryptionConfiguration_ =
PutBucketEncryption'
{ _pbeContentMD5 = Nothing
, _pbeBucket = pBucket_
, _pbeServerSideEncryptionConfiguration =
pServerSideEncryptionConfiguration_
}
pbeContentMD5 :: Lens' PutBucketEncryption (Maybe Text)
pbeContentMD5 = lens _pbeContentMD5 (\ s a -> s{_pbeContentMD5 = a})
pbeBucket :: Lens' PutBucketEncryption BucketName
pbeBucket = lens _pbeBucket (\ s a -> s{_pbeBucket = a})
pbeServerSideEncryptionConfiguration :: Lens' PutBucketEncryption ServerSideEncryptionConfiguration
pbeServerSideEncryptionConfiguration = lens _pbeServerSideEncryptionConfiguration (\ s a -> s{_pbeServerSideEncryptionConfiguration = a})
instance AWSRequest PutBucketEncryption where
type Rs PutBucketEncryption =
PutBucketEncryptionResponse
request = putXML s3
response = receiveNull PutBucketEncryptionResponse'
instance Hashable PutBucketEncryption where
instance NFData PutBucketEncryption where
instance ToElement PutBucketEncryption where
toElement
= mkElement
"{http://s3.amazonaws.com/doc/2006-03-01/}ServerSideEncryptionConfiguration"
.
_pbeServerSideEncryptionConfiguration
instance ToHeaders PutBucketEncryption where
toHeaders PutBucketEncryption'{..}
= mconcat ["Content-MD5" =# _pbeContentMD5]
instance ToPath PutBucketEncryption where
toPath PutBucketEncryption'{..}
= mconcat ["/", toBS _pbeBucket]
instance ToQuery PutBucketEncryption where
toQuery = const (mconcat ["encryption"])
data PutBucketEncryptionResponse =
PutBucketEncryptionResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
putBucketEncryptionResponse
:: PutBucketEncryptionResponse
putBucketEncryptionResponse = PutBucketEncryptionResponse'
instance NFData PutBucketEncryptionResponse where