{-# 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.StatusReport where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
data StatusReport = StatusReport'
{
StatusReport -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
StatusReport -> Maybe ISO8601
checkedTime :: Prelude.Maybe Core.ISO8601
}
deriving (StatusReport -> StatusReport -> Bool
(StatusReport -> StatusReport -> Bool)
-> (StatusReport -> StatusReport -> Bool) -> Eq StatusReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatusReport -> StatusReport -> Bool
$c/= :: StatusReport -> StatusReport -> Bool
== :: StatusReport -> StatusReport -> Bool
$c== :: StatusReport -> StatusReport -> Bool
Prelude.Eq, ReadPrec [StatusReport]
ReadPrec StatusReport
Int -> ReadS StatusReport
ReadS [StatusReport]
(Int -> ReadS StatusReport)
-> ReadS [StatusReport]
-> ReadPrec StatusReport
-> ReadPrec [StatusReport]
-> Read StatusReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatusReport]
$creadListPrec :: ReadPrec [StatusReport]
readPrec :: ReadPrec StatusReport
$creadPrec :: ReadPrec StatusReport
readList :: ReadS [StatusReport]
$creadList :: ReadS [StatusReport]
readsPrec :: Int -> ReadS StatusReport
$creadsPrec :: Int -> ReadS StatusReport
Prelude.Read, Int -> StatusReport -> ShowS
[StatusReport] -> ShowS
StatusReport -> String
(Int -> StatusReport -> ShowS)
-> (StatusReport -> String)
-> ([StatusReport] -> ShowS)
-> Show StatusReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatusReport] -> ShowS
$cshowList :: [StatusReport] -> ShowS
show :: StatusReport -> String
$cshow :: StatusReport -> String
showsPrec :: Int -> StatusReport -> ShowS
$cshowsPrec :: Int -> StatusReport -> ShowS
Prelude.Show, (forall x. StatusReport -> Rep StatusReport x)
-> (forall x. Rep StatusReport x -> StatusReport)
-> Generic StatusReport
forall x. Rep StatusReport x -> StatusReport
forall x. StatusReport -> Rep StatusReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatusReport x -> StatusReport
$cfrom :: forall x. StatusReport -> Rep StatusReport x
Prelude.Generic)
newStatusReport ::
StatusReport
newStatusReport :: StatusReport
newStatusReport =
StatusReport' :: Maybe Text -> Maybe ISO8601 -> StatusReport
StatusReport'
{ $sel:status:StatusReport' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:checkedTime:StatusReport' :: Maybe ISO8601
checkedTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
}
statusReport_status :: Lens.Lens' StatusReport (Prelude.Maybe Prelude.Text)
statusReport_status :: (Maybe Text -> f (Maybe Text)) -> StatusReport -> f StatusReport
statusReport_status = (StatusReport -> Maybe Text)
-> (StatusReport -> Maybe Text -> StatusReport)
-> Lens StatusReport StatusReport (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatusReport' {Maybe Text
status :: Maybe Text
$sel:status:StatusReport' :: StatusReport -> Maybe Text
status} -> Maybe Text
status) (\s :: StatusReport
s@StatusReport' {} Maybe Text
a -> StatusReport
s {$sel:status:StatusReport' :: Maybe Text
status = Maybe Text
a} :: StatusReport)
statusReport_checkedTime :: Lens.Lens' StatusReport (Prelude.Maybe Prelude.UTCTime)
statusReport_checkedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StatusReport -> f StatusReport
statusReport_checkedTime = (StatusReport -> Maybe ISO8601)
-> (StatusReport -> Maybe ISO8601 -> StatusReport)
-> Lens StatusReport StatusReport (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatusReport' {Maybe ISO8601
checkedTime :: Maybe ISO8601
$sel:checkedTime:StatusReport' :: StatusReport -> Maybe ISO8601
checkedTime} -> Maybe ISO8601
checkedTime) (\s :: StatusReport
s@StatusReport' {} Maybe ISO8601
a -> StatusReport
s {$sel:checkedTime:StatusReport' :: Maybe ISO8601
checkedTime = Maybe ISO8601
a} :: StatusReport) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> StatusReport -> f StatusReport)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StatusReport
-> f StatusReport
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromXML StatusReport where
parseXML :: [Node] -> Either String StatusReport
parseXML [Node]
x =
Maybe Text -> Maybe ISO8601 -> StatusReport
StatusReport'
(Maybe Text -> Maybe ISO8601 -> StatusReport)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> StatusReport)
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
"Status")
Either String (Maybe ISO8601 -> StatusReport)
-> Either String (Maybe ISO8601) -> Either String StatusReport
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CheckedTime")
instance Prelude.Hashable StatusReport
instance Prelude.NFData StatusReport