{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.S3.Types.VersioningConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.BucketVersioningStatus
import Amazonka.S3.Types.MFADelete
data VersioningConfiguration = VersioningConfiguration'
{
VersioningConfiguration -> Maybe BucketVersioningStatus
status :: Prelude.Maybe BucketVersioningStatus,
VersioningConfiguration -> Maybe MFADelete
mfaDelete :: Prelude.Maybe MFADelete
}
deriving (VersioningConfiguration -> VersioningConfiguration -> Bool
(VersioningConfiguration -> VersioningConfiguration -> Bool)
-> (VersioningConfiguration -> VersioningConfiguration -> Bool)
-> Eq VersioningConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VersioningConfiguration -> VersioningConfiguration -> Bool
$c/= :: VersioningConfiguration -> VersioningConfiguration -> Bool
== :: VersioningConfiguration -> VersioningConfiguration -> Bool
$c== :: VersioningConfiguration -> VersioningConfiguration -> Bool
Prelude.Eq, ReadPrec [VersioningConfiguration]
ReadPrec VersioningConfiguration
Int -> ReadS VersioningConfiguration
ReadS [VersioningConfiguration]
(Int -> ReadS VersioningConfiguration)
-> ReadS [VersioningConfiguration]
-> ReadPrec VersioningConfiguration
-> ReadPrec [VersioningConfiguration]
-> Read VersioningConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VersioningConfiguration]
$creadListPrec :: ReadPrec [VersioningConfiguration]
readPrec :: ReadPrec VersioningConfiguration
$creadPrec :: ReadPrec VersioningConfiguration
readList :: ReadS [VersioningConfiguration]
$creadList :: ReadS [VersioningConfiguration]
readsPrec :: Int -> ReadS VersioningConfiguration
$creadsPrec :: Int -> ReadS VersioningConfiguration
Prelude.Read, Int -> VersioningConfiguration -> ShowS
[VersioningConfiguration] -> ShowS
VersioningConfiguration -> String
(Int -> VersioningConfiguration -> ShowS)
-> (VersioningConfiguration -> String)
-> ([VersioningConfiguration] -> ShowS)
-> Show VersioningConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VersioningConfiguration] -> ShowS
$cshowList :: [VersioningConfiguration] -> ShowS
show :: VersioningConfiguration -> String
$cshow :: VersioningConfiguration -> String
showsPrec :: Int -> VersioningConfiguration -> ShowS
$cshowsPrec :: Int -> VersioningConfiguration -> ShowS
Prelude.Show, (forall x.
VersioningConfiguration -> Rep VersioningConfiguration x)
-> (forall x.
Rep VersioningConfiguration x -> VersioningConfiguration)
-> Generic VersioningConfiguration
forall x. Rep VersioningConfiguration x -> VersioningConfiguration
forall x. VersioningConfiguration -> Rep VersioningConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VersioningConfiguration x -> VersioningConfiguration
$cfrom :: forall x. VersioningConfiguration -> Rep VersioningConfiguration x
Prelude.Generic)
newVersioningConfiguration ::
VersioningConfiguration
newVersioningConfiguration :: VersioningConfiguration
newVersioningConfiguration =
VersioningConfiguration' :: Maybe BucketVersioningStatus
-> Maybe MFADelete -> VersioningConfiguration
VersioningConfiguration'
{ $sel:status:VersioningConfiguration' :: Maybe BucketVersioningStatus
status = Maybe BucketVersioningStatus
forall a. Maybe a
Prelude.Nothing,
$sel:mfaDelete:VersioningConfiguration' :: Maybe MFADelete
mfaDelete = Maybe MFADelete
forall a. Maybe a
Prelude.Nothing
}
versioningConfiguration_status :: Lens.Lens' VersioningConfiguration (Prelude.Maybe BucketVersioningStatus)
versioningConfiguration_status :: (Maybe BucketVersioningStatus -> f (Maybe BucketVersioningStatus))
-> VersioningConfiguration -> f VersioningConfiguration
versioningConfiguration_status = (VersioningConfiguration -> Maybe BucketVersioningStatus)
-> (VersioningConfiguration
-> Maybe BucketVersioningStatus -> VersioningConfiguration)
-> Lens
VersioningConfiguration
VersioningConfiguration
(Maybe BucketVersioningStatus)
(Maybe BucketVersioningStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersioningConfiguration' {Maybe BucketVersioningStatus
status :: Maybe BucketVersioningStatus
$sel:status:VersioningConfiguration' :: VersioningConfiguration -> Maybe BucketVersioningStatus
status} -> Maybe BucketVersioningStatus
status) (\s :: VersioningConfiguration
s@VersioningConfiguration' {} Maybe BucketVersioningStatus
a -> VersioningConfiguration
s {$sel:status:VersioningConfiguration' :: Maybe BucketVersioningStatus
status = Maybe BucketVersioningStatus
a} :: VersioningConfiguration)
versioningConfiguration_mfaDelete :: Lens.Lens' VersioningConfiguration (Prelude.Maybe MFADelete)
versioningConfiguration_mfaDelete :: (Maybe MFADelete -> f (Maybe MFADelete))
-> VersioningConfiguration -> f VersioningConfiguration
versioningConfiguration_mfaDelete = (VersioningConfiguration -> Maybe MFADelete)
-> (VersioningConfiguration
-> Maybe MFADelete -> VersioningConfiguration)
-> Lens
VersioningConfiguration
VersioningConfiguration
(Maybe MFADelete)
(Maybe MFADelete)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersioningConfiguration' {Maybe MFADelete
mfaDelete :: Maybe MFADelete
$sel:mfaDelete:VersioningConfiguration' :: VersioningConfiguration -> Maybe MFADelete
mfaDelete} -> Maybe MFADelete
mfaDelete) (\s :: VersioningConfiguration
s@VersioningConfiguration' {} Maybe MFADelete
a -> VersioningConfiguration
s {$sel:mfaDelete:VersioningConfiguration' :: Maybe MFADelete
mfaDelete = Maybe MFADelete
a} :: VersioningConfiguration)
instance Prelude.Hashable VersioningConfiguration
instance Prelude.NFData VersioningConfiguration
instance Core.ToXML VersioningConfiguration where
toXML :: VersioningConfiguration -> XML
toXML VersioningConfiguration' {Maybe BucketVersioningStatus
Maybe MFADelete
mfaDelete :: Maybe MFADelete
status :: Maybe BucketVersioningStatus
$sel:mfaDelete:VersioningConfiguration' :: VersioningConfiguration -> Maybe MFADelete
$sel:status:VersioningConfiguration' :: VersioningConfiguration -> Maybe BucketVersioningStatus
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Status" Name -> Maybe BucketVersioningStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe BucketVersioningStatus
status,
Name
"MfaDelete" Name -> Maybe MFADelete -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe MFADelete
mfaDelete
]