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