{-# 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.NoncurrentVersionTransition 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.TransitionStorageClass
data NoncurrentVersionTransition = NoncurrentVersionTransition'
{
NoncurrentVersionTransition -> Int
noncurrentDays :: Prelude.Int,
NoncurrentVersionTransition -> TransitionStorageClass
storageClass :: TransitionStorageClass
}
deriving (NoncurrentVersionTransition -> NoncurrentVersionTransition -> Bool
(NoncurrentVersionTransition
-> NoncurrentVersionTransition -> Bool)
-> (NoncurrentVersionTransition
-> NoncurrentVersionTransition -> Bool)
-> Eq NoncurrentVersionTransition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NoncurrentVersionTransition -> NoncurrentVersionTransition -> Bool
$c/= :: NoncurrentVersionTransition -> NoncurrentVersionTransition -> Bool
== :: NoncurrentVersionTransition -> NoncurrentVersionTransition -> Bool
$c== :: NoncurrentVersionTransition -> NoncurrentVersionTransition -> Bool
Prelude.Eq, ReadPrec [NoncurrentVersionTransition]
ReadPrec NoncurrentVersionTransition
Int -> ReadS NoncurrentVersionTransition
ReadS [NoncurrentVersionTransition]
(Int -> ReadS NoncurrentVersionTransition)
-> ReadS [NoncurrentVersionTransition]
-> ReadPrec NoncurrentVersionTransition
-> ReadPrec [NoncurrentVersionTransition]
-> Read NoncurrentVersionTransition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NoncurrentVersionTransition]
$creadListPrec :: ReadPrec [NoncurrentVersionTransition]
readPrec :: ReadPrec NoncurrentVersionTransition
$creadPrec :: ReadPrec NoncurrentVersionTransition
readList :: ReadS [NoncurrentVersionTransition]
$creadList :: ReadS [NoncurrentVersionTransition]
readsPrec :: Int -> ReadS NoncurrentVersionTransition
$creadsPrec :: Int -> ReadS NoncurrentVersionTransition
Prelude.Read, Int -> NoncurrentVersionTransition -> ShowS
[NoncurrentVersionTransition] -> ShowS
NoncurrentVersionTransition -> String
(Int -> NoncurrentVersionTransition -> ShowS)
-> (NoncurrentVersionTransition -> String)
-> ([NoncurrentVersionTransition] -> ShowS)
-> Show NoncurrentVersionTransition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NoncurrentVersionTransition] -> ShowS
$cshowList :: [NoncurrentVersionTransition] -> ShowS
show :: NoncurrentVersionTransition -> String
$cshow :: NoncurrentVersionTransition -> String
showsPrec :: Int -> NoncurrentVersionTransition -> ShowS
$cshowsPrec :: Int -> NoncurrentVersionTransition -> ShowS
Prelude.Show, (forall x.
NoncurrentVersionTransition -> Rep NoncurrentVersionTransition x)
-> (forall x.
Rep NoncurrentVersionTransition x -> NoncurrentVersionTransition)
-> Generic NoncurrentVersionTransition
forall x.
Rep NoncurrentVersionTransition x -> NoncurrentVersionTransition
forall x.
NoncurrentVersionTransition -> Rep NoncurrentVersionTransition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NoncurrentVersionTransition x -> NoncurrentVersionTransition
$cfrom :: forall x.
NoncurrentVersionTransition -> Rep NoncurrentVersionTransition x
Prelude.Generic)
newNoncurrentVersionTransition ::
Prelude.Int ->
TransitionStorageClass ->
NoncurrentVersionTransition
newNoncurrentVersionTransition :: Int -> TransitionStorageClass -> NoncurrentVersionTransition
newNoncurrentVersionTransition
Int
pNoncurrentDays_
TransitionStorageClass
pStorageClass_ =
NoncurrentVersionTransition' :: Int -> TransitionStorageClass -> NoncurrentVersionTransition
NoncurrentVersionTransition'
{ $sel:noncurrentDays:NoncurrentVersionTransition' :: Int
noncurrentDays =
Int
pNoncurrentDays_,
$sel:storageClass:NoncurrentVersionTransition' :: TransitionStorageClass
storageClass = TransitionStorageClass
pStorageClass_
}
noncurrentVersionTransition_noncurrentDays :: Lens.Lens' NoncurrentVersionTransition Prelude.Int
noncurrentVersionTransition_noncurrentDays :: (Int -> f Int)
-> NoncurrentVersionTransition -> f NoncurrentVersionTransition
noncurrentVersionTransition_noncurrentDays = (NoncurrentVersionTransition -> Int)
-> (NoncurrentVersionTransition
-> Int -> NoncurrentVersionTransition)
-> Lens
NoncurrentVersionTransition NoncurrentVersionTransition Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoncurrentVersionTransition' {Int
noncurrentDays :: Int
$sel:noncurrentDays:NoncurrentVersionTransition' :: NoncurrentVersionTransition -> Int
noncurrentDays} -> Int
noncurrentDays) (\s :: NoncurrentVersionTransition
s@NoncurrentVersionTransition' {} Int
a -> NoncurrentVersionTransition
s {$sel:noncurrentDays:NoncurrentVersionTransition' :: Int
noncurrentDays = Int
a} :: NoncurrentVersionTransition)
noncurrentVersionTransition_storageClass :: Lens.Lens' NoncurrentVersionTransition TransitionStorageClass
noncurrentVersionTransition_storageClass :: (TransitionStorageClass -> f TransitionStorageClass)
-> NoncurrentVersionTransition -> f NoncurrentVersionTransition
noncurrentVersionTransition_storageClass = (NoncurrentVersionTransition -> TransitionStorageClass)
-> (NoncurrentVersionTransition
-> TransitionStorageClass -> NoncurrentVersionTransition)
-> Lens
NoncurrentVersionTransition
NoncurrentVersionTransition
TransitionStorageClass
TransitionStorageClass
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoncurrentVersionTransition' {TransitionStorageClass
storageClass :: TransitionStorageClass
$sel:storageClass:NoncurrentVersionTransition' :: NoncurrentVersionTransition -> TransitionStorageClass
storageClass} -> TransitionStorageClass
storageClass) (\s :: NoncurrentVersionTransition
s@NoncurrentVersionTransition' {} TransitionStorageClass
a -> NoncurrentVersionTransition
s {$sel:storageClass:NoncurrentVersionTransition' :: TransitionStorageClass
storageClass = TransitionStorageClass
a} :: NoncurrentVersionTransition)
instance Core.FromXML NoncurrentVersionTransition where
parseXML :: [Node] -> Either String NoncurrentVersionTransition
parseXML [Node]
x =
Int -> TransitionStorageClass -> NoncurrentVersionTransition
NoncurrentVersionTransition'
(Int -> TransitionStorageClass -> NoncurrentVersionTransition)
-> Either String Int
-> Either
String (TransitionStorageClass -> NoncurrentVersionTransition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Int
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"NoncurrentDays")
Either
String (TransitionStorageClass -> NoncurrentVersionTransition)
-> Either String TransitionStorageClass
-> Either String NoncurrentVersionTransition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String TransitionStorageClass
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"StorageClass")
instance Prelude.Hashable NoncurrentVersionTransition
instance Prelude.NFData NoncurrentVersionTransition
instance Core.ToXML NoncurrentVersionTransition where
toXML :: NoncurrentVersionTransition -> XML
toXML NoncurrentVersionTransition' {Int
TransitionStorageClass
storageClass :: TransitionStorageClass
noncurrentDays :: Int
$sel:storageClass:NoncurrentVersionTransition' :: NoncurrentVersionTransition -> TransitionStorageClass
$sel:noncurrentDays:NoncurrentVersionTransition' :: NoncurrentVersionTransition -> Int
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"NoncurrentDays" Name -> Int -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Int
noncurrentDays,
Name
"StorageClass" Name -> TransitionStorageClass -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= TransitionStorageClass
storageClass
]