{-# 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.NoncurrentVersionExpiration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data NoncurrentVersionExpiration = NoncurrentVersionExpiration'
{
NoncurrentVersionExpiration -> Int
noncurrentDays :: Prelude.Int
}
deriving (NoncurrentVersionExpiration -> NoncurrentVersionExpiration -> Bool
(NoncurrentVersionExpiration
-> NoncurrentVersionExpiration -> Bool)
-> (NoncurrentVersionExpiration
-> NoncurrentVersionExpiration -> Bool)
-> Eq NoncurrentVersionExpiration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NoncurrentVersionExpiration -> NoncurrentVersionExpiration -> Bool
$c/= :: NoncurrentVersionExpiration -> NoncurrentVersionExpiration -> Bool
== :: NoncurrentVersionExpiration -> NoncurrentVersionExpiration -> Bool
$c== :: NoncurrentVersionExpiration -> NoncurrentVersionExpiration -> Bool
Prelude.Eq, ReadPrec [NoncurrentVersionExpiration]
ReadPrec NoncurrentVersionExpiration
Int -> ReadS NoncurrentVersionExpiration
ReadS [NoncurrentVersionExpiration]
(Int -> ReadS NoncurrentVersionExpiration)
-> ReadS [NoncurrentVersionExpiration]
-> ReadPrec NoncurrentVersionExpiration
-> ReadPrec [NoncurrentVersionExpiration]
-> Read NoncurrentVersionExpiration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NoncurrentVersionExpiration]
$creadListPrec :: ReadPrec [NoncurrentVersionExpiration]
readPrec :: ReadPrec NoncurrentVersionExpiration
$creadPrec :: ReadPrec NoncurrentVersionExpiration
readList :: ReadS [NoncurrentVersionExpiration]
$creadList :: ReadS [NoncurrentVersionExpiration]
readsPrec :: Int -> ReadS NoncurrentVersionExpiration
$creadsPrec :: Int -> ReadS NoncurrentVersionExpiration
Prelude.Read, Int -> NoncurrentVersionExpiration -> ShowS
[NoncurrentVersionExpiration] -> ShowS
NoncurrentVersionExpiration -> String
(Int -> NoncurrentVersionExpiration -> ShowS)
-> (NoncurrentVersionExpiration -> String)
-> ([NoncurrentVersionExpiration] -> ShowS)
-> Show NoncurrentVersionExpiration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NoncurrentVersionExpiration] -> ShowS
$cshowList :: [NoncurrentVersionExpiration] -> ShowS
show :: NoncurrentVersionExpiration -> String
$cshow :: NoncurrentVersionExpiration -> String
showsPrec :: Int -> NoncurrentVersionExpiration -> ShowS
$cshowsPrec :: Int -> NoncurrentVersionExpiration -> ShowS
Prelude.Show, (forall x.
NoncurrentVersionExpiration -> Rep NoncurrentVersionExpiration x)
-> (forall x.
Rep NoncurrentVersionExpiration x -> NoncurrentVersionExpiration)
-> Generic NoncurrentVersionExpiration
forall x.
Rep NoncurrentVersionExpiration x -> NoncurrentVersionExpiration
forall x.
NoncurrentVersionExpiration -> Rep NoncurrentVersionExpiration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NoncurrentVersionExpiration x -> NoncurrentVersionExpiration
$cfrom :: forall x.
NoncurrentVersionExpiration -> Rep NoncurrentVersionExpiration x
Prelude.Generic)
newNoncurrentVersionExpiration ::
Prelude.Int ->
NoncurrentVersionExpiration
newNoncurrentVersionExpiration :: Int -> NoncurrentVersionExpiration
newNoncurrentVersionExpiration Int
pNoncurrentDays_ =
NoncurrentVersionExpiration' :: Int -> NoncurrentVersionExpiration
NoncurrentVersionExpiration'
{ $sel:noncurrentDays:NoncurrentVersionExpiration' :: Int
noncurrentDays =
Int
pNoncurrentDays_
}
noncurrentVersionExpiration_noncurrentDays :: Lens.Lens' NoncurrentVersionExpiration Prelude.Int
noncurrentVersionExpiration_noncurrentDays :: (Int -> f Int)
-> NoncurrentVersionExpiration -> f NoncurrentVersionExpiration
noncurrentVersionExpiration_noncurrentDays = (NoncurrentVersionExpiration -> Int)
-> (NoncurrentVersionExpiration
-> Int -> NoncurrentVersionExpiration)
-> Lens
NoncurrentVersionExpiration NoncurrentVersionExpiration Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NoncurrentVersionExpiration' {Int
noncurrentDays :: Int
$sel:noncurrentDays:NoncurrentVersionExpiration' :: NoncurrentVersionExpiration -> Int
noncurrentDays} -> Int
noncurrentDays) (\s :: NoncurrentVersionExpiration
s@NoncurrentVersionExpiration' {} Int
a -> NoncurrentVersionExpiration
s {$sel:noncurrentDays:NoncurrentVersionExpiration' :: Int
noncurrentDays = Int
a} :: NoncurrentVersionExpiration)
instance Core.FromXML NoncurrentVersionExpiration where
parseXML :: [Node] -> Either String NoncurrentVersionExpiration
parseXML [Node]
x =
Int -> NoncurrentVersionExpiration
NoncurrentVersionExpiration'
(Int -> NoncurrentVersionExpiration)
-> Either String Int -> Either String NoncurrentVersionExpiration
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")
instance Prelude.Hashable NoncurrentVersionExpiration
instance Prelude.NFData NoncurrentVersionExpiration
instance Core.ToXML NoncurrentVersionExpiration where
toXML :: NoncurrentVersionExpiration -> XML
toXML NoncurrentVersionExpiration' {Int
noncurrentDays :: Int
$sel:noncurrentDays:NoncurrentVersionExpiration' :: NoncurrentVersionExpiration -> 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]