{-# 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.Tiering 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.IntelligentTieringAccessTier
data Tiering = Tiering'
{
Tiering -> Int
days :: Prelude.Int,
Tiering -> IntelligentTieringAccessTier
accessTier :: IntelligentTieringAccessTier
}
deriving (Tiering -> Tiering -> Bool
(Tiering -> Tiering -> Bool)
-> (Tiering -> Tiering -> Bool) -> Eq Tiering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tiering -> Tiering -> Bool
$c/= :: Tiering -> Tiering -> Bool
== :: Tiering -> Tiering -> Bool
$c== :: Tiering -> Tiering -> Bool
Prelude.Eq, ReadPrec [Tiering]
ReadPrec Tiering
Int -> ReadS Tiering
ReadS [Tiering]
(Int -> ReadS Tiering)
-> ReadS [Tiering]
-> ReadPrec Tiering
-> ReadPrec [Tiering]
-> Read Tiering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Tiering]
$creadListPrec :: ReadPrec [Tiering]
readPrec :: ReadPrec Tiering
$creadPrec :: ReadPrec Tiering
readList :: ReadS [Tiering]
$creadList :: ReadS [Tiering]
readsPrec :: Int -> ReadS Tiering
$creadsPrec :: Int -> ReadS Tiering
Prelude.Read, Int -> Tiering -> ShowS
[Tiering] -> ShowS
Tiering -> String
(Int -> Tiering -> ShowS)
-> (Tiering -> String) -> ([Tiering] -> ShowS) -> Show Tiering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tiering] -> ShowS
$cshowList :: [Tiering] -> ShowS
show :: Tiering -> String
$cshow :: Tiering -> String
showsPrec :: Int -> Tiering -> ShowS
$cshowsPrec :: Int -> Tiering -> ShowS
Prelude.Show, (forall x. Tiering -> Rep Tiering x)
-> (forall x. Rep Tiering x -> Tiering) -> Generic Tiering
forall x. Rep Tiering x -> Tiering
forall x. Tiering -> Rep Tiering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Tiering x -> Tiering
$cfrom :: forall x. Tiering -> Rep Tiering x
Prelude.Generic)
newTiering ::
Prelude.Int ->
IntelligentTieringAccessTier ->
Tiering
newTiering :: Int -> IntelligentTieringAccessTier -> Tiering
newTiering Int
pDays_ IntelligentTieringAccessTier
pAccessTier_ =
Tiering' :: Int -> IntelligentTieringAccessTier -> Tiering
Tiering' {$sel:days:Tiering' :: Int
days = Int
pDays_, $sel:accessTier:Tiering' :: IntelligentTieringAccessTier
accessTier = IntelligentTieringAccessTier
pAccessTier_}
tiering_days :: Lens.Lens' Tiering Prelude.Int
tiering_days :: (Int -> f Int) -> Tiering -> f Tiering
tiering_days = (Tiering -> Int)
-> (Tiering -> Int -> Tiering) -> Lens Tiering Tiering Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tiering' {Int
days :: Int
$sel:days:Tiering' :: Tiering -> Int
days} -> Int
days) (\s :: Tiering
s@Tiering' {} Int
a -> Tiering
s {$sel:days:Tiering' :: Int
days = Int
a} :: Tiering)
tiering_accessTier :: Lens.Lens' Tiering IntelligentTieringAccessTier
tiering_accessTier :: (IntelligentTieringAccessTier -> f IntelligentTieringAccessTier)
-> Tiering -> f Tiering
tiering_accessTier = (Tiering -> IntelligentTieringAccessTier)
-> (Tiering -> IntelligentTieringAccessTier -> Tiering)
-> Lens
Tiering
Tiering
IntelligentTieringAccessTier
IntelligentTieringAccessTier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tiering' {IntelligentTieringAccessTier
accessTier :: IntelligentTieringAccessTier
$sel:accessTier:Tiering' :: Tiering -> IntelligentTieringAccessTier
accessTier} -> IntelligentTieringAccessTier
accessTier) (\s :: Tiering
s@Tiering' {} IntelligentTieringAccessTier
a -> Tiering
s {$sel:accessTier:Tiering' :: IntelligentTieringAccessTier
accessTier = IntelligentTieringAccessTier
a} :: Tiering)
instance Core.FromXML Tiering where
parseXML :: [Node] -> Either String Tiering
parseXML [Node]
x =
Int -> IntelligentTieringAccessTier -> Tiering
Tiering'
(Int -> IntelligentTieringAccessTier -> Tiering)
-> Either String Int
-> Either String (IntelligentTieringAccessTier -> Tiering)
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
"Days")
Either String (IntelligentTieringAccessTier -> Tiering)
-> Either String IntelligentTieringAccessTier
-> Either String Tiering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String IntelligentTieringAccessTier
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"AccessTier")
instance Prelude.Hashable Tiering
instance Prelude.NFData Tiering
instance Core.ToXML Tiering where
toXML :: Tiering -> XML
toXML Tiering' {Int
IntelligentTieringAccessTier
accessTier :: IntelligentTieringAccessTier
days :: Int
$sel:accessTier:Tiering' :: Tiering -> IntelligentTieringAccessTier
$sel:days:Tiering' :: Tiering -> Int
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Days" Name -> Int -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Int
days,
Name
"AccessTier" Name -> IntelligentTieringAccessTier -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= IntelligentTieringAccessTier
accessTier
]