{-# 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.SSMIncidents.Types.RegionInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.RegionStatus
data RegionInfo = RegionInfo'
{
RegionInfo -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
RegionInfo -> Maybe Text
sseKmsKeyId :: Prelude.Maybe Prelude.Text,
RegionInfo -> RegionStatus
status :: RegionStatus,
RegionInfo -> POSIX
statusUpdateDateTime :: Core.POSIX
}
deriving (RegionInfo -> RegionInfo -> Bool
(RegionInfo -> RegionInfo -> Bool)
-> (RegionInfo -> RegionInfo -> Bool) -> Eq RegionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegionInfo -> RegionInfo -> Bool
$c/= :: RegionInfo -> RegionInfo -> Bool
== :: RegionInfo -> RegionInfo -> Bool
$c== :: RegionInfo -> RegionInfo -> Bool
Prelude.Eq, ReadPrec [RegionInfo]
ReadPrec RegionInfo
Int -> ReadS RegionInfo
ReadS [RegionInfo]
(Int -> ReadS RegionInfo)
-> ReadS [RegionInfo]
-> ReadPrec RegionInfo
-> ReadPrec [RegionInfo]
-> Read RegionInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegionInfo]
$creadListPrec :: ReadPrec [RegionInfo]
readPrec :: ReadPrec RegionInfo
$creadPrec :: ReadPrec RegionInfo
readList :: ReadS [RegionInfo]
$creadList :: ReadS [RegionInfo]
readsPrec :: Int -> ReadS RegionInfo
$creadsPrec :: Int -> ReadS RegionInfo
Prelude.Read, Int -> RegionInfo -> ShowS
[RegionInfo] -> ShowS
RegionInfo -> String
(Int -> RegionInfo -> ShowS)
-> (RegionInfo -> String)
-> ([RegionInfo] -> ShowS)
-> Show RegionInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegionInfo] -> ShowS
$cshowList :: [RegionInfo] -> ShowS
show :: RegionInfo -> String
$cshow :: RegionInfo -> String
showsPrec :: Int -> RegionInfo -> ShowS
$cshowsPrec :: Int -> RegionInfo -> ShowS
Prelude.Show, (forall x. RegionInfo -> Rep RegionInfo x)
-> (forall x. Rep RegionInfo x -> RegionInfo) -> Generic RegionInfo
forall x. Rep RegionInfo x -> RegionInfo
forall x. RegionInfo -> Rep RegionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegionInfo x -> RegionInfo
$cfrom :: forall x. RegionInfo -> Rep RegionInfo x
Prelude.Generic)
newRegionInfo ::
RegionStatus ->
Prelude.UTCTime ->
RegionInfo
newRegionInfo :: RegionStatus -> UTCTime -> RegionInfo
newRegionInfo RegionStatus
pStatus_ UTCTime
pStatusUpdateDateTime_ =
RegionInfo' :: Maybe Text -> Maybe Text -> RegionStatus -> POSIX -> RegionInfo
RegionInfo'
{ $sel:statusMessage:RegionInfo' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sseKmsKeyId:RegionInfo' :: Maybe Text
sseKmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:RegionInfo' :: RegionStatus
status = RegionStatus
pStatus_,
$sel:statusUpdateDateTime:RegionInfo' :: POSIX
statusUpdateDateTime =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStatusUpdateDateTime_
}
regionInfo_statusMessage :: Lens.Lens' RegionInfo (Prelude.Maybe Prelude.Text)
regionInfo_statusMessage :: (Maybe Text -> f (Maybe Text)) -> RegionInfo -> f RegionInfo
regionInfo_statusMessage = (RegionInfo -> Maybe Text)
-> (RegionInfo -> Maybe Text -> RegionInfo)
-> Lens RegionInfo RegionInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionInfo' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:RegionInfo' :: RegionInfo -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: RegionInfo
s@RegionInfo' {} Maybe Text
a -> RegionInfo
s {$sel:statusMessage:RegionInfo' :: Maybe Text
statusMessage = Maybe Text
a} :: RegionInfo)
regionInfo_sseKmsKeyId :: Lens.Lens' RegionInfo (Prelude.Maybe Prelude.Text)
regionInfo_sseKmsKeyId :: (Maybe Text -> f (Maybe Text)) -> RegionInfo -> f RegionInfo
regionInfo_sseKmsKeyId = (RegionInfo -> Maybe Text)
-> (RegionInfo -> Maybe Text -> RegionInfo)
-> Lens RegionInfo RegionInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionInfo' {Maybe Text
sseKmsKeyId :: Maybe Text
$sel:sseKmsKeyId:RegionInfo' :: RegionInfo -> Maybe Text
sseKmsKeyId} -> Maybe Text
sseKmsKeyId) (\s :: RegionInfo
s@RegionInfo' {} Maybe Text
a -> RegionInfo
s {$sel:sseKmsKeyId:RegionInfo' :: Maybe Text
sseKmsKeyId = Maybe Text
a} :: RegionInfo)
regionInfo_status :: Lens.Lens' RegionInfo RegionStatus
regionInfo_status :: (RegionStatus -> f RegionStatus) -> RegionInfo -> f RegionInfo
regionInfo_status = (RegionInfo -> RegionStatus)
-> (RegionInfo -> RegionStatus -> RegionInfo)
-> Lens RegionInfo RegionInfo RegionStatus RegionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionInfo' {RegionStatus
status :: RegionStatus
$sel:status:RegionInfo' :: RegionInfo -> RegionStatus
status} -> RegionStatus
status) (\s :: RegionInfo
s@RegionInfo' {} RegionStatus
a -> RegionInfo
s {$sel:status:RegionInfo' :: RegionStatus
status = RegionStatus
a} :: RegionInfo)
regionInfo_statusUpdateDateTime :: Lens.Lens' RegionInfo Prelude.UTCTime
regionInfo_statusUpdateDateTime :: (UTCTime -> f UTCTime) -> RegionInfo -> f RegionInfo
regionInfo_statusUpdateDateTime = (RegionInfo -> POSIX)
-> (RegionInfo -> POSIX -> RegionInfo)
-> Lens RegionInfo RegionInfo POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionInfo' {POSIX
statusUpdateDateTime :: POSIX
$sel:statusUpdateDateTime:RegionInfo' :: RegionInfo -> POSIX
statusUpdateDateTime} -> POSIX
statusUpdateDateTime) (\s :: RegionInfo
s@RegionInfo' {} POSIX
a -> RegionInfo
s {$sel:statusUpdateDateTime:RegionInfo' :: POSIX
statusUpdateDateTime = POSIX
a} :: RegionInfo) ((POSIX -> f POSIX) -> RegionInfo -> f RegionInfo)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> RegionInfo
-> f RegionInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON RegionInfo where
parseJSON :: Value -> Parser RegionInfo
parseJSON =
String
-> (Object -> Parser RegionInfo) -> Value -> Parser RegionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RegionInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> RegionStatus -> POSIX -> RegionInfo
RegionInfo'
(Maybe Text -> Maybe Text -> RegionStatus -> POSIX -> RegionInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RegionStatus -> POSIX -> RegionInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusMessage")
Parser (Maybe Text -> RegionStatus -> POSIX -> RegionInfo)
-> Parser (Maybe Text)
-> Parser (RegionStatus -> POSIX -> RegionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sseKmsKeyId")
Parser (RegionStatus -> POSIX -> RegionInfo)
-> Parser RegionStatus -> Parser (POSIX -> RegionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RegionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser (POSIX -> RegionInfo) -> Parser POSIX -> Parser RegionInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"statusUpdateDateTime")
)
instance Prelude.Hashable RegionInfo
instance Prelude.NFData RegionInfo