{-# 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.XRay.Types.InsightSummary
-- 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.XRay.Types.InsightSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.XRay.Types.AnomalousService
import Amazonka.XRay.Types.InsightCategory
import Amazonka.XRay.Types.InsightState
import Amazonka.XRay.Types.RequestImpactStatistics
import Amazonka.XRay.Types.ServiceId

-- | Information that describes an insight.
--
-- /See:/ 'newInsightSummary' smart constructor.
data InsightSummary = InsightSummary'
  { -- | A brief description of the insight.
    InsightSummary -> Maybe Text
summary :: Prelude.Maybe Prelude.Text,
    -- | The current state of the insight.
    InsightSummary -> Maybe InsightState
state :: Prelude.Maybe InsightState,
    -- | The time, in Unix seconds, at which the insight began.
    InsightSummary -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The insights unique identifier.
    InsightSummary -> Maybe Text
insightId :: Prelude.Maybe Prelude.Text,
    -- | Categories The categories that label and describe the type of insight.
    InsightSummary -> Maybe [InsightCategory]
categories :: Prelude.Maybe [InsightCategory],
    -- | The impact statistics of the root cause service. This includes the
    -- number of requests to the client service and whether the requests were
    -- faults or okay.
    InsightSummary -> Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics :: Prelude.Maybe RequestImpactStatistics,
    -- | The service within the insight that is most impacted by the incident.
    InsightSummary -> Maybe [AnomalousService]
topAnomalousServices :: Prelude.Maybe [AnomalousService],
    InsightSummary -> Maybe ServiceId
rootCauseServiceId :: Prelude.Maybe ServiceId,
    -- | The impact statistics of the client side service. This includes the
    -- number of requests to the client service and whether the requests were
    -- faults or okay.
    InsightSummary -> Maybe RequestImpactStatistics
clientRequestImpactStatistics :: Prelude.Maybe RequestImpactStatistics,
    -- | The time, in Unix seconds, at which the insight ended.
    InsightSummary -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the group that the insight belongs to.
    InsightSummary -> Maybe Text
groupARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the group that the insight belongs to.
    InsightSummary -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The time, in Unix seconds, that the insight was last updated.
    InsightSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX
  }
  deriving (InsightSummary -> InsightSummary -> Bool
(InsightSummary -> InsightSummary -> Bool)
-> (InsightSummary -> InsightSummary -> Bool) -> Eq InsightSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightSummary -> InsightSummary -> Bool
$c/= :: InsightSummary -> InsightSummary -> Bool
== :: InsightSummary -> InsightSummary -> Bool
$c== :: InsightSummary -> InsightSummary -> Bool
Prelude.Eq, ReadPrec [InsightSummary]
ReadPrec InsightSummary
Int -> ReadS InsightSummary
ReadS [InsightSummary]
(Int -> ReadS InsightSummary)
-> ReadS [InsightSummary]
-> ReadPrec InsightSummary
-> ReadPrec [InsightSummary]
-> Read InsightSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightSummary]
$creadListPrec :: ReadPrec [InsightSummary]
readPrec :: ReadPrec InsightSummary
$creadPrec :: ReadPrec InsightSummary
readList :: ReadS [InsightSummary]
$creadList :: ReadS [InsightSummary]
readsPrec :: Int -> ReadS InsightSummary
$creadsPrec :: Int -> ReadS InsightSummary
Prelude.Read, Int -> InsightSummary -> ShowS
[InsightSummary] -> ShowS
InsightSummary -> String
(Int -> InsightSummary -> ShowS)
-> (InsightSummary -> String)
-> ([InsightSummary] -> ShowS)
-> Show InsightSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightSummary] -> ShowS
$cshowList :: [InsightSummary] -> ShowS
show :: InsightSummary -> String
$cshow :: InsightSummary -> String
showsPrec :: Int -> InsightSummary -> ShowS
$cshowsPrec :: Int -> InsightSummary -> ShowS
Prelude.Show, (forall x. InsightSummary -> Rep InsightSummary x)
-> (forall x. Rep InsightSummary x -> InsightSummary)
-> Generic InsightSummary
forall x. Rep InsightSummary x -> InsightSummary
forall x. InsightSummary -> Rep InsightSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InsightSummary x -> InsightSummary
$cfrom :: forall x. InsightSummary -> Rep InsightSummary x
Prelude.Generic)

-- |
-- Create a value of 'InsightSummary' 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', 'insightSummary_summary' - A brief description of the insight.
--
-- 'state', 'insightSummary_state' - The current state of the insight.
--
-- 'startTime', 'insightSummary_startTime' - The time, in Unix seconds, at which the insight began.
--
-- 'insightId', 'insightSummary_insightId' - The insights unique identifier.
--
-- 'categories', 'insightSummary_categories' - Categories The categories that label and describe the type of insight.
--
-- 'rootCauseServiceRequestImpactStatistics', 'insightSummary_rootCauseServiceRequestImpactStatistics' - The impact statistics of the root cause service. This includes the
-- number of requests to the client service and whether the requests were
-- faults or okay.
--
-- 'topAnomalousServices', 'insightSummary_topAnomalousServices' - The service within the insight that is most impacted by the incident.
--
-- 'rootCauseServiceId', 'insightSummary_rootCauseServiceId' - Undocumented member.
--
-- 'clientRequestImpactStatistics', 'insightSummary_clientRequestImpactStatistics' - The impact statistics of the client side service. This includes the
-- number of requests to the client service and whether the requests were
-- faults or okay.
--
-- 'endTime', 'insightSummary_endTime' - The time, in Unix seconds, at which the insight ended.
--
-- 'groupARN', 'insightSummary_groupARN' - The Amazon Resource Name (ARN) of the group that the insight belongs to.
--
-- 'groupName', 'insightSummary_groupName' - The name of the group that the insight belongs to.
--
-- 'lastUpdateTime', 'insightSummary_lastUpdateTime' - The time, in Unix seconds, that the insight was last updated.
newInsightSummary ::
  InsightSummary
newInsightSummary :: InsightSummary
newInsightSummary =
  InsightSummary' :: Maybe Text
-> Maybe InsightState
-> Maybe POSIX
-> Maybe Text
-> Maybe [InsightCategory]
-> Maybe RequestImpactStatistics
-> Maybe [AnomalousService]
-> Maybe ServiceId
-> Maybe RequestImpactStatistics
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> InsightSummary
InsightSummary'
    { $sel:summary:InsightSummary' :: Maybe Text
summary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:InsightSummary' :: Maybe InsightState
state = Maybe InsightState
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:InsightSummary' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:insightId:InsightSummary' :: Maybe Text
insightId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:categories:InsightSummary' :: Maybe [InsightCategory]
categories = Maybe [InsightCategory]
forall a. Maybe a
Prelude.Nothing,
      $sel:rootCauseServiceRequestImpactStatistics:InsightSummary' :: Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics =
        Maybe RequestImpactStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:topAnomalousServices:InsightSummary' :: Maybe [AnomalousService]
topAnomalousServices = Maybe [AnomalousService]
forall a. Maybe a
Prelude.Nothing,
      $sel:rootCauseServiceId:InsightSummary' :: Maybe ServiceId
rootCauseServiceId = Maybe ServiceId
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestImpactStatistics:InsightSummary' :: Maybe RequestImpactStatistics
clientRequestImpactStatistics = Maybe RequestImpactStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:InsightSummary' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:groupARN:InsightSummary' :: Maybe Text
groupARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:InsightSummary' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:InsightSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | A brief description of the insight.
insightSummary_summary :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.Text)
insightSummary_summary :: (Maybe Text -> f (Maybe Text))
-> InsightSummary -> f InsightSummary
insightSummary_summary = (InsightSummary -> Maybe Text)
-> (InsightSummary -> Maybe Text -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe Text
summary :: Maybe Text
$sel:summary:InsightSummary' :: InsightSummary -> Maybe Text
summary} -> Maybe Text
summary) (\s :: InsightSummary
s@InsightSummary' {} Maybe Text
a -> InsightSummary
s {$sel:summary:InsightSummary' :: Maybe Text
summary = Maybe Text
a} :: InsightSummary)

-- | The current state of the insight.
insightSummary_state :: Lens.Lens' InsightSummary (Prelude.Maybe InsightState)
insightSummary_state :: (Maybe InsightState -> f (Maybe InsightState))
-> InsightSummary -> f InsightSummary
insightSummary_state = (InsightSummary -> Maybe InsightState)
-> (InsightSummary -> Maybe InsightState -> InsightSummary)
-> Lens
     InsightSummary
     InsightSummary
     (Maybe InsightState)
     (Maybe InsightState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe InsightState
state :: Maybe InsightState
$sel:state:InsightSummary' :: InsightSummary -> Maybe InsightState
state} -> Maybe InsightState
state) (\s :: InsightSummary
s@InsightSummary' {} Maybe InsightState
a -> InsightSummary
s {$sel:state:InsightSummary' :: Maybe InsightState
state = Maybe InsightState
a} :: InsightSummary)

-- | The time, in Unix seconds, at which the insight began.
insightSummary_startTime :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.UTCTime)
insightSummary_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary -> f InsightSummary
insightSummary_startTime = (InsightSummary -> Maybe POSIX)
-> (InsightSummary -> Maybe POSIX -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:InsightSummary' :: InsightSummary -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: InsightSummary
s@InsightSummary' {} Maybe POSIX
a -> InsightSummary
s {$sel:startTime:InsightSummary' :: Maybe POSIX
startTime = Maybe POSIX
a} :: InsightSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> InsightSummary -> f InsightSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary
-> f InsightSummary
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 insights unique identifier.
insightSummary_insightId :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.Text)
insightSummary_insightId :: (Maybe Text -> f (Maybe Text))
-> InsightSummary -> f InsightSummary
insightSummary_insightId = (InsightSummary -> Maybe Text)
-> (InsightSummary -> Maybe Text -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe Text
insightId :: Maybe Text
$sel:insightId:InsightSummary' :: InsightSummary -> Maybe Text
insightId} -> Maybe Text
insightId) (\s :: InsightSummary
s@InsightSummary' {} Maybe Text
a -> InsightSummary
s {$sel:insightId:InsightSummary' :: Maybe Text
insightId = Maybe Text
a} :: InsightSummary)

-- | Categories The categories that label and describe the type of insight.
insightSummary_categories :: Lens.Lens' InsightSummary (Prelude.Maybe [InsightCategory])
insightSummary_categories :: (Maybe [InsightCategory] -> f (Maybe [InsightCategory]))
-> InsightSummary -> f InsightSummary
insightSummary_categories = (InsightSummary -> Maybe [InsightCategory])
-> (InsightSummary -> Maybe [InsightCategory] -> InsightSummary)
-> Lens
     InsightSummary
     InsightSummary
     (Maybe [InsightCategory])
     (Maybe [InsightCategory])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe [InsightCategory]
categories :: Maybe [InsightCategory]
$sel:categories:InsightSummary' :: InsightSummary -> Maybe [InsightCategory]
categories} -> Maybe [InsightCategory]
categories) (\s :: InsightSummary
s@InsightSummary' {} Maybe [InsightCategory]
a -> InsightSummary
s {$sel:categories:InsightSummary' :: Maybe [InsightCategory]
categories = Maybe [InsightCategory]
a} :: InsightSummary) ((Maybe [InsightCategory] -> f (Maybe [InsightCategory]))
 -> InsightSummary -> f InsightSummary)
-> ((Maybe [InsightCategory] -> f (Maybe [InsightCategory]))
    -> Maybe [InsightCategory] -> f (Maybe [InsightCategory]))
-> (Maybe [InsightCategory] -> f (Maybe [InsightCategory]))
-> InsightSummary
-> f InsightSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InsightCategory]
  [InsightCategory]
  [InsightCategory]
  [InsightCategory]
-> Iso
     (Maybe [InsightCategory])
     (Maybe [InsightCategory])
     (Maybe [InsightCategory])
     (Maybe [InsightCategory])
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
  [InsightCategory]
  [InsightCategory]
  [InsightCategory]
  [InsightCategory]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The impact statistics of the root cause service. This includes the
-- number of requests to the client service and whether the requests were
-- faults or okay.
insightSummary_rootCauseServiceRequestImpactStatistics :: Lens.Lens' InsightSummary (Prelude.Maybe RequestImpactStatistics)
insightSummary_rootCauseServiceRequestImpactStatistics :: (Maybe RequestImpactStatistics
 -> f (Maybe RequestImpactStatistics))
-> InsightSummary -> f InsightSummary
insightSummary_rootCauseServiceRequestImpactStatistics = (InsightSummary -> Maybe RequestImpactStatistics)
-> (InsightSummary
    -> Maybe RequestImpactStatistics -> InsightSummary)
-> Lens
     InsightSummary
     InsightSummary
     (Maybe RequestImpactStatistics)
     (Maybe RequestImpactStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics :: Maybe RequestImpactStatistics
$sel:rootCauseServiceRequestImpactStatistics:InsightSummary' :: InsightSummary -> Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics} -> Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics) (\s :: InsightSummary
s@InsightSummary' {} Maybe RequestImpactStatistics
a -> InsightSummary
s {$sel:rootCauseServiceRequestImpactStatistics:InsightSummary' :: Maybe RequestImpactStatistics
rootCauseServiceRequestImpactStatistics = Maybe RequestImpactStatistics
a} :: InsightSummary)

-- | The service within the insight that is most impacted by the incident.
insightSummary_topAnomalousServices :: Lens.Lens' InsightSummary (Prelude.Maybe [AnomalousService])
insightSummary_topAnomalousServices :: (Maybe [AnomalousService] -> f (Maybe [AnomalousService]))
-> InsightSummary -> f InsightSummary
insightSummary_topAnomalousServices = (InsightSummary -> Maybe [AnomalousService])
-> (InsightSummary -> Maybe [AnomalousService] -> InsightSummary)
-> Lens
     InsightSummary
     InsightSummary
     (Maybe [AnomalousService])
     (Maybe [AnomalousService])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe [AnomalousService]
topAnomalousServices :: Maybe [AnomalousService]
$sel:topAnomalousServices:InsightSummary' :: InsightSummary -> Maybe [AnomalousService]
topAnomalousServices} -> Maybe [AnomalousService]
topAnomalousServices) (\s :: InsightSummary
s@InsightSummary' {} Maybe [AnomalousService]
a -> InsightSummary
s {$sel:topAnomalousServices:InsightSummary' :: Maybe [AnomalousService]
topAnomalousServices = Maybe [AnomalousService]
a} :: InsightSummary) ((Maybe [AnomalousService] -> f (Maybe [AnomalousService]))
 -> InsightSummary -> f InsightSummary)
-> ((Maybe [AnomalousService] -> f (Maybe [AnomalousService]))
    -> Maybe [AnomalousService] -> f (Maybe [AnomalousService]))
-> (Maybe [AnomalousService] -> f (Maybe [AnomalousService]))
-> InsightSummary
-> f InsightSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AnomalousService]
  [AnomalousService]
  [AnomalousService]
  [AnomalousService]
-> Iso
     (Maybe [AnomalousService])
     (Maybe [AnomalousService])
     (Maybe [AnomalousService])
     (Maybe [AnomalousService])
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
  [AnomalousService]
  [AnomalousService]
  [AnomalousService]
  [AnomalousService]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
insightSummary_rootCauseServiceId :: Lens.Lens' InsightSummary (Prelude.Maybe ServiceId)
insightSummary_rootCauseServiceId :: (Maybe ServiceId -> f (Maybe ServiceId))
-> InsightSummary -> f InsightSummary
insightSummary_rootCauseServiceId = (InsightSummary -> Maybe ServiceId)
-> (InsightSummary -> Maybe ServiceId -> InsightSummary)
-> Lens
     InsightSummary InsightSummary (Maybe ServiceId) (Maybe ServiceId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe ServiceId
rootCauseServiceId :: Maybe ServiceId
$sel:rootCauseServiceId:InsightSummary' :: InsightSummary -> Maybe ServiceId
rootCauseServiceId} -> Maybe ServiceId
rootCauseServiceId) (\s :: InsightSummary
s@InsightSummary' {} Maybe ServiceId
a -> InsightSummary
s {$sel:rootCauseServiceId:InsightSummary' :: Maybe ServiceId
rootCauseServiceId = Maybe ServiceId
a} :: InsightSummary)

-- | The impact statistics of the client side service. This includes the
-- number of requests to the client service and whether the requests were
-- faults or okay.
insightSummary_clientRequestImpactStatistics :: Lens.Lens' InsightSummary (Prelude.Maybe RequestImpactStatistics)
insightSummary_clientRequestImpactStatistics :: (Maybe RequestImpactStatistics
 -> f (Maybe RequestImpactStatistics))
-> InsightSummary -> f InsightSummary
insightSummary_clientRequestImpactStatistics = (InsightSummary -> Maybe RequestImpactStatistics)
-> (InsightSummary
    -> Maybe RequestImpactStatistics -> InsightSummary)
-> Lens
     InsightSummary
     InsightSummary
     (Maybe RequestImpactStatistics)
     (Maybe RequestImpactStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe RequestImpactStatistics
clientRequestImpactStatistics :: Maybe RequestImpactStatistics
$sel:clientRequestImpactStatistics:InsightSummary' :: InsightSummary -> Maybe RequestImpactStatistics
clientRequestImpactStatistics} -> Maybe RequestImpactStatistics
clientRequestImpactStatistics) (\s :: InsightSummary
s@InsightSummary' {} Maybe RequestImpactStatistics
a -> InsightSummary
s {$sel:clientRequestImpactStatistics:InsightSummary' :: Maybe RequestImpactStatistics
clientRequestImpactStatistics = Maybe RequestImpactStatistics
a} :: InsightSummary)

-- | The time, in Unix seconds, at which the insight ended.
insightSummary_endTime :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.UTCTime)
insightSummary_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary -> f InsightSummary
insightSummary_endTime = (InsightSummary -> Maybe POSIX)
-> (InsightSummary -> Maybe POSIX -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:InsightSummary' :: InsightSummary -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: InsightSummary
s@InsightSummary' {} Maybe POSIX
a -> InsightSummary
s {$sel:endTime:InsightSummary' :: Maybe POSIX
endTime = Maybe POSIX
a} :: InsightSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> InsightSummary -> f InsightSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary
-> f InsightSummary
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 Amazon Resource Name (ARN) of the group that the insight belongs to.
insightSummary_groupARN :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.Text)
insightSummary_groupARN :: (Maybe Text -> f (Maybe Text))
-> InsightSummary -> f InsightSummary
insightSummary_groupARN = (InsightSummary -> Maybe Text)
-> (InsightSummary -> Maybe Text -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe Text
groupARN :: Maybe Text
$sel:groupARN:InsightSummary' :: InsightSummary -> Maybe Text
groupARN} -> Maybe Text
groupARN) (\s :: InsightSummary
s@InsightSummary' {} Maybe Text
a -> InsightSummary
s {$sel:groupARN:InsightSummary' :: Maybe Text
groupARN = Maybe Text
a} :: InsightSummary)

-- | The name of the group that the insight belongs to.
insightSummary_groupName :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.Text)
insightSummary_groupName :: (Maybe Text -> f (Maybe Text))
-> InsightSummary -> f InsightSummary
insightSummary_groupName = (InsightSummary -> Maybe Text)
-> (InsightSummary -> Maybe Text -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe Text
groupName :: Maybe Text
$sel:groupName:InsightSummary' :: InsightSummary -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: InsightSummary
s@InsightSummary' {} Maybe Text
a -> InsightSummary
s {$sel:groupName:InsightSummary' :: Maybe Text
groupName = Maybe Text
a} :: InsightSummary)

-- | The time, in Unix seconds, that the insight was last updated.
insightSummary_lastUpdateTime :: Lens.Lens' InsightSummary (Prelude.Maybe Prelude.UTCTime)
insightSummary_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary -> f InsightSummary
insightSummary_lastUpdateTime = (InsightSummary -> Maybe POSIX)
-> (InsightSummary -> Maybe POSIX -> InsightSummary)
-> Lens InsightSummary InsightSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:InsightSummary' :: InsightSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: InsightSummary
s@InsightSummary' {} Maybe POSIX
a -> InsightSummary
s {$sel:lastUpdateTime:InsightSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: InsightSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> InsightSummary -> f InsightSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightSummary
-> f InsightSummary
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

instance Core.FromJSON InsightSummary where
  parseJSON :: Value -> Parser InsightSummary
parseJSON =
    String
-> (Object -> Parser InsightSummary)
-> Value
-> Parser InsightSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InsightSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe InsightState
-> Maybe POSIX
-> Maybe Text
-> Maybe [InsightCategory]
-> Maybe RequestImpactStatistics
-> Maybe [AnomalousService]
-> Maybe ServiceId
-> Maybe RequestImpactStatistics
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> InsightSummary
InsightSummary'
            (Maybe Text
 -> Maybe InsightState
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [InsightCategory]
 -> Maybe RequestImpactStatistics
 -> Maybe [AnomalousService]
 -> Maybe ServiceId
 -> Maybe RequestImpactStatistics
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> InsightSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe InsightState
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [InsightCategory]
      -> Maybe RequestImpactStatistics
      -> Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
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 InsightState
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [InsightCategory]
   -> Maybe RequestImpactStatistics
   -> Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe InsightState)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [InsightCategory]
      -> Maybe RequestImpactStatistics
      -> Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InsightState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [InsightCategory]
   -> Maybe RequestImpactStatistics
   -> Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [InsightCategory]
      -> Maybe RequestImpactStatistics
      -> Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
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
"StartTime")
            Parser
  (Maybe Text
   -> Maybe [InsightCategory]
   -> Maybe RequestImpactStatistics
   -> Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe [InsightCategory]
      -> Maybe RequestImpactStatistics
      -> Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
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
"InsightId")
            Parser
  (Maybe [InsightCategory]
   -> Maybe RequestImpactStatistics
   -> Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe [InsightCategory])
-> Parser
     (Maybe RequestImpactStatistics
      -> Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [InsightCategory]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Categories" Parser (Maybe (Maybe [InsightCategory]))
-> Maybe [InsightCategory] -> Parser (Maybe [InsightCategory])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [InsightCategory]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe RequestImpactStatistics
   -> Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe RequestImpactStatistics)
-> Parser
     (Maybe [AnomalousService]
      -> Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object -> Text -> Parser (Maybe RequestImpactStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RootCauseServiceRequestImpactStatistics"
                        )
            Parser
  (Maybe [AnomalousService]
   -> Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe [AnomalousService])
-> Parser
     (Maybe ServiceId
      -> Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AnomalousService]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TopAnomalousServices"
                            Parser (Maybe (Maybe [AnomalousService]))
-> Maybe [AnomalousService] -> Parser (Maybe [AnomalousService])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AnomalousService]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe ServiceId
   -> Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe ServiceId)
-> Parser
     (Maybe RequestImpactStatistics
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceId)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RootCauseServiceId")
            Parser
  (Maybe RequestImpactStatistics
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> InsightSummary)
-> Parser (Maybe RequestImpactStatistics)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Maybe POSIX -> InsightSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RequestImpactStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientRequestImpactStatistics")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Maybe POSIX -> InsightSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe POSIX -> InsightSummary)
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
"EndTime")
            Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> InsightSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> InsightSummary)
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
"GroupARN")
            Parser (Maybe Text -> Maybe POSIX -> InsightSummary)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> InsightSummary)
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
"GroupName")
            Parser (Maybe POSIX -> InsightSummary)
-> Parser (Maybe POSIX) -> Parser InsightSummary
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
"LastUpdateTime")
      )

instance Prelude.Hashable InsightSummary

instance Prelude.NFData InsightSummary