{-# 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.BucketLifecycleConfiguration 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.LifecycleRule
data BucketLifecycleConfiguration = BucketLifecycleConfiguration'
{
BucketLifecycleConfiguration -> [LifecycleRule]
rules :: [LifecycleRule]
}
deriving (BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool
(BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool)
-> (BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool)
-> Eq BucketLifecycleConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool
$c/= :: BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool
== :: BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool
$c== :: BucketLifecycleConfiguration
-> BucketLifecycleConfiguration -> Bool
Prelude.Eq, ReadPrec [BucketLifecycleConfiguration]
ReadPrec BucketLifecycleConfiguration
Int -> ReadS BucketLifecycleConfiguration
ReadS [BucketLifecycleConfiguration]
(Int -> ReadS BucketLifecycleConfiguration)
-> ReadS [BucketLifecycleConfiguration]
-> ReadPrec BucketLifecycleConfiguration
-> ReadPrec [BucketLifecycleConfiguration]
-> Read BucketLifecycleConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketLifecycleConfiguration]
$creadListPrec :: ReadPrec [BucketLifecycleConfiguration]
readPrec :: ReadPrec BucketLifecycleConfiguration
$creadPrec :: ReadPrec BucketLifecycleConfiguration
readList :: ReadS [BucketLifecycleConfiguration]
$creadList :: ReadS [BucketLifecycleConfiguration]
readsPrec :: Int -> ReadS BucketLifecycleConfiguration
$creadsPrec :: Int -> ReadS BucketLifecycleConfiguration
Prelude.Read, Int -> BucketLifecycleConfiguration -> ShowS
[BucketLifecycleConfiguration] -> ShowS
BucketLifecycleConfiguration -> String
(Int -> BucketLifecycleConfiguration -> ShowS)
-> (BucketLifecycleConfiguration -> String)
-> ([BucketLifecycleConfiguration] -> ShowS)
-> Show BucketLifecycleConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketLifecycleConfiguration] -> ShowS
$cshowList :: [BucketLifecycleConfiguration] -> ShowS
show :: BucketLifecycleConfiguration -> String
$cshow :: BucketLifecycleConfiguration -> String
showsPrec :: Int -> BucketLifecycleConfiguration -> ShowS
$cshowsPrec :: Int -> BucketLifecycleConfiguration -> ShowS
Prelude.Show, (forall x.
BucketLifecycleConfiguration -> Rep BucketLifecycleConfiguration x)
-> (forall x.
Rep BucketLifecycleConfiguration x -> BucketLifecycleConfiguration)
-> Generic BucketLifecycleConfiguration
forall x.
Rep BucketLifecycleConfiguration x -> BucketLifecycleConfiguration
forall x.
BucketLifecycleConfiguration -> Rep BucketLifecycleConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BucketLifecycleConfiguration x -> BucketLifecycleConfiguration
$cfrom :: forall x.
BucketLifecycleConfiguration -> Rep BucketLifecycleConfiguration x
Prelude.Generic)
newBucketLifecycleConfiguration ::
BucketLifecycleConfiguration
newBucketLifecycleConfiguration :: BucketLifecycleConfiguration
newBucketLifecycleConfiguration =
BucketLifecycleConfiguration' :: [LifecycleRule] -> BucketLifecycleConfiguration
BucketLifecycleConfiguration'
{ $sel:rules:BucketLifecycleConfiguration' :: [LifecycleRule]
rules =
[LifecycleRule]
forall a. Monoid a => a
Prelude.mempty
}
bucketLifecycleConfiguration_rules :: Lens.Lens' BucketLifecycleConfiguration [LifecycleRule]
bucketLifecycleConfiguration_rules :: ([LifecycleRule] -> f [LifecycleRule])
-> BucketLifecycleConfiguration -> f BucketLifecycleConfiguration
bucketLifecycleConfiguration_rules = (BucketLifecycleConfiguration -> [LifecycleRule])
-> (BucketLifecycleConfiguration
-> [LifecycleRule] -> BucketLifecycleConfiguration)
-> Lens
BucketLifecycleConfiguration
BucketLifecycleConfiguration
[LifecycleRule]
[LifecycleRule]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketLifecycleConfiguration' {[LifecycleRule]
rules :: [LifecycleRule]
$sel:rules:BucketLifecycleConfiguration' :: BucketLifecycleConfiguration -> [LifecycleRule]
rules} -> [LifecycleRule]
rules) (\s :: BucketLifecycleConfiguration
s@BucketLifecycleConfiguration' {} [LifecycleRule]
a -> BucketLifecycleConfiguration
s {$sel:rules:BucketLifecycleConfiguration' :: [LifecycleRule]
rules = [LifecycleRule]
a} :: BucketLifecycleConfiguration) (([LifecycleRule] -> f [LifecycleRule])
-> BucketLifecycleConfiguration -> f BucketLifecycleConfiguration)
-> (([LifecycleRule] -> f [LifecycleRule])
-> [LifecycleRule] -> f [LifecycleRule])
-> ([LifecycleRule] -> f [LifecycleRule])
-> BucketLifecycleConfiguration
-> f BucketLifecycleConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LifecycleRule] -> f [LifecycleRule])
-> [LifecycleRule] -> f [LifecycleRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.Hashable
BucketLifecycleConfiguration
instance Prelude.NFData BucketLifecycleConfiguration
instance Core.ToXML BucketLifecycleConfiguration where
toXML :: BucketLifecycleConfiguration -> XML
toXML BucketLifecycleConfiguration' {[LifecycleRule]
rules :: [LifecycleRule]
$sel:rules:BucketLifecycleConfiguration' :: BucketLifecycleConfiguration -> [LifecycleRule]
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat [Name -> [LifecycleRule] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"Rule" [LifecycleRule]
rules]