{-# 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.IncidentRecordSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.IncidentRecordSource
import Amazonka.SSMIncidents.Types.IncidentRecordStatus
data IncidentRecordSummary = IncidentRecordSummary'
{
IncidentRecordSummary -> Maybe POSIX
resolvedTime :: Prelude.Maybe Core.POSIX,
IncidentRecordSummary -> Text
arn :: Prelude.Text,
IncidentRecordSummary -> POSIX
creationTime :: Core.POSIX,
IncidentRecordSummary -> Natural
impact :: Prelude.Natural,
IncidentRecordSummary -> IncidentRecordSource
incidentRecordSource :: IncidentRecordSource,
IncidentRecordSummary -> IncidentRecordStatus
status :: IncidentRecordStatus,
IncidentRecordSummary -> Text
title :: Prelude.Text
}
deriving (IncidentRecordSummary -> IncidentRecordSummary -> Bool
(IncidentRecordSummary -> IncidentRecordSummary -> Bool)
-> (IncidentRecordSummary -> IncidentRecordSummary -> Bool)
-> Eq IncidentRecordSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IncidentRecordSummary -> IncidentRecordSummary -> Bool
$c/= :: IncidentRecordSummary -> IncidentRecordSummary -> Bool
== :: IncidentRecordSummary -> IncidentRecordSummary -> Bool
$c== :: IncidentRecordSummary -> IncidentRecordSummary -> Bool
Prelude.Eq, ReadPrec [IncidentRecordSummary]
ReadPrec IncidentRecordSummary
Int -> ReadS IncidentRecordSummary
ReadS [IncidentRecordSummary]
(Int -> ReadS IncidentRecordSummary)
-> ReadS [IncidentRecordSummary]
-> ReadPrec IncidentRecordSummary
-> ReadPrec [IncidentRecordSummary]
-> Read IncidentRecordSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IncidentRecordSummary]
$creadListPrec :: ReadPrec [IncidentRecordSummary]
readPrec :: ReadPrec IncidentRecordSummary
$creadPrec :: ReadPrec IncidentRecordSummary
readList :: ReadS [IncidentRecordSummary]
$creadList :: ReadS [IncidentRecordSummary]
readsPrec :: Int -> ReadS IncidentRecordSummary
$creadsPrec :: Int -> ReadS IncidentRecordSummary
Prelude.Read, Int -> IncidentRecordSummary -> ShowS
[IncidentRecordSummary] -> ShowS
IncidentRecordSummary -> String
(Int -> IncidentRecordSummary -> ShowS)
-> (IncidentRecordSummary -> String)
-> ([IncidentRecordSummary] -> ShowS)
-> Show IncidentRecordSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IncidentRecordSummary] -> ShowS
$cshowList :: [IncidentRecordSummary] -> ShowS
show :: IncidentRecordSummary -> String
$cshow :: IncidentRecordSummary -> String
showsPrec :: Int -> IncidentRecordSummary -> ShowS
$cshowsPrec :: Int -> IncidentRecordSummary -> ShowS
Prelude.Show, (forall x. IncidentRecordSummary -> Rep IncidentRecordSummary x)
-> (forall x. Rep IncidentRecordSummary x -> IncidentRecordSummary)
-> Generic IncidentRecordSummary
forall x. Rep IncidentRecordSummary x -> IncidentRecordSummary
forall x. IncidentRecordSummary -> Rep IncidentRecordSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IncidentRecordSummary x -> IncidentRecordSummary
$cfrom :: forall x. IncidentRecordSummary -> Rep IncidentRecordSummary x
Prelude.Generic)
newIncidentRecordSummary ::
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Natural ->
IncidentRecordSource ->
IncidentRecordStatus ->
Prelude.Text ->
IncidentRecordSummary
newIncidentRecordSummary :: Text
-> UTCTime
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary
newIncidentRecordSummary
Text
pArn_
UTCTime
pCreationTime_
Natural
pImpact_
IncidentRecordSource
pIncidentRecordSource_
IncidentRecordStatus
pStatus_
Text
pTitle_ =
IncidentRecordSummary' :: Maybe POSIX
-> Text
-> POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary
IncidentRecordSummary'
{ $sel:resolvedTime:IncidentRecordSummary' :: Maybe POSIX
resolvedTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:arn:IncidentRecordSummary' :: Text
arn = Text
pArn_,
$sel:creationTime:IncidentRecordSummary' :: POSIX
creationTime = 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
pCreationTime_,
$sel:impact:IncidentRecordSummary' :: Natural
impact = Natural
pImpact_,
$sel:incidentRecordSource:IncidentRecordSummary' :: IncidentRecordSource
incidentRecordSource = IncidentRecordSource
pIncidentRecordSource_,
$sel:status:IncidentRecordSummary' :: IncidentRecordStatus
status = IncidentRecordStatus
pStatus_,
$sel:title:IncidentRecordSummary' :: Text
title = Text
pTitle_
}
incidentRecordSummary_resolvedTime :: Lens.Lens' IncidentRecordSummary (Prelude.Maybe Prelude.UTCTime)
incidentRecordSummary_resolvedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_resolvedTime = (IncidentRecordSummary -> Maybe POSIX)
-> (IncidentRecordSummary -> Maybe POSIX -> IncidentRecordSummary)
-> Lens
IncidentRecordSummary
IncidentRecordSummary
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {Maybe POSIX
resolvedTime :: Maybe POSIX
$sel:resolvedTime:IncidentRecordSummary' :: IncidentRecordSummary -> Maybe POSIX
resolvedTime} -> Maybe POSIX
resolvedTime) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} Maybe POSIX
a -> IncidentRecordSummary
s {$sel:resolvedTime:IncidentRecordSummary' :: Maybe POSIX
resolvedTime = Maybe POSIX
a} :: IncidentRecordSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> IncidentRecordSummary -> f IncidentRecordSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> IncidentRecordSummary
-> f IncidentRecordSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
incidentRecordSummary_arn :: Lens.Lens' IncidentRecordSummary Prelude.Text
incidentRecordSummary_arn :: (Text -> f Text)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_arn = (IncidentRecordSummary -> Text)
-> (IncidentRecordSummary -> Text -> IncidentRecordSummary)
-> Lens IncidentRecordSummary IncidentRecordSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {Text
arn :: Text
$sel:arn:IncidentRecordSummary' :: IncidentRecordSummary -> Text
arn} -> Text
arn) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} Text
a -> IncidentRecordSummary
s {$sel:arn:IncidentRecordSummary' :: Text
arn = Text
a} :: IncidentRecordSummary)
incidentRecordSummary_creationTime :: Lens.Lens' IncidentRecordSummary Prelude.UTCTime
incidentRecordSummary_creationTime :: (UTCTime -> f UTCTime)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_creationTime = (IncidentRecordSummary -> POSIX)
-> (IncidentRecordSummary -> POSIX -> IncidentRecordSummary)
-> Lens IncidentRecordSummary IncidentRecordSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:IncidentRecordSummary' :: IncidentRecordSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} POSIX
a -> IncidentRecordSummary
s {$sel:creationTime:IncidentRecordSummary' :: POSIX
creationTime = POSIX
a} :: IncidentRecordSummary) ((POSIX -> f POSIX)
-> IncidentRecordSummary -> f IncidentRecordSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> IncidentRecordSummary
-> f IncidentRecordSummary
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
incidentRecordSummary_impact :: Lens.Lens' IncidentRecordSummary Prelude.Natural
incidentRecordSummary_impact :: (Natural -> f Natural)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_impact = (IncidentRecordSummary -> Natural)
-> (IncidentRecordSummary -> Natural -> IncidentRecordSummary)
-> Lens IncidentRecordSummary IncidentRecordSummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {Natural
impact :: Natural
$sel:impact:IncidentRecordSummary' :: IncidentRecordSummary -> Natural
impact} -> Natural
impact) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} Natural
a -> IncidentRecordSummary
s {$sel:impact:IncidentRecordSummary' :: Natural
impact = Natural
a} :: IncidentRecordSummary)
incidentRecordSummary_incidentRecordSource :: Lens.Lens' IncidentRecordSummary IncidentRecordSource
incidentRecordSummary_incidentRecordSource :: (IncidentRecordSource -> f IncidentRecordSource)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_incidentRecordSource = (IncidentRecordSummary -> IncidentRecordSource)
-> (IncidentRecordSummary
-> IncidentRecordSource -> IncidentRecordSummary)
-> Lens
IncidentRecordSummary
IncidentRecordSummary
IncidentRecordSource
IncidentRecordSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {IncidentRecordSource
incidentRecordSource :: IncidentRecordSource
$sel:incidentRecordSource:IncidentRecordSummary' :: IncidentRecordSummary -> IncidentRecordSource
incidentRecordSource} -> IncidentRecordSource
incidentRecordSource) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} IncidentRecordSource
a -> IncidentRecordSummary
s {$sel:incidentRecordSource:IncidentRecordSummary' :: IncidentRecordSource
incidentRecordSource = IncidentRecordSource
a} :: IncidentRecordSummary)
incidentRecordSummary_status :: Lens.Lens' IncidentRecordSummary IncidentRecordStatus
incidentRecordSummary_status :: (IncidentRecordStatus -> f IncidentRecordStatus)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_status = (IncidentRecordSummary -> IncidentRecordStatus)
-> (IncidentRecordSummary
-> IncidentRecordStatus -> IncidentRecordSummary)
-> Lens
IncidentRecordSummary
IncidentRecordSummary
IncidentRecordStatus
IncidentRecordStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {IncidentRecordStatus
status :: IncidentRecordStatus
$sel:status:IncidentRecordSummary' :: IncidentRecordSummary -> IncidentRecordStatus
status} -> IncidentRecordStatus
status) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} IncidentRecordStatus
a -> IncidentRecordSummary
s {$sel:status:IncidentRecordSummary' :: IncidentRecordStatus
status = IncidentRecordStatus
a} :: IncidentRecordSummary)
incidentRecordSummary_title :: Lens.Lens' IncidentRecordSummary Prelude.Text
incidentRecordSummary_title :: (Text -> f Text)
-> IncidentRecordSummary -> f IncidentRecordSummary
incidentRecordSummary_title = (IncidentRecordSummary -> Text)
-> (IncidentRecordSummary -> Text -> IncidentRecordSummary)
-> Lens IncidentRecordSummary IncidentRecordSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSummary' {Text
title :: Text
$sel:title:IncidentRecordSummary' :: IncidentRecordSummary -> Text
title} -> Text
title) (\s :: IncidentRecordSummary
s@IncidentRecordSummary' {} Text
a -> IncidentRecordSummary
s {$sel:title:IncidentRecordSummary' :: Text
title = Text
a} :: IncidentRecordSummary)
instance Core.FromJSON IncidentRecordSummary where
parseJSON :: Value -> Parser IncidentRecordSummary
parseJSON =
String
-> (Object -> Parser IncidentRecordSummary)
-> Value
-> Parser IncidentRecordSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IncidentRecordSummary"
( \Object
x ->
Maybe POSIX
-> Text
-> POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary
IncidentRecordSummary'
(Maybe POSIX
-> Text
-> POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
-> Parser (Maybe POSIX)
-> Parser
(Text
-> POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resolvedTime")
Parser
(Text
-> POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
-> Parser Text
-> Parser
(POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
Parser
(POSIX
-> Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
-> Parser POSIX
-> Parser
(Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
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
"creationTime")
Parser
(Natural
-> IncidentRecordSource
-> IncidentRecordStatus
-> Text
-> IncidentRecordSummary)
-> Parser Natural
-> Parser
(IncidentRecordSource
-> IncidentRecordStatus -> Text -> IncidentRecordSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"impact")
Parser
(IncidentRecordSource
-> IncidentRecordStatus -> Text -> IncidentRecordSummary)
-> Parser IncidentRecordSource
-> Parser (IncidentRecordStatus -> Text -> IncidentRecordSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser IncidentRecordSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"incidentRecordSource")
Parser (IncidentRecordStatus -> Text -> IncidentRecordSummary)
-> Parser IncidentRecordStatus
-> Parser (Text -> IncidentRecordSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser IncidentRecordStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser (Text -> IncidentRecordSummary)
-> Parser Text -> Parser IncidentRecordSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"title")
)
instance Prelude.Hashable IncidentRecordSummary
instance Prelude.NFData IncidentRecordSummary