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