{-# 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.PutBucketReplication
(
PutBucketReplication (..),
newPutBucketReplication,
putBucketReplication_token,
putBucketReplication_contentMD5,
putBucketReplication_expectedBucketOwner,
putBucketReplication_bucket,
putBucketReplication_replicationConfiguration,
PutBucketReplicationResponse (..),
newPutBucketReplicationResponse,
)
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 PutBucketReplication = PutBucketReplication'
{
PutBucketReplication -> Maybe Text
token :: Prelude.Maybe Prelude.Text,
PutBucketReplication -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketReplication -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketReplication -> BucketName
bucket :: BucketName,
PutBucketReplication -> ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
}
deriving (PutBucketReplication -> PutBucketReplication -> Bool
(PutBucketReplication -> PutBucketReplication -> Bool)
-> (PutBucketReplication -> PutBucketReplication -> Bool)
-> Eq PutBucketReplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketReplication -> PutBucketReplication -> Bool
$c/= :: PutBucketReplication -> PutBucketReplication -> Bool
== :: PutBucketReplication -> PutBucketReplication -> Bool
$c== :: PutBucketReplication -> PutBucketReplication -> Bool
Prelude.Eq, ReadPrec [PutBucketReplication]
ReadPrec PutBucketReplication
Int -> ReadS PutBucketReplication
ReadS [PutBucketReplication]
(Int -> ReadS PutBucketReplication)
-> ReadS [PutBucketReplication]
-> ReadPrec PutBucketReplication
-> ReadPrec [PutBucketReplication]
-> Read PutBucketReplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketReplication]
$creadListPrec :: ReadPrec [PutBucketReplication]
readPrec :: ReadPrec PutBucketReplication
$creadPrec :: ReadPrec PutBucketReplication
readList :: ReadS [PutBucketReplication]
$creadList :: ReadS [PutBucketReplication]
readsPrec :: Int -> ReadS PutBucketReplication
$creadsPrec :: Int -> ReadS PutBucketReplication
Prelude.Read, Int -> PutBucketReplication -> ShowS
[PutBucketReplication] -> ShowS
PutBucketReplication -> String
(Int -> PutBucketReplication -> ShowS)
-> (PutBucketReplication -> String)
-> ([PutBucketReplication] -> ShowS)
-> Show PutBucketReplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketReplication] -> ShowS
$cshowList :: [PutBucketReplication] -> ShowS
show :: PutBucketReplication -> String
$cshow :: PutBucketReplication -> String
showsPrec :: Int -> PutBucketReplication -> ShowS
$cshowsPrec :: Int -> PutBucketReplication -> ShowS
Prelude.Show, (forall x. PutBucketReplication -> Rep PutBucketReplication x)
-> (forall x. Rep PutBucketReplication x -> PutBucketReplication)
-> Generic PutBucketReplication
forall x. Rep PutBucketReplication x -> PutBucketReplication
forall x. PutBucketReplication -> Rep PutBucketReplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketReplication x -> PutBucketReplication
$cfrom :: forall x. PutBucketReplication -> Rep PutBucketReplication x
Prelude.Generic)
newPutBucketReplication ::
BucketName ->
ReplicationConfiguration ->
PutBucketReplication
newPutBucketReplication :: BucketName -> ReplicationConfiguration -> PutBucketReplication
newPutBucketReplication
BucketName
pBucket_
ReplicationConfiguration
pReplicationConfiguration_ =
PutBucketReplication' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> BucketName
-> ReplicationConfiguration
-> PutBucketReplication
PutBucketReplication'
{ $sel:token:PutBucketReplication' :: Maybe Text
token = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentMD5:PutBucketReplication' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketReplication' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketReplication' :: BucketName
bucket = BucketName
pBucket_,
$sel:replicationConfiguration:PutBucketReplication' :: ReplicationConfiguration
replicationConfiguration =
ReplicationConfiguration
pReplicationConfiguration_
}
putBucketReplication_token :: Lens.Lens' PutBucketReplication (Prelude.Maybe Prelude.Text)
putBucketReplication_token :: (Maybe Text -> f (Maybe Text))
-> PutBucketReplication -> f PutBucketReplication
putBucketReplication_token = (PutBucketReplication -> Maybe Text)
-> (PutBucketReplication -> Maybe Text -> PutBucketReplication)
-> Lens
PutBucketReplication PutBucketReplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketReplication' {Maybe Text
token :: Maybe Text
$sel:token:PutBucketReplication' :: PutBucketReplication -> Maybe Text
token} -> Maybe Text
token) (\s :: PutBucketReplication
s@PutBucketReplication' {} Maybe Text
a -> PutBucketReplication
s {$sel:token:PutBucketReplication' :: Maybe Text
token = Maybe Text
a} :: PutBucketReplication)
putBucketReplication_contentMD5 :: Lens.Lens' PutBucketReplication (Prelude.Maybe Prelude.Text)
putBucketReplication_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketReplication -> f PutBucketReplication
putBucketReplication_contentMD5 = (PutBucketReplication -> Maybe Text)
-> (PutBucketReplication -> Maybe Text -> PutBucketReplication)
-> Lens
PutBucketReplication PutBucketReplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketReplication' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketReplication' :: PutBucketReplication -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketReplication
s@PutBucketReplication' {} Maybe Text
a -> PutBucketReplication
s {$sel:contentMD5:PutBucketReplication' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketReplication)
putBucketReplication_expectedBucketOwner :: Lens.Lens' PutBucketReplication (Prelude.Maybe Prelude.Text)
putBucketReplication_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketReplication -> f PutBucketReplication
putBucketReplication_expectedBucketOwner = (PutBucketReplication -> Maybe Text)
-> (PutBucketReplication -> Maybe Text -> PutBucketReplication)
-> Lens
PutBucketReplication PutBucketReplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketReplication' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketReplication' :: PutBucketReplication -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketReplication
s@PutBucketReplication' {} Maybe Text
a -> PutBucketReplication
s {$sel:expectedBucketOwner:PutBucketReplication' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketReplication)
putBucketReplication_bucket :: Lens.Lens' PutBucketReplication BucketName
putBucketReplication_bucket :: (BucketName -> f BucketName)
-> PutBucketReplication -> f PutBucketReplication
putBucketReplication_bucket = (PutBucketReplication -> BucketName)
-> (PutBucketReplication -> BucketName -> PutBucketReplication)
-> Lens
PutBucketReplication PutBucketReplication BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketReplication' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketReplication' :: PutBucketReplication -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketReplication
s@PutBucketReplication' {} BucketName
a -> PutBucketReplication
s {$sel:bucket:PutBucketReplication' :: BucketName
bucket = BucketName
a} :: PutBucketReplication)
putBucketReplication_replicationConfiguration :: Lens.Lens' PutBucketReplication ReplicationConfiguration
putBucketReplication_replicationConfiguration :: (ReplicationConfiguration -> f ReplicationConfiguration)
-> PutBucketReplication -> f PutBucketReplication
putBucketReplication_replicationConfiguration = (PutBucketReplication -> ReplicationConfiguration)
-> (PutBucketReplication
-> ReplicationConfiguration -> PutBucketReplication)
-> Lens
PutBucketReplication
PutBucketReplication
ReplicationConfiguration
ReplicationConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketReplication' {ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
$sel:replicationConfiguration:PutBucketReplication' :: PutBucketReplication -> ReplicationConfiguration
replicationConfiguration} -> ReplicationConfiguration
replicationConfiguration) (\s :: PutBucketReplication
s@PutBucketReplication' {} ReplicationConfiguration
a -> PutBucketReplication
s {$sel:replicationConfiguration:PutBucketReplication' :: ReplicationConfiguration
replicationConfiguration = ReplicationConfiguration
a} :: PutBucketReplication)
instance Core.AWSRequest PutBucketReplication where
type
AWSResponse PutBucketReplication =
PutBucketReplicationResponse
request :: PutBucketReplication -> Request PutBucketReplication
request =
Request PutBucketReplication -> Request PutBucketReplication
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketReplication -> Request PutBucketReplication)
-> (PutBucketReplication -> Request PutBucketReplication)
-> PutBucketReplication
-> Request PutBucketReplication
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutBucketReplication -> Request PutBucketReplication
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketReplication)))
response =
AWSResponse PutBucketReplication
-> Logger
-> Service
-> Proxy PutBucketReplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketReplication)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutBucketReplication
PutBucketReplicationResponse
PutBucketReplicationResponse'
instance Prelude.Hashable PutBucketReplication
instance Prelude.NFData PutBucketReplication
instance Core.ToElement PutBucketReplication where
toElement :: PutBucketReplication -> Element
toElement PutBucketReplication' {Maybe Text
BucketName
ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
token :: Maybe Text
$sel:replicationConfiguration:PutBucketReplication' :: PutBucketReplication -> ReplicationConfiguration
$sel:bucket:PutBucketReplication' :: PutBucketReplication -> BucketName
$sel:expectedBucketOwner:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:contentMD5:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:token:PutBucketReplication' :: PutBucketReplication -> Maybe Text
..} =
Name -> ReplicationConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}ReplicationConfiguration"
ReplicationConfiguration
replicationConfiguration
instance Core.ToHeaders PutBucketReplication where
toHeaders :: PutBucketReplication -> [Header]
toHeaders PutBucketReplication' {Maybe Text
BucketName
ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
token :: Maybe Text
$sel:replicationConfiguration:PutBucketReplication' :: PutBucketReplication -> ReplicationConfiguration
$sel:bucket:PutBucketReplication' :: PutBucketReplication -> BucketName
$sel:expectedBucketOwner:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:contentMD5:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:token:PutBucketReplication' :: PutBucketReplication -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-bucket-object-lock-token" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
token,
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 PutBucketReplication where
toPath :: PutBucketReplication -> ByteString
toPath PutBucketReplication' {Maybe Text
BucketName
ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
token :: Maybe Text
$sel:replicationConfiguration:PutBucketReplication' :: PutBucketReplication -> ReplicationConfiguration
$sel:bucket:PutBucketReplication' :: PutBucketReplication -> BucketName
$sel:expectedBucketOwner:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:contentMD5:PutBucketReplication' :: PutBucketReplication -> Maybe Text
$sel:token:PutBucketReplication' :: PutBucketReplication -> 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 PutBucketReplication where
toQuery :: PutBucketReplication -> QueryString
toQuery =
QueryString -> PutBucketReplication -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"replication"])
data PutBucketReplicationResponse = PutBucketReplicationResponse'
{
}
deriving (PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool
(PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool)
-> (PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool)
-> Eq PutBucketReplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool
$c/= :: PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool
== :: PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool
$c== :: PutBucketReplicationResponse
-> PutBucketReplicationResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketReplicationResponse]
ReadPrec PutBucketReplicationResponse
Int -> ReadS PutBucketReplicationResponse
ReadS [PutBucketReplicationResponse]
(Int -> ReadS PutBucketReplicationResponse)
-> ReadS [PutBucketReplicationResponse]
-> ReadPrec PutBucketReplicationResponse
-> ReadPrec [PutBucketReplicationResponse]
-> Read PutBucketReplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketReplicationResponse]
$creadListPrec :: ReadPrec [PutBucketReplicationResponse]
readPrec :: ReadPrec PutBucketReplicationResponse
$creadPrec :: ReadPrec PutBucketReplicationResponse
readList :: ReadS [PutBucketReplicationResponse]
$creadList :: ReadS [PutBucketReplicationResponse]
readsPrec :: Int -> ReadS PutBucketReplicationResponse
$creadsPrec :: Int -> ReadS PutBucketReplicationResponse
Prelude.Read, Int -> PutBucketReplicationResponse -> ShowS
[PutBucketReplicationResponse] -> ShowS
PutBucketReplicationResponse -> String
(Int -> PutBucketReplicationResponse -> ShowS)
-> (PutBucketReplicationResponse -> String)
-> ([PutBucketReplicationResponse] -> ShowS)
-> Show PutBucketReplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketReplicationResponse] -> ShowS
$cshowList :: [PutBucketReplicationResponse] -> ShowS
show :: PutBucketReplicationResponse -> String
$cshow :: PutBucketReplicationResponse -> String
showsPrec :: Int -> PutBucketReplicationResponse -> ShowS
$cshowsPrec :: Int -> PutBucketReplicationResponse -> ShowS
Prelude.Show, (forall x.
PutBucketReplicationResponse -> Rep PutBucketReplicationResponse x)
-> (forall x.
Rep PutBucketReplicationResponse x -> PutBucketReplicationResponse)
-> Generic PutBucketReplicationResponse
forall x.
Rep PutBucketReplicationResponse x -> PutBucketReplicationResponse
forall x.
PutBucketReplicationResponse -> Rep PutBucketReplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketReplicationResponse x -> PutBucketReplicationResponse
$cfrom :: forall x.
PutBucketReplicationResponse -> Rep PutBucketReplicationResponse x
Prelude.Generic)
newPutBucketReplicationResponse ::
PutBucketReplicationResponse
newPutBucketReplicationResponse :: PutBucketReplicationResponse
newPutBucketReplicationResponse =
PutBucketReplicationResponse
PutBucketReplicationResponse'
instance Prelude.NFData PutBucketReplicationResponse