{-# 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.LifecycleRule 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.AbortIncompleteMultipartUpload
import Amazonka.S3.Types.ExpirationStatus
import Amazonka.S3.Types.LifecycleExpiration
import Amazonka.S3.Types.LifecycleRuleFilter
import Amazonka.S3.Types.NoncurrentVersionExpiration
import Amazonka.S3.Types.NoncurrentVersionTransition
import Amazonka.S3.Types.Transition
data LifecycleRule = LifecycleRule'
{
LifecycleRule -> Maybe [Transition]
transitions :: Prelude.Maybe [Transition],
LifecycleRule -> Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration :: Prelude.Maybe NoncurrentVersionExpiration,
LifecycleRule -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
LifecycleRule -> Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions :: Prelude.Maybe [NoncurrentVersionTransition],
LifecycleRule -> Maybe LifecycleExpiration
expiration :: Prelude.Maybe LifecycleExpiration,
LifecycleRule -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
LifecycleRule -> Maybe LifecycleRuleFilter
filter' :: Prelude.Maybe LifecycleRuleFilter,
LifecycleRule -> Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload :: Prelude.Maybe AbortIncompleteMultipartUpload,
LifecycleRule -> ExpirationStatus
status :: ExpirationStatus
}
deriving (LifecycleRule -> LifecycleRule -> Bool
(LifecycleRule -> LifecycleRule -> Bool)
-> (LifecycleRule -> LifecycleRule -> Bool) -> Eq LifecycleRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LifecycleRule -> LifecycleRule -> Bool
$c/= :: LifecycleRule -> LifecycleRule -> Bool
== :: LifecycleRule -> LifecycleRule -> Bool
$c== :: LifecycleRule -> LifecycleRule -> Bool
Prelude.Eq, ReadPrec [LifecycleRule]
ReadPrec LifecycleRule
Int -> ReadS LifecycleRule
ReadS [LifecycleRule]
(Int -> ReadS LifecycleRule)
-> ReadS [LifecycleRule]
-> ReadPrec LifecycleRule
-> ReadPrec [LifecycleRule]
-> Read LifecycleRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LifecycleRule]
$creadListPrec :: ReadPrec [LifecycleRule]
readPrec :: ReadPrec LifecycleRule
$creadPrec :: ReadPrec LifecycleRule
readList :: ReadS [LifecycleRule]
$creadList :: ReadS [LifecycleRule]
readsPrec :: Int -> ReadS LifecycleRule
$creadsPrec :: Int -> ReadS LifecycleRule
Prelude.Read, Int -> LifecycleRule -> ShowS
[LifecycleRule] -> ShowS
LifecycleRule -> String
(Int -> LifecycleRule -> ShowS)
-> (LifecycleRule -> String)
-> ([LifecycleRule] -> ShowS)
-> Show LifecycleRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LifecycleRule] -> ShowS
$cshowList :: [LifecycleRule] -> ShowS
show :: LifecycleRule -> String
$cshow :: LifecycleRule -> String
showsPrec :: Int -> LifecycleRule -> ShowS
$cshowsPrec :: Int -> LifecycleRule -> ShowS
Prelude.Show, (forall x. LifecycleRule -> Rep LifecycleRule x)
-> (forall x. Rep LifecycleRule x -> LifecycleRule)
-> Generic LifecycleRule
forall x. Rep LifecycleRule x -> LifecycleRule
forall x. LifecycleRule -> Rep LifecycleRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LifecycleRule x -> LifecycleRule
$cfrom :: forall x. LifecycleRule -> Rep LifecycleRule x
Prelude.Generic)
newLifecycleRule ::
ExpirationStatus ->
LifecycleRule
newLifecycleRule :: ExpirationStatus -> LifecycleRule
newLifecycleRule ExpirationStatus
pStatus_ =
LifecycleRule' :: Maybe [Transition]
-> Maybe NoncurrentVersionExpiration
-> Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule
LifecycleRule'
{ $sel:transitions:LifecycleRule' :: Maybe [Transition]
transitions = Maybe [Transition]
forall a. Maybe a
Prelude.Nothing,
$sel:noncurrentVersionExpiration:LifecycleRule' :: Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration = Maybe NoncurrentVersionExpiration
forall a. Maybe a
Prelude.Nothing,
$sel:prefix:LifecycleRule' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:noncurrentVersionTransitions:LifecycleRule' :: Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions = Maybe [NoncurrentVersionTransition]
forall a. Maybe a
Prelude.Nothing,
$sel:expiration:LifecycleRule' :: Maybe LifecycleExpiration
expiration = Maybe LifecycleExpiration
forall a. Maybe a
Prelude.Nothing,
$sel:id:LifecycleRule' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filter':LifecycleRule' :: Maybe LifecycleRuleFilter
filter' = Maybe LifecycleRuleFilter
forall a. Maybe a
Prelude.Nothing,
$sel:abortIncompleteMultipartUpload:LifecycleRule' :: Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload = Maybe AbortIncompleteMultipartUpload
forall a. Maybe a
Prelude.Nothing,
$sel:status:LifecycleRule' :: ExpirationStatus
status = ExpirationStatus
pStatus_
}
lifecycleRule_transitions :: Lens.Lens' LifecycleRule (Prelude.Maybe [Transition])
lifecycleRule_transitions :: (Maybe [Transition] -> f (Maybe [Transition]))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_transitions = (LifecycleRule -> Maybe [Transition])
-> (LifecycleRule -> Maybe [Transition] -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe [Transition])
(Maybe [Transition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe [Transition]
transitions :: Maybe [Transition]
$sel:transitions:LifecycleRule' :: LifecycleRule -> Maybe [Transition]
transitions} -> Maybe [Transition]
transitions) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe [Transition]
a -> LifecycleRule
s {$sel:transitions:LifecycleRule' :: Maybe [Transition]
transitions = Maybe [Transition]
a} :: LifecycleRule) ((Maybe [Transition] -> f (Maybe [Transition]))
-> LifecycleRule -> f LifecycleRule)
-> ((Maybe [Transition] -> f (Maybe [Transition]))
-> Maybe [Transition] -> f (Maybe [Transition]))
-> (Maybe [Transition] -> f (Maybe [Transition]))
-> LifecycleRule
-> f LifecycleRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Transition] [Transition] [Transition] [Transition]
-> Iso
(Maybe [Transition])
(Maybe [Transition])
(Maybe [Transition])
(Maybe [Transition])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Transition] [Transition] [Transition] [Transition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lifecycleRule_noncurrentVersionExpiration :: Lens.Lens' LifecycleRule (Prelude.Maybe NoncurrentVersionExpiration)
lifecycleRule_noncurrentVersionExpiration :: (Maybe NoncurrentVersionExpiration
-> f (Maybe NoncurrentVersionExpiration))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_noncurrentVersionExpiration = (LifecycleRule -> Maybe NoncurrentVersionExpiration)
-> (LifecycleRule
-> Maybe NoncurrentVersionExpiration -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe NoncurrentVersionExpiration)
(Maybe NoncurrentVersionExpiration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration :: Maybe NoncurrentVersionExpiration
$sel:noncurrentVersionExpiration:LifecycleRule' :: LifecycleRule -> Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration} -> Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe NoncurrentVersionExpiration
a -> LifecycleRule
s {$sel:noncurrentVersionExpiration:LifecycleRule' :: Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration = Maybe NoncurrentVersionExpiration
a} :: LifecycleRule)
lifecycleRule_prefix :: Lens.Lens' LifecycleRule (Prelude.Maybe Prelude.Text)
lifecycleRule_prefix :: (Maybe Text -> f (Maybe Text)) -> LifecycleRule -> f LifecycleRule
lifecycleRule_prefix = (LifecycleRule -> Maybe Text)
-> (LifecycleRule -> Maybe Text -> LifecycleRule)
-> Lens LifecycleRule LifecycleRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe Text
prefix :: Maybe Text
$sel:prefix:LifecycleRule' :: LifecycleRule -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe Text
a -> LifecycleRule
s {$sel:prefix:LifecycleRule' :: Maybe Text
prefix = Maybe Text
a} :: LifecycleRule)
lifecycleRule_noncurrentVersionTransitions :: Lens.Lens' LifecycleRule (Prelude.Maybe [NoncurrentVersionTransition])
lifecycleRule_noncurrentVersionTransitions :: (Maybe [NoncurrentVersionTransition]
-> f (Maybe [NoncurrentVersionTransition]))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_noncurrentVersionTransitions = (LifecycleRule -> Maybe [NoncurrentVersionTransition])
-> (LifecycleRule
-> Maybe [NoncurrentVersionTransition] -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe [NoncurrentVersionTransition])
(Maybe [NoncurrentVersionTransition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions :: Maybe [NoncurrentVersionTransition]
$sel:noncurrentVersionTransitions:LifecycleRule' :: LifecycleRule -> Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions} -> Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe [NoncurrentVersionTransition]
a -> LifecycleRule
s {$sel:noncurrentVersionTransitions:LifecycleRule' :: Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions = Maybe [NoncurrentVersionTransition]
a} :: LifecycleRule) ((Maybe [NoncurrentVersionTransition]
-> f (Maybe [NoncurrentVersionTransition]))
-> LifecycleRule -> f LifecycleRule)
-> ((Maybe [NoncurrentVersionTransition]
-> f (Maybe [NoncurrentVersionTransition]))
-> Maybe [NoncurrentVersionTransition]
-> f (Maybe [NoncurrentVersionTransition]))
-> (Maybe [NoncurrentVersionTransition]
-> f (Maybe [NoncurrentVersionTransition]))
-> LifecycleRule
-> f LifecycleRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
-> Iso
(Maybe [NoncurrentVersionTransition])
(Maybe [NoncurrentVersionTransition])
(Maybe [NoncurrentVersionTransition])
(Maybe [NoncurrentVersionTransition])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
[NoncurrentVersionTransition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lifecycleRule_expiration :: Lens.Lens' LifecycleRule (Prelude.Maybe LifecycleExpiration)
lifecycleRule_expiration :: (Maybe LifecycleExpiration -> f (Maybe LifecycleExpiration))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_expiration = (LifecycleRule -> Maybe LifecycleExpiration)
-> (LifecycleRule -> Maybe LifecycleExpiration -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe LifecycleExpiration)
(Maybe LifecycleExpiration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe LifecycleExpiration
expiration :: Maybe LifecycleExpiration
$sel:expiration:LifecycleRule' :: LifecycleRule -> Maybe LifecycleExpiration
expiration} -> Maybe LifecycleExpiration
expiration) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe LifecycleExpiration
a -> LifecycleRule
s {$sel:expiration:LifecycleRule' :: Maybe LifecycleExpiration
expiration = Maybe LifecycleExpiration
a} :: LifecycleRule)
lifecycleRule_id :: Lens.Lens' LifecycleRule (Prelude.Maybe Prelude.Text)
lifecycleRule_id :: (Maybe Text -> f (Maybe Text)) -> LifecycleRule -> f LifecycleRule
lifecycleRule_id = (LifecycleRule -> Maybe Text)
-> (LifecycleRule -> Maybe Text -> LifecycleRule)
-> Lens LifecycleRule LifecycleRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe Text
id :: Maybe Text
$sel:id:LifecycleRule' :: LifecycleRule -> Maybe Text
id} -> Maybe Text
id) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe Text
a -> LifecycleRule
s {$sel:id:LifecycleRule' :: Maybe Text
id = Maybe Text
a} :: LifecycleRule)
lifecycleRule_filter :: Lens.Lens' LifecycleRule (Prelude.Maybe LifecycleRuleFilter)
lifecycleRule_filter :: (Maybe LifecycleRuleFilter -> f (Maybe LifecycleRuleFilter))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_filter = (LifecycleRule -> Maybe LifecycleRuleFilter)
-> (LifecycleRule -> Maybe LifecycleRuleFilter -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe LifecycleRuleFilter)
(Maybe LifecycleRuleFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe LifecycleRuleFilter
filter' :: Maybe LifecycleRuleFilter
$sel:filter':LifecycleRule' :: LifecycleRule -> Maybe LifecycleRuleFilter
filter'} -> Maybe LifecycleRuleFilter
filter') (\s :: LifecycleRule
s@LifecycleRule' {} Maybe LifecycleRuleFilter
a -> LifecycleRule
s {$sel:filter':LifecycleRule' :: Maybe LifecycleRuleFilter
filter' = Maybe LifecycleRuleFilter
a} :: LifecycleRule)
lifecycleRule_abortIncompleteMultipartUpload :: Lens.Lens' LifecycleRule (Prelude.Maybe AbortIncompleteMultipartUpload)
lifecycleRule_abortIncompleteMultipartUpload :: (Maybe AbortIncompleteMultipartUpload
-> f (Maybe AbortIncompleteMultipartUpload))
-> LifecycleRule -> f LifecycleRule
lifecycleRule_abortIncompleteMultipartUpload = (LifecycleRule -> Maybe AbortIncompleteMultipartUpload)
-> (LifecycleRule
-> Maybe AbortIncompleteMultipartUpload -> LifecycleRule)
-> Lens
LifecycleRule
LifecycleRule
(Maybe AbortIncompleteMultipartUpload)
(Maybe AbortIncompleteMultipartUpload)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload :: Maybe AbortIncompleteMultipartUpload
$sel:abortIncompleteMultipartUpload:LifecycleRule' :: LifecycleRule -> Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload} -> Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload) (\s :: LifecycleRule
s@LifecycleRule' {} Maybe AbortIncompleteMultipartUpload
a -> LifecycleRule
s {$sel:abortIncompleteMultipartUpload:LifecycleRule' :: Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload = Maybe AbortIncompleteMultipartUpload
a} :: LifecycleRule)
lifecycleRule_status :: Lens.Lens' LifecycleRule ExpirationStatus
lifecycleRule_status :: (ExpirationStatus -> f ExpirationStatus)
-> LifecycleRule -> f LifecycleRule
lifecycleRule_status = (LifecycleRule -> ExpirationStatus)
-> (LifecycleRule -> ExpirationStatus -> LifecycleRule)
-> Lens
LifecycleRule LifecycleRule ExpirationStatus ExpirationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LifecycleRule' {ExpirationStatus
status :: ExpirationStatus
$sel:status:LifecycleRule' :: LifecycleRule -> ExpirationStatus
status} -> ExpirationStatus
status) (\s :: LifecycleRule
s@LifecycleRule' {} ExpirationStatus
a -> LifecycleRule
s {$sel:status:LifecycleRule' :: ExpirationStatus
status = ExpirationStatus
a} :: LifecycleRule)
instance Core.FromXML LifecycleRule where
parseXML :: [Node] -> Either String LifecycleRule
parseXML [Node]
x =
Maybe [Transition]
-> Maybe NoncurrentVersionExpiration
-> Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule
LifecycleRule'
(Maybe [Transition]
-> Maybe NoncurrentVersionExpiration
-> Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe [Transition])
-> Either
String
(Maybe NoncurrentVersionExpiration
-> Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (([Node] -> Either String [Transition])
-> [Node] -> Either String (Maybe [Transition])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Transition]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"Transition") [Node]
x)
Either
String
(Maybe NoncurrentVersionExpiration
-> Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe NoncurrentVersionExpiration)
-> Either
String
(Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe NoncurrentVersionExpiration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NoncurrentVersionExpiration")
Either
String
(Maybe Text
-> Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe Text)
-> Either
String
(Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Prefix")
Either
String
(Maybe [NoncurrentVersionTransition]
-> Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe [NoncurrentVersionTransition])
-> Either
String
(Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ([Node] -> Either String [NoncurrentVersionTransition])
-> [Node] -> Either String (Maybe [NoncurrentVersionTransition])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
(Text -> [Node] -> Either String [NoncurrentVersionTransition]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"NoncurrentVersionTransition")
[Node]
x
)
Either
String
(Maybe LifecycleExpiration
-> Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe LifecycleExpiration)
-> Either
String
(Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LifecycleExpiration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Expiration")
Either
String
(Maybe Text
-> Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe Text)
-> Either
String
(Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ID")
Either
String
(Maybe LifecycleRuleFilter
-> Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus
-> LifecycleRule)
-> Either String (Maybe LifecycleRuleFilter)
-> Either
String
(Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus -> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LifecycleRuleFilter)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Filter")
Either
String
(Maybe AbortIncompleteMultipartUpload
-> ExpirationStatus -> LifecycleRule)
-> Either String (Maybe AbortIncompleteMultipartUpload)
-> Either String (ExpirationStatus -> LifecycleRule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe AbortIncompleteMultipartUpload)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AbortIncompleteMultipartUpload")
Either String (ExpirationStatus -> LifecycleRule)
-> Either String ExpirationStatus -> Either String LifecycleRule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ExpirationStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
instance Prelude.Hashable LifecycleRule
instance Prelude.NFData LifecycleRule
instance Core.ToXML LifecycleRule where
toXML :: LifecycleRule -> XML
toXML LifecycleRule' {Maybe [Transition]
Maybe [NoncurrentVersionTransition]
Maybe Text
Maybe AbortIncompleteMultipartUpload
Maybe LifecycleExpiration
Maybe NoncurrentVersionExpiration
Maybe LifecycleRuleFilter
ExpirationStatus
status :: ExpirationStatus
abortIncompleteMultipartUpload :: Maybe AbortIncompleteMultipartUpload
filter' :: Maybe LifecycleRuleFilter
id :: Maybe Text
expiration :: Maybe LifecycleExpiration
noncurrentVersionTransitions :: Maybe [NoncurrentVersionTransition]
prefix :: Maybe Text
noncurrentVersionExpiration :: Maybe NoncurrentVersionExpiration
transitions :: Maybe [Transition]
$sel:status:LifecycleRule' :: LifecycleRule -> ExpirationStatus
$sel:abortIncompleteMultipartUpload:LifecycleRule' :: LifecycleRule -> Maybe AbortIncompleteMultipartUpload
$sel:filter':LifecycleRule' :: LifecycleRule -> Maybe LifecycleRuleFilter
$sel:id:LifecycleRule' :: LifecycleRule -> Maybe Text
$sel:expiration:LifecycleRule' :: LifecycleRule -> Maybe LifecycleExpiration
$sel:noncurrentVersionTransitions:LifecycleRule' :: LifecycleRule -> Maybe [NoncurrentVersionTransition]
$sel:prefix:LifecycleRule' :: LifecycleRule -> Maybe Text
$sel:noncurrentVersionExpiration:LifecycleRule' :: LifecycleRule -> Maybe NoncurrentVersionExpiration
$sel:transitions:LifecycleRule' :: LifecycleRule -> Maybe [Transition]
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Maybe XML -> XML
forall a. ToXML a => a -> XML
Core.toXML
( Name -> [Transition] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"Transition"
([Transition] -> XML) -> Maybe [Transition] -> Maybe XML
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Transition]
transitions
),
Name
"NoncurrentVersionExpiration"
Name -> Maybe NoncurrentVersionExpiration -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe NoncurrentVersionExpiration
noncurrentVersionExpiration,
Name
"Prefix" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
prefix,
Maybe XML -> XML
forall a. ToXML a => a -> XML
Core.toXML
( Name -> [NoncurrentVersionTransition] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"NoncurrentVersionTransition"
([NoncurrentVersionTransition] -> XML)
-> Maybe [NoncurrentVersionTransition] -> Maybe XML
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NoncurrentVersionTransition]
noncurrentVersionTransitions
),
Name
"Expiration" Name -> Maybe LifecycleExpiration -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe LifecycleExpiration
expiration,
Name
"ID" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
id,
Name
"Filter" Name -> Maybe LifecycleRuleFilter -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe LifecycleRuleFilter
filter',
Name
"AbortIncompleteMultipartUpload"
Name -> Maybe AbortIncompleteMultipartUpload -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe AbortIncompleteMultipartUpload
abortIncompleteMultipartUpload,
Name
"Status" Name -> ExpirationStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ExpirationStatus
status
]