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