{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSMIncidents.Types.IncidentRecord
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.IncidentRecord where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.AutomationExecution
import Amazonka.SSMIncidents.Types.ChatChannel
import Amazonka.SSMIncidents.Types.IncidentRecordSource
import Amazonka.SSMIncidents.Types.IncidentRecordStatus
import Amazonka.SSMIncidents.Types.NotificationTargetItem

-- | The record of the incident that\'s created when an incident occurs.
--
-- /See:/ 'newIncidentRecord' smart constructor.
data IncidentRecord = IncidentRecord'
  { -- | The summary of the incident. The summary is a brief synopsis of what
    -- occurred, what is currently happening, and context.
    IncidentRecord -> Maybe Text
summary :: Prelude.Maybe Prelude.Text,
    -- | The SNS targets that are notified when updates are made to an incident.
    IncidentRecord -> Maybe [NotificationTargetItem]
notificationTargets :: Prelude.Maybe [NotificationTargetItem],
    -- | The time at which the incident was resolved. This appears as a timeline
    -- event.
    IncidentRecord -> Maybe POSIX
resolvedTime :: Prelude.Maybe Core.POSIX,
    -- | The chat channel used for collaboration during an incident.
    IncidentRecord -> Maybe ChatChannel
chatChannel :: Prelude.Maybe ChatChannel,
    -- | The runbook, or automation document, that\'s run at the beginning of the
    -- incident.
    IncidentRecord -> Maybe [AutomationExecution]
automationExecutions :: Prelude.Maybe [AutomationExecution],
    -- | The Amazon Resource Name (ARN) of the incident record.
    IncidentRecord -> Text
arn :: Prelude.Text,
    -- | The time that Incident Manager created the incident record.
    IncidentRecord -> POSIX
creationTime :: Core.POSIX,
    -- | The string Incident Manager uses to prevent duplicate incidents from
    -- being created by the same incident.
    IncidentRecord -> Text
dedupeString :: Prelude.Text,
    -- | The impact of the incident on customers and applications.
    IncidentRecord -> Natural
impact :: Prelude.Natural,
    -- | Details about the action that started the incident.
    IncidentRecord -> IncidentRecordSource
incidentRecordSource :: IncidentRecordSource,
    -- | Who modified the incident most recently.
    IncidentRecord -> Text
lastModifiedBy :: Prelude.Text,
    -- | The time at which the incident was most recently modified.
    IncidentRecord -> POSIX
lastModifiedTime :: Core.POSIX,
    -- | The current status of the incident.
    IncidentRecord -> IncidentRecordStatus
status :: IncidentRecordStatus,
    -- | The title of the incident.
    IncidentRecord -> Text
title :: Prelude.Text
  }
  deriving (IncidentRecord -> IncidentRecord -> Bool
(IncidentRecord -> IncidentRecord -> Bool)
-> (IncidentRecord -> IncidentRecord -> Bool) -> Eq IncidentRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IncidentRecord -> IncidentRecord -> Bool
$c/= :: IncidentRecord -> IncidentRecord -> Bool
== :: IncidentRecord -> IncidentRecord -> Bool
$c== :: IncidentRecord -> IncidentRecord -> Bool
Prelude.Eq, ReadPrec [IncidentRecord]
ReadPrec IncidentRecord
Int -> ReadS IncidentRecord
ReadS [IncidentRecord]
(Int -> ReadS IncidentRecord)
-> ReadS [IncidentRecord]
-> ReadPrec IncidentRecord
-> ReadPrec [IncidentRecord]
-> Read IncidentRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IncidentRecord]
$creadListPrec :: ReadPrec [IncidentRecord]
readPrec :: ReadPrec IncidentRecord
$creadPrec :: ReadPrec IncidentRecord
readList :: ReadS [IncidentRecord]
$creadList :: ReadS [IncidentRecord]
readsPrec :: Int -> ReadS IncidentRecord
$creadsPrec :: Int -> ReadS IncidentRecord
Prelude.Read, Int -> IncidentRecord -> ShowS
[IncidentRecord] -> ShowS
IncidentRecord -> String
(Int -> IncidentRecord -> ShowS)
-> (IncidentRecord -> String)
-> ([IncidentRecord] -> ShowS)
-> Show IncidentRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IncidentRecord] -> ShowS
$cshowList :: [IncidentRecord] -> ShowS
show :: IncidentRecord -> String
$cshow :: IncidentRecord -> String
showsPrec :: Int -> IncidentRecord -> ShowS
$cshowsPrec :: Int -> IncidentRecord -> ShowS
Prelude.Show, (forall x. IncidentRecord -> Rep IncidentRecord x)
-> (forall x. Rep IncidentRecord x -> IncidentRecord)
-> Generic IncidentRecord
forall x. Rep IncidentRecord x -> IncidentRecord
forall x. IncidentRecord -> Rep IncidentRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IncidentRecord x -> IncidentRecord
$cfrom :: forall x. IncidentRecord -> Rep IncidentRecord x
Prelude.Generic)

-- |
-- Create a value of 'IncidentRecord' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'summary', 'incidentRecord_summary' - The summary of the incident. The summary is a brief synopsis of what
-- occurred, what is currently happening, and context.
--
-- 'notificationTargets', 'incidentRecord_notificationTargets' - The SNS targets that are notified when updates are made to an incident.
--
-- 'resolvedTime', 'incidentRecord_resolvedTime' - The time at which the incident was resolved. This appears as a timeline
-- event.
--
-- 'chatChannel', 'incidentRecord_chatChannel' - The chat channel used for collaboration during an incident.
--
-- 'automationExecutions', 'incidentRecord_automationExecutions' - The runbook, or automation document, that\'s run at the beginning of the
-- incident.
--
-- 'arn', 'incidentRecord_arn' - The Amazon Resource Name (ARN) of the incident record.
--
-- 'creationTime', 'incidentRecord_creationTime' - The time that Incident Manager created the incident record.
--
-- 'dedupeString', 'incidentRecord_dedupeString' - The string Incident Manager uses to prevent duplicate incidents from
-- being created by the same incident.
--
-- 'impact', 'incidentRecord_impact' - The impact of the incident on customers and applications.
--
-- 'incidentRecordSource', 'incidentRecord_incidentRecordSource' - Details about the action that started the incident.
--
-- 'lastModifiedBy', 'incidentRecord_lastModifiedBy' - Who modified the incident most recently.
--
-- 'lastModifiedTime', 'incidentRecord_lastModifiedTime' - The time at which the incident was most recently modified.
--
-- 'status', 'incidentRecord_status' - The current status of the incident.
--
-- 'title', 'incidentRecord_title' - The title of the incident.
newIncidentRecord ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'dedupeString'
  Prelude.Text ->
  -- | 'impact'
  Prelude.Natural ->
  -- | 'incidentRecordSource'
  IncidentRecordSource ->
  -- | 'lastModifiedBy'
  Prelude.Text ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  -- | 'status'
  IncidentRecordStatus ->
  -- | 'title'
  Prelude.Text ->
  IncidentRecord
newIncidentRecord :: Text
-> UTCTime
-> Text
-> Natural
-> IncidentRecordSource
-> Text
-> UTCTime
-> IncidentRecordStatus
-> Text
-> IncidentRecord
newIncidentRecord
  Text
pArn_
  UTCTime
pCreationTime_
  Text
pDedupeString_
  Natural
pImpact_
  IncidentRecordSource
pIncidentRecordSource_
  Text
pLastModifiedBy_
  UTCTime
pLastModifiedTime_
  IncidentRecordStatus
pStatus_
  Text
pTitle_ =
    IncidentRecord' :: Maybe Text
-> Maybe [NotificationTargetItem]
-> Maybe POSIX
-> Maybe ChatChannel
-> Maybe [AutomationExecution]
-> Text
-> POSIX
-> Text
-> Natural
-> IncidentRecordSource
-> Text
-> POSIX
-> IncidentRecordStatus
-> Text
-> IncidentRecord
IncidentRecord'
      { $sel:summary:IncidentRecord' :: Maybe Text
summary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:notificationTargets:IncidentRecord' :: Maybe [NotificationTargetItem]
notificationTargets = Maybe [NotificationTargetItem]
forall a. Maybe a
Prelude.Nothing,
        $sel:resolvedTime:IncidentRecord' :: Maybe POSIX
resolvedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:chatChannel:IncidentRecord' :: Maybe ChatChannel
chatChannel = Maybe ChatChannel
forall a. Maybe a
Prelude.Nothing,
        $sel:automationExecutions:IncidentRecord' :: Maybe [AutomationExecution]
automationExecutions = Maybe [AutomationExecution]
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:IncidentRecord' :: Text
arn = Text
pArn_,
        $sel:creationTime:IncidentRecord' :: 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:dedupeString:IncidentRecord' :: Text
dedupeString = Text
pDedupeString_,
        $sel:impact:IncidentRecord' :: Natural
impact = Natural
pImpact_,
        $sel:incidentRecordSource:IncidentRecord' :: IncidentRecordSource
incidentRecordSource = IncidentRecordSource
pIncidentRecordSource_,
        $sel:lastModifiedBy:IncidentRecord' :: Text
lastModifiedBy = Text
pLastModifiedBy_,
        $sel:lastModifiedTime:IncidentRecord' :: POSIX
lastModifiedTime =
          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
pLastModifiedTime_,
        $sel:status:IncidentRecord' :: IncidentRecordStatus
status = IncidentRecordStatus
pStatus_,
        $sel:title:IncidentRecord' :: Text
title = Text
pTitle_
      }

-- | The summary of the incident. The summary is a brief synopsis of what
-- occurred, what is currently happening, and context.
incidentRecord_summary :: Lens.Lens' IncidentRecord (Prelude.Maybe Prelude.Text)
incidentRecord_summary :: (Maybe Text -> f (Maybe Text))
-> IncidentRecord -> f IncidentRecord
incidentRecord_summary = (IncidentRecord -> Maybe Text)
-> (IncidentRecord -> Maybe Text -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Maybe Text
summary :: Maybe Text
$sel:summary:IncidentRecord' :: IncidentRecord -> Maybe Text
summary} -> Maybe Text
summary) (\s :: IncidentRecord
s@IncidentRecord' {} Maybe Text
a -> IncidentRecord
s {$sel:summary:IncidentRecord' :: Maybe Text
summary = Maybe Text
a} :: IncidentRecord)

-- | The SNS targets that are notified when updates are made to an incident.
incidentRecord_notificationTargets :: Lens.Lens' IncidentRecord (Prelude.Maybe [NotificationTargetItem])
incidentRecord_notificationTargets :: (Maybe [NotificationTargetItem]
 -> f (Maybe [NotificationTargetItem]))
-> IncidentRecord -> f IncidentRecord
incidentRecord_notificationTargets = (IncidentRecord -> Maybe [NotificationTargetItem])
-> (IncidentRecord
    -> Maybe [NotificationTargetItem] -> IncidentRecord)
-> Lens
     IncidentRecord
     IncidentRecord
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Maybe [NotificationTargetItem]
notificationTargets :: Maybe [NotificationTargetItem]
$sel:notificationTargets:IncidentRecord' :: IncidentRecord -> Maybe [NotificationTargetItem]
notificationTargets} -> Maybe [NotificationTargetItem]
notificationTargets) (\s :: IncidentRecord
s@IncidentRecord' {} Maybe [NotificationTargetItem]
a -> IncidentRecord
s {$sel:notificationTargets:IncidentRecord' :: Maybe [NotificationTargetItem]
notificationTargets = Maybe [NotificationTargetItem]
a} :: IncidentRecord) ((Maybe [NotificationTargetItem]
  -> f (Maybe [NotificationTargetItem]))
 -> IncidentRecord -> f IncidentRecord)
-> ((Maybe [NotificationTargetItem]
     -> f (Maybe [NotificationTargetItem]))
    -> Maybe [NotificationTargetItem]
    -> f (Maybe [NotificationTargetItem]))
-> (Maybe [NotificationTargetItem]
    -> f (Maybe [NotificationTargetItem]))
-> IncidentRecord
-> f IncidentRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
-> Iso
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
     (Maybe [NotificationTargetItem])
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
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
  [NotificationTargetItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time at which the incident was resolved. This appears as a timeline
-- event.
incidentRecord_resolvedTime :: Lens.Lens' IncidentRecord (Prelude.Maybe Prelude.UTCTime)
incidentRecord_resolvedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> IncidentRecord -> f IncidentRecord
incidentRecord_resolvedTime = (IncidentRecord -> Maybe POSIX)
-> (IncidentRecord -> Maybe POSIX -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Maybe POSIX
resolvedTime :: Maybe POSIX
$sel:resolvedTime:IncidentRecord' :: IncidentRecord -> Maybe POSIX
resolvedTime} -> Maybe POSIX
resolvedTime) (\s :: IncidentRecord
s@IncidentRecord' {} Maybe POSIX
a -> IncidentRecord
s {$sel:resolvedTime:IncidentRecord' :: Maybe POSIX
resolvedTime = Maybe POSIX
a} :: IncidentRecord) ((Maybe POSIX -> f (Maybe POSIX))
 -> IncidentRecord -> f IncidentRecord)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> IncidentRecord
-> f IncidentRecord
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

-- | The chat channel used for collaboration during an incident.
incidentRecord_chatChannel :: Lens.Lens' IncidentRecord (Prelude.Maybe ChatChannel)
incidentRecord_chatChannel :: (Maybe ChatChannel -> f (Maybe ChatChannel))
-> IncidentRecord -> f IncidentRecord
incidentRecord_chatChannel = (IncidentRecord -> Maybe ChatChannel)
-> (IncidentRecord -> Maybe ChatChannel -> IncidentRecord)
-> Lens
     IncidentRecord
     IncidentRecord
     (Maybe ChatChannel)
     (Maybe ChatChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Maybe ChatChannel
chatChannel :: Maybe ChatChannel
$sel:chatChannel:IncidentRecord' :: IncidentRecord -> Maybe ChatChannel
chatChannel} -> Maybe ChatChannel
chatChannel) (\s :: IncidentRecord
s@IncidentRecord' {} Maybe ChatChannel
a -> IncidentRecord
s {$sel:chatChannel:IncidentRecord' :: Maybe ChatChannel
chatChannel = Maybe ChatChannel
a} :: IncidentRecord)

-- | The runbook, or automation document, that\'s run at the beginning of the
-- incident.
incidentRecord_automationExecutions :: Lens.Lens' IncidentRecord (Prelude.Maybe [AutomationExecution])
incidentRecord_automationExecutions :: (Maybe [AutomationExecution] -> f (Maybe [AutomationExecution]))
-> IncidentRecord -> f IncidentRecord
incidentRecord_automationExecutions = (IncidentRecord -> Maybe [AutomationExecution])
-> (IncidentRecord
    -> Maybe [AutomationExecution] -> IncidentRecord)
-> Lens
     IncidentRecord
     IncidentRecord
     (Maybe [AutomationExecution])
     (Maybe [AutomationExecution])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Maybe [AutomationExecution]
automationExecutions :: Maybe [AutomationExecution]
$sel:automationExecutions:IncidentRecord' :: IncidentRecord -> Maybe [AutomationExecution]
automationExecutions} -> Maybe [AutomationExecution]
automationExecutions) (\s :: IncidentRecord
s@IncidentRecord' {} Maybe [AutomationExecution]
a -> IncidentRecord
s {$sel:automationExecutions:IncidentRecord' :: Maybe [AutomationExecution]
automationExecutions = Maybe [AutomationExecution]
a} :: IncidentRecord) ((Maybe [AutomationExecution] -> f (Maybe [AutomationExecution]))
 -> IncidentRecord -> f IncidentRecord)
-> ((Maybe [AutomationExecution]
     -> f (Maybe [AutomationExecution]))
    -> Maybe [AutomationExecution] -> f (Maybe [AutomationExecution]))
-> (Maybe [AutomationExecution] -> f (Maybe [AutomationExecution]))
-> IncidentRecord
-> f IncidentRecord
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AutomationExecution]
  [AutomationExecution]
  [AutomationExecution]
  [AutomationExecution]
-> Iso
     (Maybe [AutomationExecution])
     (Maybe [AutomationExecution])
     (Maybe [AutomationExecution])
     (Maybe [AutomationExecution])
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
  [AutomationExecution]
  [AutomationExecution]
  [AutomationExecution]
  [AutomationExecution]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the incident record.
incidentRecord_arn :: Lens.Lens' IncidentRecord Prelude.Text
incidentRecord_arn :: (Text -> f Text) -> IncidentRecord -> f IncidentRecord
incidentRecord_arn = (IncidentRecord -> Text)
-> (IncidentRecord -> Text -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Text
arn :: Text
$sel:arn:IncidentRecord' :: IncidentRecord -> Text
arn} -> Text
arn) (\s :: IncidentRecord
s@IncidentRecord' {} Text
a -> IncidentRecord
s {$sel:arn:IncidentRecord' :: Text
arn = Text
a} :: IncidentRecord)

-- | The time that Incident Manager created the incident record.
incidentRecord_creationTime :: Lens.Lens' IncidentRecord Prelude.UTCTime
incidentRecord_creationTime :: (UTCTime -> f UTCTime) -> IncidentRecord -> f IncidentRecord
incidentRecord_creationTime = (IncidentRecord -> POSIX)
-> (IncidentRecord -> POSIX -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {POSIX
creationTime :: POSIX
$sel:creationTime:IncidentRecord' :: IncidentRecord -> POSIX
creationTime} -> POSIX
creationTime) (\s :: IncidentRecord
s@IncidentRecord' {} POSIX
a -> IncidentRecord
s {$sel:creationTime:IncidentRecord' :: POSIX
creationTime = POSIX
a} :: IncidentRecord) ((POSIX -> f POSIX) -> IncidentRecord -> f IncidentRecord)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> IncidentRecord
-> f IncidentRecord
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

-- | The string Incident Manager uses to prevent duplicate incidents from
-- being created by the same incident.
incidentRecord_dedupeString :: Lens.Lens' IncidentRecord Prelude.Text
incidentRecord_dedupeString :: (Text -> f Text) -> IncidentRecord -> f IncidentRecord
incidentRecord_dedupeString = (IncidentRecord -> Text)
-> (IncidentRecord -> Text -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Text
dedupeString :: Text
$sel:dedupeString:IncidentRecord' :: IncidentRecord -> Text
dedupeString} -> Text
dedupeString) (\s :: IncidentRecord
s@IncidentRecord' {} Text
a -> IncidentRecord
s {$sel:dedupeString:IncidentRecord' :: Text
dedupeString = Text
a} :: IncidentRecord)

-- | The impact of the incident on customers and applications.
incidentRecord_impact :: Lens.Lens' IncidentRecord Prelude.Natural
incidentRecord_impact :: (Natural -> f Natural) -> IncidentRecord -> f IncidentRecord
incidentRecord_impact = (IncidentRecord -> Natural)
-> (IncidentRecord -> Natural -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Natural
impact :: Natural
$sel:impact:IncidentRecord' :: IncidentRecord -> Natural
impact} -> Natural
impact) (\s :: IncidentRecord
s@IncidentRecord' {} Natural
a -> IncidentRecord
s {$sel:impact:IncidentRecord' :: Natural
impact = Natural
a} :: IncidentRecord)

-- | Details about the action that started the incident.
incidentRecord_incidentRecordSource :: Lens.Lens' IncidentRecord IncidentRecordSource
incidentRecord_incidentRecordSource :: (IncidentRecordSource -> f IncidentRecordSource)
-> IncidentRecord -> f IncidentRecord
incidentRecord_incidentRecordSource = (IncidentRecord -> IncidentRecordSource)
-> (IncidentRecord -> IncidentRecordSource -> IncidentRecord)
-> Lens
     IncidentRecord
     IncidentRecord
     IncidentRecordSource
     IncidentRecordSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {IncidentRecordSource
incidentRecordSource :: IncidentRecordSource
$sel:incidentRecordSource:IncidentRecord' :: IncidentRecord -> IncidentRecordSource
incidentRecordSource} -> IncidentRecordSource
incidentRecordSource) (\s :: IncidentRecord
s@IncidentRecord' {} IncidentRecordSource
a -> IncidentRecord
s {$sel:incidentRecordSource:IncidentRecord' :: IncidentRecordSource
incidentRecordSource = IncidentRecordSource
a} :: IncidentRecord)

-- | Who modified the incident most recently.
incidentRecord_lastModifiedBy :: Lens.Lens' IncidentRecord Prelude.Text
incidentRecord_lastModifiedBy :: (Text -> f Text) -> IncidentRecord -> f IncidentRecord
incidentRecord_lastModifiedBy = (IncidentRecord -> Text)
-> (IncidentRecord -> Text -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Text
lastModifiedBy :: Text
$sel:lastModifiedBy:IncidentRecord' :: IncidentRecord -> Text
lastModifiedBy} -> Text
lastModifiedBy) (\s :: IncidentRecord
s@IncidentRecord' {} Text
a -> IncidentRecord
s {$sel:lastModifiedBy:IncidentRecord' :: Text
lastModifiedBy = Text
a} :: IncidentRecord)

-- | The time at which the incident was most recently modified.
incidentRecord_lastModifiedTime :: Lens.Lens' IncidentRecord Prelude.UTCTime
incidentRecord_lastModifiedTime :: (UTCTime -> f UTCTime) -> IncidentRecord -> f IncidentRecord
incidentRecord_lastModifiedTime = (IncidentRecord -> POSIX)
-> (IncidentRecord -> POSIX -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:IncidentRecord' :: IncidentRecord -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: IncidentRecord
s@IncidentRecord' {} POSIX
a -> IncidentRecord
s {$sel:lastModifiedTime:IncidentRecord' :: POSIX
lastModifiedTime = POSIX
a} :: IncidentRecord) ((POSIX -> f POSIX) -> IncidentRecord -> f IncidentRecord)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> IncidentRecord
-> f IncidentRecord
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

-- | The current status of the incident.
incidentRecord_status :: Lens.Lens' IncidentRecord IncidentRecordStatus
incidentRecord_status :: (IncidentRecordStatus -> f IncidentRecordStatus)
-> IncidentRecord -> f IncidentRecord
incidentRecord_status = (IncidentRecord -> IncidentRecordStatus)
-> (IncidentRecord -> IncidentRecordStatus -> IncidentRecord)
-> Lens
     IncidentRecord
     IncidentRecord
     IncidentRecordStatus
     IncidentRecordStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {IncidentRecordStatus
status :: IncidentRecordStatus
$sel:status:IncidentRecord' :: IncidentRecord -> IncidentRecordStatus
status} -> IncidentRecordStatus
status) (\s :: IncidentRecord
s@IncidentRecord' {} IncidentRecordStatus
a -> IncidentRecord
s {$sel:status:IncidentRecord' :: IncidentRecordStatus
status = IncidentRecordStatus
a} :: IncidentRecord)

-- | The title of the incident.
incidentRecord_title :: Lens.Lens' IncidentRecord Prelude.Text
incidentRecord_title :: (Text -> f Text) -> IncidentRecord -> f IncidentRecord
incidentRecord_title = (IncidentRecord -> Text)
-> (IncidentRecord -> Text -> IncidentRecord)
-> Lens IncidentRecord IncidentRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecord' {Text
title :: Text
$sel:title:IncidentRecord' :: IncidentRecord -> Text
title} -> Text
title) (\s :: IncidentRecord
s@IncidentRecord' {} Text
a -> IncidentRecord
s {$sel:title:IncidentRecord' :: Text
title = Text
a} :: IncidentRecord)

instance Core.FromJSON IncidentRecord where
  parseJSON :: Value -> Parser IncidentRecord
parseJSON =
    String
-> (Object -> Parser IncidentRecord)
-> Value
-> Parser IncidentRecord
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IncidentRecord"
      ( \Object
x ->
          Maybe Text
-> Maybe [NotificationTargetItem]
-> Maybe POSIX
-> Maybe ChatChannel
-> Maybe [AutomationExecution]
-> Text
-> POSIX
-> Text
-> Natural
-> IncidentRecordSource
-> Text
-> POSIX
-> IncidentRecordStatus
-> Text
-> IncidentRecord
IncidentRecord'
            (Maybe Text
 -> Maybe [NotificationTargetItem]
 -> Maybe POSIX
 -> Maybe ChatChannel
 -> Maybe [AutomationExecution]
 -> Text
 -> POSIX
 -> Text
 -> Natural
 -> IncidentRecordSource
 -> Text
 -> POSIX
 -> IncidentRecordStatus
 -> Text
 -> IncidentRecord)
-> Parser (Maybe Text)
-> Parser
     (Maybe [NotificationTargetItem]
      -> Maybe POSIX
      -> Maybe ChatChannel
      -> Maybe [AutomationExecution]
      -> Text
      -> POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
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
"summary")
            Parser
  (Maybe [NotificationTargetItem]
   -> Maybe POSIX
   -> Maybe ChatChannel
   -> Maybe [AutomationExecution]
   -> Text
   -> POSIX
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser (Maybe [NotificationTargetItem])
-> Parser
     (Maybe POSIX
      -> Maybe ChatChannel
      -> Maybe [AutomationExecution]
      -> Text
      -> POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [NotificationTargetItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notificationTargets"
                            Parser (Maybe (Maybe [NotificationTargetItem]))
-> Maybe [NotificationTargetItem]
-> Parser (Maybe [NotificationTargetItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [NotificationTargetItem]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe ChatChannel
   -> Maybe [AutomationExecution]
   -> Text
   -> POSIX
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ChatChannel
      -> Maybe [AutomationExecution]
      -> Text
      -> POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
forall (f :: * -> *) a b. Applicative f => 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
  (Maybe ChatChannel
   -> Maybe [AutomationExecution]
   -> Text
   -> POSIX
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser (Maybe ChatChannel)
-> Parser
     (Maybe [AutomationExecution]
      -> Text
      -> POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChatChannel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"chatChannel")
            Parser
  (Maybe [AutomationExecution]
   -> Text
   -> POSIX
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser (Maybe [AutomationExecution])
-> Parser
     (Text
      -> POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AutomationExecution]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"automationExecutions"
                            Parser (Maybe (Maybe [AutomationExecution]))
-> Maybe [AutomationExecution]
-> Parser (Maybe [AutomationExecution])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AutomationExecution]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Text
   -> POSIX
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser Text
-> Parser
     (POSIX
      -> Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
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
   -> Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser POSIX
-> Parser
     (Text
      -> Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
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
  (Text
   -> Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser Text
-> Parser
     (Natural
      -> IncidentRecordSource
      -> Text
      -> POSIX
      -> IncidentRecordStatus
      -> Text
      -> IncidentRecord)
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
"dedupeString")
            Parser
  (Natural
   -> IncidentRecordSource
   -> Text
   -> POSIX
   -> IncidentRecordStatus
   -> Text
   -> IncidentRecord)
-> Parser Natural
-> Parser
     (IncidentRecordSource
      -> Text -> POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
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
   -> Text -> POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
-> Parser IncidentRecordSource
-> Parser
     (Text -> POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
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
  (Text -> POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
-> Parser Text
-> Parser (POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
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
"lastModifiedBy")
            Parser (POSIX -> IncidentRecordStatus -> Text -> IncidentRecord)
-> Parser POSIX
-> Parser (IncidentRecordStatus -> Text -> IncidentRecord)
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
"lastModifiedTime")
            Parser (IncidentRecordStatus -> Text -> IncidentRecord)
-> Parser IncidentRecordStatus -> Parser (Text -> IncidentRecord)
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 -> IncidentRecord)
-> Parser Text -> Parser IncidentRecord
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 IncidentRecord

instance Prelude.NFData IncidentRecord