{-# 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.Route53.Types.ChangeInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.ChangeStatus
data ChangeInfo = ChangeInfo'
{
:: Prelude.Maybe Prelude.Text,
ChangeInfo -> ResourceId
id :: ResourceId,
ChangeInfo -> ChangeStatus
status :: ChangeStatus,
ChangeInfo -> ISO8601
submittedAt :: Core.ISO8601
}
deriving (ChangeInfo -> ChangeInfo -> Bool
(ChangeInfo -> ChangeInfo -> Bool)
-> (ChangeInfo -> ChangeInfo -> Bool) -> Eq ChangeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeInfo -> ChangeInfo -> Bool
$c/= :: ChangeInfo -> ChangeInfo -> Bool
== :: ChangeInfo -> ChangeInfo -> Bool
$c== :: ChangeInfo -> ChangeInfo -> Bool
Prelude.Eq, ReadPrec [ChangeInfo]
ReadPrec ChangeInfo
Int -> ReadS ChangeInfo
ReadS [ChangeInfo]
(Int -> ReadS ChangeInfo)
-> ReadS [ChangeInfo]
-> ReadPrec ChangeInfo
-> ReadPrec [ChangeInfo]
-> Read ChangeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeInfo]
$creadListPrec :: ReadPrec [ChangeInfo]
readPrec :: ReadPrec ChangeInfo
$creadPrec :: ReadPrec ChangeInfo
readList :: ReadS [ChangeInfo]
$creadList :: ReadS [ChangeInfo]
readsPrec :: Int -> ReadS ChangeInfo
$creadsPrec :: Int -> ReadS ChangeInfo
Prelude.Read, Int -> ChangeInfo -> ShowS
[ChangeInfo] -> ShowS
ChangeInfo -> String
(Int -> ChangeInfo -> ShowS)
-> (ChangeInfo -> String)
-> ([ChangeInfo] -> ShowS)
-> Show ChangeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeInfo] -> ShowS
$cshowList :: [ChangeInfo] -> ShowS
show :: ChangeInfo -> String
$cshow :: ChangeInfo -> String
showsPrec :: Int -> ChangeInfo -> ShowS
$cshowsPrec :: Int -> ChangeInfo -> ShowS
Prelude.Show, (forall x. ChangeInfo -> Rep ChangeInfo x)
-> (forall x. Rep ChangeInfo x -> ChangeInfo) -> Generic ChangeInfo
forall x. Rep ChangeInfo x -> ChangeInfo
forall x. ChangeInfo -> Rep ChangeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChangeInfo x -> ChangeInfo
$cfrom :: forall x. ChangeInfo -> Rep ChangeInfo x
Prelude.Generic)
newChangeInfo ::
ResourceId ->
ChangeStatus ->
Prelude.UTCTime ->
ChangeInfo
newChangeInfo :: ResourceId -> ChangeStatus -> UTCTime -> ChangeInfo
newChangeInfo ResourceId
pId_ ChangeStatus
pStatus_ UTCTime
pSubmittedAt_ =
ChangeInfo' :: Maybe Text -> ResourceId -> ChangeStatus -> ISO8601 -> ChangeInfo
ChangeInfo'
{ $sel:comment:ChangeInfo' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ChangeInfo' :: ResourceId
id = ResourceId
pId_,
$sel:status:ChangeInfo' :: ChangeStatus
status = ChangeStatus
pStatus_,
$sel:submittedAt:ChangeInfo' :: ISO8601
submittedAt = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pSubmittedAt_
}
changeInfo_comment :: Lens.Lens' ChangeInfo (Prelude.Maybe Prelude.Text)
= (ChangeInfo -> Maybe Text)
-> (ChangeInfo -> Maybe Text -> ChangeInfo)
-> Lens ChangeInfo ChangeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeInfo' {Maybe Text
comment :: Maybe Text
$sel:comment:ChangeInfo' :: ChangeInfo -> Maybe Text
comment} -> Maybe Text
comment) (\s :: ChangeInfo
s@ChangeInfo' {} Maybe Text
a -> ChangeInfo
s {$sel:comment:ChangeInfo' :: Maybe Text
comment = Maybe Text
a} :: ChangeInfo)
changeInfo_id :: Lens.Lens' ChangeInfo ResourceId
changeInfo_id :: (ResourceId -> f ResourceId) -> ChangeInfo -> f ChangeInfo
changeInfo_id = (ChangeInfo -> ResourceId)
-> (ChangeInfo -> ResourceId -> ChangeInfo)
-> Lens ChangeInfo ChangeInfo ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeInfo' {ResourceId
id :: ResourceId
$sel:id:ChangeInfo' :: ChangeInfo -> ResourceId
id} -> ResourceId
id) (\s :: ChangeInfo
s@ChangeInfo' {} ResourceId
a -> ChangeInfo
s {$sel:id:ChangeInfo' :: ResourceId
id = ResourceId
a} :: ChangeInfo)
changeInfo_status :: Lens.Lens' ChangeInfo ChangeStatus
changeInfo_status :: (ChangeStatus -> f ChangeStatus) -> ChangeInfo -> f ChangeInfo
changeInfo_status = (ChangeInfo -> ChangeStatus)
-> (ChangeInfo -> ChangeStatus -> ChangeInfo)
-> Lens ChangeInfo ChangeInfo ChangeStatus ChangeStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeInfo' {ChangeStatus
status :: ChangeStatus
$sel:status:ChangeInfo' :: ChangeInfo -> ChangeStatus
status} -> ChangeStatus
status) (\s :: ChangeInfo
s@ChangeInfo' {} ChangeStatus
a -> ChangeInfo
s {$sel:status:ChangeInfo' :: ChangeStatus
status = ChangeStatus
a} :: ChangeInfo)
changeInfo_submittedAt :: Lens.Lens' ChangeInfo Prelude.UTCTime
changeInfo_submittedAt :: (UTCTime -> f UTCTime) -> ChangeInfo -> f ChangeInfo
changeInfo_submittedAt = (ChangeInfo -> ISO8601)
-> (ChangeInfo -> ISO8601 -> ChangeInfo)
-> Lens ChangeInfo ChangeInfo ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeInfo' {ISO8601
submittedAt :: ISO8601
$sel:submittedAt:ChangeInfo' :: ChangeInfo -> ISO8601
submittedAt} -> ISO8601
submittedAt) (\s :: ChangeInfo
s@ChangeInfo' {} ISO8601
a -> ChangeInfo
s {$sel:submittedAt:ChangeInfo' :: ISO8601
submittedAt = ISO8601
a} :: ChangeInfo) ((ISO8601 -> f ISO8601) -> ChangeInfo -> f ChangeInfo)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> ChangeInfo
-> f ChangeInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromXML ChangeInfo where
parseXML :: [Node] -> Either String ChangeInfo
parseXML [Node]
x =
Maybe Text -> ResourceId -> ChangeStatus -> ISO8601 -> ChangeInfo
ChangeInfo'
(Maybe Text -> ResourceId -> ChangeStatus -> ISO8601 -> ChangeInfo)
-> Either String (Maybe Text)
-> Either
String (ResourceId -> ChangeStatus -> ISO8601 -> ChangeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Comment")
Either String (ResourceId -> ChangeStatus -> ISO8601 -> ChangeInfo)
-> Either String ResourceId
-> Either String (ChangeStatus -> ISO8601 -> ChangeInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ResourceId
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Id")
Either String (ChangeStatus -> ISO8601 -> ChangeInfo)
-> Either String ChangeStatus
-> Either String (ISO8601 -> ChangeInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ChangeStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
Either String (ISO8601 -> ChangeInfo)
-> Either String ISO8601 -> Either String ChangeInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"SubmittedAt")
instance Prelude.Hashable ChangeInfo
instance Prelude.NFData ChangeInfo