{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.S3.PutBucketEncryption
(
PutBucketEncryption (..),
newPutBucketEncryption,
putBucketEncryption_contentMD5,
putBucketEncryption_expectedBucketOwner,
putBucketEncryption_bucket,
putBucketEncryption_serverSideEncryptionConfiguration,
PutBucketEncryptionResponse (..),
newPutBucketEncryptionResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types
data PutBucketEncryption = PutBucketEncryption'
{
PutBucketEncryption -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketEncryption -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketEncryption -> BucketName
bucket :: BucketName,
PutBucketEncryption -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
}
deriving (PutBucketEncryption -> PutBucketEncryption -> Bool
(PutBucketEncryption -> PutBucketEncryption -> Bool)
-> (PutBucketEncryption -> PutBucketEncryption -> Bool)
-> Eq PutBucketEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketEncryption -> PutBucketEncryption -> Bool
$c/= :: PutBucketEncryption -> PutBucketEncryption -> Bool
== :: PutBucketEncryption -> PutBucketEncryption -> Bool
$c== :: PutBucketEncryption -> PutBucketEncryption -> Bool
Prelude.Eq, Int -> PutBucketEncryption -> ShowS
[PutBucketEncryption] -> ShowS
PutBucketEncryption -> String
(Int -> PutBucketEncryption -> ShowS)
-> (PutBucketEncryption -> String)
-> ([PutBucketEncryption] -> ShowS)
-> Show PutBucketEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketEncryption] -> ShowS
$cshowList :: [PutBucketEncryption] -> ShowS
show :: PutBucketEncryption -> String
$cshow :: PutBucketEncryption -> String
showsPrec :: Int -> PutBucketEncryption -> ShowS
$cshowsPrec :: Int -> PutBucketEncryption -> ShowS
Prelude.Show, (forall x. PutBucketEncryption -> Rep PutBucketEncryption x)
-> (forall x. Rep PutBucketEncryption x -> PutBucketEncryption)
-> Generic PutBucketEncryption
forall x. Rep PutBucketEncryption x -> PutBucketEncryption
forall x. PutBucketEncryption -> Rep PutBucketEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketEncryption x -> PutBucketEncryption
$cfrom :: forall x. PutBucketEncryption -> Rep PutBucketEncryption x
Prelude.Generic)
newPutBucketEncryption ::
BucketName ->
ServerSideEncryptionConfiguration ->
PutBucketEncryption
newPutBucketEncryption :: BucketName
-> ServerSideEncryptionConfiguration -> PutBucketEncryption
newPutBucketEncryption
BucketName
pBucket_
ServerSideEncryptionConfiguration
pServerSideEncryptionConfiguration_ =
PutBucketEncryption' :: Maybe Text
-> Maybe Text
-> BucketName
-> ServerSideEncryptionConfiguration
-> PutBucketEncryption
PutBucketEncryption'
{ $sel:contentMD5:PutBucketEncryption' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketEncryption' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketEncryption' :: BucketName
bucket = BucketName
pBucket_,
$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration =
ServerSideEncryptionConfiguration
pServerSideEncryptionConfiguration_
}
putBucketEncryption_contentMD5 :: Lens.Lens' PutBucketEncryption (Prelude.Maybe Prelude.Text)
putBucketEncryption_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketEncryption -> f PutBucketEncryption
putBucketEncryption_contentMD5 = (PutBucketEncryption -> Maybe Text)
-> (PutBucketEncryption -> Maybe Text -> PutBucketEncryption)
-> Lens
PutBucketEncryption PutBucketEncryption (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketEncryption' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketEncryption
s@PutBucketEncryption' {} Maybe Text
a -> PutBucketEncryption
s {$sel:contentMD5:PutBucketEncryption' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketEncryption)
putBucketEncryption_expectedBucketOwner :: Lens.Lens' PutBucketEncryption (Prelude.Maybe Prelude.Text)
putBucketEncryption_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketEncryption -> f PutBucketEncryption
putBucketEncryption_expectedBucketOwner = (PutBucketEncryption -> Maybe Text)
-> (PutBucketEncryption -> Maybe Text -> PutBucketEncryption)
-> Lens
PutBucketEncryption PutBucketEncryption (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketEncryption' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketEncryption
s@PutBucketEncryption' {} Maybe Text
a -> PutBucketEncryption
s {$sel:expectedBucketOwner:PutBucketEncryption' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketEncryption)
putBucketEncryption_bucket :: Lens.Lens' PutBucketEncryption BucketName
putBucketEncryption_bucket :: (BucketName -> f BucketName)
-> PutBucketEncryption -> f PutBucketEncryption
putBucketEncryption_bucket = (PutBucketEncryption -> BucketName)
-> (PutBucketEncryption -> BucketName -> PutBucketEncryption)
-> Lens
PutBucketEncryption PutBucketEncryption BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketEncryption' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketEncryption' :: PutBucketEncryption -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketEncryption
s@PutBucketEncryption' {} BucketName
a -> PutBucketEncryption
s {$sel:bucket:PutBucketEncryption' :: BucketName
bucket = BucketName
a} :: PutBucketEncryption)
putBucketEncryption_serverSideEncryptionConfiguration :: Lens.Lens' PutBucketEncryption ServerSideEncryptionConfiguration
putBucketEncryption_serverSideEncryptionConfiguration :: (ServerSideEncryptionConfiguration
-> f ServerSideEncryptionConfiguration)
-> PutBucketEncryption -> f PutBucketEncryption
putBucketEncryption_serverSideEncryptionConfiguration = (PutBucketEncryption -> ServerSideEncryptionConfiguration)
-> (PutBucketEncryption
-> ServerSideEncryptionConfiguration -> PutBucketEncryption)
-> Lens
PutBucketEncryption
PutBucketEncryption
ServerSideEncryptionConfiguration
ServerSideEncryptionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketEncryption' {ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: PutBucketEncryption -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration} -> ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration) (\s :: PutBucketEncryption
s@PutBucketEncryption' {} ServerSideEncryptionConfiguration
a -> PutBucketEncryption
s {$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = ServerSideEncryptionConfiguration
a} :: PutBucketEncryption)
instance Core.AWSRequest PutBucketEncryption where
type
AWSResponse PutBucketEncryption =
PutBucketEncryptionResponse
request :: PutBucketEncryption -> Request PutBucketEncryption
request =
Request PutBucketEncryption -> Request PutBucketEncryption
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketEncryption -> Request PutBucketEncryption)
-> (PutBucketEncryption -> Request PutBucketEncryption)
-> PutBucketEncryption
-> Request PutBucketEncryption
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutBucketEncryption -> Request PutBucketEncryption
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketEncryption)))
response =
AWSResponse PutBucketEncryption
-> Logger
-> Service
-> Proxy PutBucketEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketEncryption)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutBucketEncryption
PutBucketEncryptionResponse
PutBucketEncryptionResponse'
instance Prelude.Hashable PutBucketEncryption
instance Prelude.NFData PutBucketEncryption
instance Core.ToElement PutBucketEncryption where
toElement :: PutBucketEncryption -> Element
toElement PutBucketEncryption' {Maybe Text
BucketName
ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: PutBucketEncryption -> ServerSideEncryptionConfiguration
$sel:bucket:PutBucketEncryption' :: PutBucketEncryption -> BucketName
$sel:expectedBucketOwner:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
$sel:contentMD5:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
..} =
Name -> ServerSideEncryptionConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}ServerSideEncryptionConfiguration"
ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration
instance Core.ToHeaders PutBucketEncryption where
toHeaders :: PutBucketEncryption -> [Header]
toHeaders PutBucketEncryption' {Maybe Text
BucketName
ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: PutBucketEncryption -> ServerSideEncryptionConfiguration
$sel:bucket:PutBucketEncryption' :: PutBucketEncryption -> BucketName
$sel:expectedBucketOwner:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
$sel:contentMD5:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketEncryption where
toPath :: PutBucketEncryption -> ByteString
toPath PutBucketEncryption' {Maybe Text
BucketName
ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: ServerSideEncryptionConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:serverSideEncryptionConfiguration:PutBucketEncryption' :: PutBucketEncryption -> ServerSideEncryptionConfiguration
$sel:bucket:PutBucketEncryption' :: PutBucketEncryption -> BucketName
$sel:expectedBucketOwner:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
$sel:contentMD5:PutBucketEncryption' :: PutBucketEncryption -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]
instance Core.ToQuery PutBucketEncryption where
toQuery :: PutBucketEncryption -> QueryString
toQuery =
QueryString -> PutBucketEncryption -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"encryption"])
data PutBucketEncryptionResponse = PutBucketEncryptionResponse'
{
}
deriving (PutBucketEncryptionResponse -> PutBucketEncryptionResponse -> Bool
(PutBucketEncryptionResponse
-> PutBucketEncryptionResponse -> Bool)
-> (PutBucketEncryptionResponse
-> PutBucketEncryptionResponse -> Bool)
-> Eq PutBucketEncryptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketEncryptionResponse -> PutBucketEncryptionResponse -> Bool
$c/= :: PutBucketEncryptionResponse -> PutBucketEncryptionResponse -> Bool
== :: PutBucketEncryptionResponse -> PutBucketEncryptionResponse -> Bool
$c== :: PutBucketEncryptionResponse -> PutBucketEncryptionResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketEncryptionResponse]
ReadPrec PutBucketEncryptionResponse
Int -> ReadS PutBucketEncryptionResponse
ReadS [PutBucketEncryptionResponse]
(Int -> ReadS PutBucketEncryptionResponse)
-> ReadS [PutBucketEncryptionResponse]
-> ReadPrec PutBucketEncryptionResponse
-> ReadPrec [PutBucketEncryptionResponse]
-> Read PutBucketEncryptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketEncryptionResponse]
$creadListPrec :: ReadPrec [PutBucketEncryptionResponse]
readPrec :: ReadPrec PutBucketEncryptionResponse
$creadPrec :: ReadPrec PutBucketEncryptionResponse
readList :: ReadS [PutBucketEncryptionResponse]
$creadList :: ReadS [PutBucketEncryptionResponse]
readsPrec :: Int -> ReadS PutBucketEncryptionResponse
$creadsPrec :: Int -> ReadS PutBucketEncryptionResponse
Prelude.Read, Int -> PutBucketEncryptionResponse -> ShowS
[PutBucketEncryptionResponse] -> ShowS
PutBucketEncryptionResponse -> String
(Int -> PutBucketEncryptionResponse -> ShowS)
-> (PutBucketEncryptionResponse -> String)
-> ([PutBucketEncryptionResponse] -> ShowS)
-> Show PutBucketEncryptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketEncryptionResponse] -> ShowS
$cshowList :: [PutBucketEncryptionResponse] -> ShowS
show :: PutBucketEncryptionResponse -> String
$cshow :: PutBucketEncryptionResponse -> String
showsPrec :: Int -> PutBucketEncryptionResponse -> ShowS
$cshowsPrec :: Int -> PutBucketEncryptionResponse -> ShowS
Prelude.Show, (forall x.
PutBucketEncryptionResponse -> Rep PutBucketEncryptionResponse x)
-> (forall x.
Rep PutBucketEncryptionResponse x -> PutBucketEncryptionResponse)
-> Generic PutBucketEncryptionResponse
forall x.
Rep PutBucketEncryptionResponse x -> PutBucketEncryptionResponse
forall x.
PutBucketEncryptionResponse -> Rep PutBucketEncryptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketEncryptionResponse x -> PutBucketEncryptionResponse
$cfrom :: forall x.
PutBucketEncryptionResponse -> Rep PutBucketEncryptionResponse x
Prelude.Generic)
newPutBucketEncryptionResponse ::
PutBucketEncryptionResponse
newPutBucketEncryptionResponse :: PutBucketEncryptionResponse
newPutBucketEncryptionResponse =
PutBucketEncryptionResponse
PutBucketEncryptionResponse'
instance Prelude.NFData PutBucketEncryptionResponse