{-# 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.ReplicationTime 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.ReplicationTimeStatus
import Amazonka.S3.Types.ReplicationTimeValue
data ReplicationTime = ReplicationTime'
{
ReplicationTime -> ReplicationTimeStatus
status :: ReplicationTimeStatus,
ReplicationTime -> ReplicationTimeValue
time :: ReplicationTimeValue
}
deriving (ReplicationTime -> ReplicationTime -> Bool
(ReplicationTime -> ReplicationTime -> Bool)
-> (ReplicationTime -> ReplicationTime -> Bool)
-> Eq ReplicationTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationTime -> ReplicationTime -> Bool
$c/= :: ReplicationTime -> ReplicationTime -> Bool
== :: ReplicationTime -> ReplicationTime -> Bool
$c== :: ReplicationTime -> ReplicationTime -> Bool
Prelude.Eq, ReadPrec [ReplicationTime]
ReadPrec ReplicationTime
Int -> ReadS ReplicationTime
ReadS [ReplicationTime]
(Int -> ReadS ReplicationTime)
-> ReadS [ReplicationTime]
-> ReadPrec ReplicationTime
-> ReadPrec [ReplicationTime]
-> Read ReplicationTime
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationTime]
$creadListPrec :: ReadPrec [ReplicationTime]
readPrec :: ReadPrec ReplicationTime
$creadPrec :: ReadPrec ReplicationTime
readList :: ReadS [ReplicationTime]
$creadList :: ReadS [ReplicationTime]
readsPrec :: Int -> ReadS ReplicationTime
$creadsPrec :: Int -> ReadS ReplicationTime
Prelude.Read, Int -> ReplicationTime -> ShowS
[ReplicationTime] -> ShowS
ReplicationTime -> String
(Int -> ReplicationTime -> ShowS)
-> (ReplicationTime -> String)
-> ([ReplicationTime] -> ShowS)
-> Show ReplicationTime
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationTime] -> ShowS
$cshowList :: [ReplicationTime] -> ShowS
show :: ReplicationTime -> String
$cshow :: ReplicationTime -> String
showsPrec :: Int -> ReplicationTime -> ShowS
$cshowsPrec :: Int -> ReplicationTime -> ShowS
Prelude.Show, (forall x. ReplicationTime -> Rep ReplicationTime x)
-> (forall x. Rep ReplicationTime x -> ReplicationTime)
-> Generic ReplicationTime
forall x. Rep ReplicationTime x -> ReplicationTime
forall x. ReplicationTime -> Rep ReplicationTime x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationTime x -> ReplicationTime
$cfrom :: forall x. ReplicationTime -> Rep ReplicationTime x
Prelude.Generic)
newReplicationTime ::
ReplicationTimeStatus ->
ReplicationTimeValue ->
ReplicationTime
newReplicationTime :: ReplicationTimeStatus -> ReplicationTimeValue -> ReplicationTime
newReplicationTime ReplicationTimeStatus
pStatus_ ReplicationTimeValue
pTime_ =
ReplicationTime' :: ReplicationTimeStatus -> ReplicationTimeValue -> ReplicationTime
ReplicationTime' {$sel:status:ReplicationTime' :: ReplicationTimeStatus
status = ReplicationTimeStatus
pStatus_, $sel:time:ReplicationTime' :: ReplicationTimeValue
time = ReplicationTimeValue
pTime_}
replicationTime_status :: Lens.Lens' ReplicationTime ReplicationTimeStatus
replicationTime_status :: (ReplicationTimeStatus -> f ReplicationTimeStatus)
-> ReplicationTime -> f ReplicationTime
replicationTime_status = (ReplicationTime -> ReplicationTimeStatus)
-> (ReplicationTime -> ReplicationTimeStatus -> ReplicationTime)
-> Lens
ReplicationTime
ReplicationTime
ReplicationTimeStatus
ReplicationTimeStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTime' {ReplicationTimeStatus
status :: ReplicationTimeStatus
$sel:status:ReplicationTime' :: ReplicationTime -> ReplicationTimeStatus
status} -> ReplicationTimeStatus
status) (\s :: ReplicationTime
s@ReplicationTime' {} ReplicationTimeStatus
a -> ReplicationTime
s {$sel:status:ReplicationTime' :: ReplicationTimeStatus
status = ReplicationTimeStatus
a} :: ReplicationTime)
replicationTime_time :: Lens.Lens' ReplicationTime ReplicationTimeValue
replicationTime_time :: (ReplicationTimeValue -> f ReplicationTimeValue)
-> ReplicationTime -> f ReplicationTime
replicationTime_time = (ReplicationTime -> ReplicationTimeValue)
-> (ReplicationTime -> ReplicationTimeValue -> ReplicationTime)
-> Lens
ReplicationTime
ReplicationTime
ReplicationTimeValue
ReplicationTimeValue
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationTime' {ReplicationTimeValue
time :: ReplicationTimeValue
$sel:time:ReplicationTime' :: ReplicationTime -> ReplicationTimeValue
time} -> ReplicationTimeValue
time) (\s :: ReplicationTime
s@ReplicationTime' {} ReplicationTimeValue
a -> ReplicationTime
s {$sel:time:ReplicationTime' :: ReplicationTimeValue
time = ReplicationTimeValue
a} :: ReplicationTime)
instance Core.FromXML ReplicationTime where
parseXML :: [Node] -> Either String ReplicationTime
parseXML [Node]
x =
ReplicationTimeStatus -> ReplicationTimeValue -> ReplicationTime
ReplicationTime'
(ReplicationTimeStatus -> ReplicationTimeValue -> ReplicationTime)
-> Either String ReplicationTimeStatus
-> Either String (ReplicationTimeValue -> ReplicationTime)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String ReplicationTimeStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status") Either String (ReplicationTimeValue -> ReplicationTime)
-> Either String ReplicationTimeValue
-> Either String ReplicationTime
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ReplicationTimeValue
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Time")
instance Prelude.Hashable ReplicationTime
instance Prelude.NFData ReplicationTime
instance Core.ToXML ReplicationTime where
toXML :: ReplicationTime -> XML
toXML ReplicationTime' {ReplicationTimeStatus
ReplicationTimeValue
time :: ReplicationTimeValue
status :: ReplicationTimeStatus
$sel:time:ReplicationTime' :: ReplicationTime -> ReplicationTimeValue
$sel:status:ReplicationTime' :: ReplicationTime -> ReplicationTimeStatus
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[Name
"Status" Name -> ReplicationTimeStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ReplicationTimeStatus
status, Name
"Time" Name -> ReplicationTimeValue -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ReplicationTimeValue
time]