{-# 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.DevOpsGuru.Types.ReactiveAnomaly
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DevOpsGuru.Types.ReactiveAnomaly where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types.AnomalyReportedTimeRange
import Amazonka.DevOpsGuru.Types.AnomalyResource
import Amazonka.DevOpsGuru.Types.AnomalySeverity
import Amazonka.DevOpsGuru.Types.AnomalySourceDetails
import Amazonka.DevOpsGuru.Types.AnomalyStatus
import Amazonka.DevOpsGuru.Types.AnomalyTimeRange
import Amazonka.DevOpsGuru.Types.AnomalyType
import Amazonka.DevOpsGuru.Types.ResourceCollection
import qualified Amazonka.Prelude as Prelude

-- | Details about a reactive anomaly. This object is returned by
-- @ListAnomalies@.
--
-- /See:/ 'newReactiveAnomaly' smart constructor.
data ReactiveAnomaly = ReactiveAnomaly'
  { -- | An @AnomalyReportedTimeRange@ object that specifies the time range
    -- between when the anomaly is opened and the time when it is closed.
    ReactiveAnomaly -> Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange :: Prelude.Maybe AnomalyReportedTimeRange,
    -- | The Amazon Web Services resources in which anomalous behavior was
    -- detected by DevOps Guru.
    ReactiveAnomaly -> Maybe [AnomalyResource]
anomalyResources :: Prelude.Maybe [AnomalyResource],
    ReactiveAnomaly -> Maybe AnomalyTimeRange
anomalyTimeRange :: Prelude.Maybe AnomalyTimeRange,
    -- | The ID of the insight that contains this anomaly. An insight is composed
    -- of related anomalies.
    ReactiveAnomaly -> Maybe Text
associatedInsightId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the causal anomaly that is associated with this reactive
    -- anomaly. The ID of a \`CAUSAL\` anomaly is always \`NULL\`.
    ReactiveAnomaly -> Maybe Text
causalAnomalyId :: Prelude.Maybe Prelude.Text,
    -- | A description of the reactive anomaly.
    ReactiveAnomaly -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the reactive anomaly.
    ReactiveAnomaly -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the reactive anomaly.
    ReactiveAnomaly -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    ReactiveAnomaly -> Maybe ResourceCollection
resourceCollection :: Prelude.Maybe ResourceCollection,
    -- | The severity of the anomaly. The severity of anomalies that generate an
    -- insight determine that insight\'s severity. For more information, see
    -- <https://docs.aws.amazon.com/devops-guru/latest/userguide/working-with-insights.html#understanding-insights-severities Understanding insight severities>
    -- in the /Amazon DevOps Guru User Guide/.
    ReactiveAnomaly -> Maybe AnomalySeverity
severity :: Prelude.Maybe AnomalySeverity,
    -- | Details about the source of the analyzed operational data that triggered
    -- the anomaly. The one supported source is Amazon CloudWatch metrics.
    ReactiveAnomaly -> Maybe AnomalySourceDetails
sourceDetails :: Prelude.Maybe AnomalySourceDetails,
    -- | The status of the anomaly.
    ReactiveAnomaly -> Maybe AnomalyStatus
status :: Prelude.Maybe AnomalyStatus,
    -- | The type of the reactive anomaly. It can be one of the following types.
    --
    -- -   @CAUSAL@ - the anomaly can cause a new insight.
    --
    -- -   @CONTEXTUAL@ - the anomaly contains additional information about an
    --     insight or its causal anomaly.
    ReactiveAnomaly -> Maybe AnomalyType
type' :: Prelude.Maybe AnomalyType
  }
  deriving (ReactiveAnomaly -> ReactiveAnomaly -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactiveAnomaly -> ReactiveAnomaly -> Bool
$c/= :: ReactiveAnomaly -> ReactiveAnomaly -> Bool
== :: ReactiveAnomaly -> ReactiveAnomaly -> Bool
$c== :: ReactiveAnomaly -> ReactiveAnomaly -> Bool
Prelude.Eq, ReadPrec [ReactiveAnomaly]
ReadPrec ReactiveAnomaly
Int -> ReadS ReactiveAnomaly
ReadS [ReactiveAnomaly]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReactiveAnomaly]
$creadListPrec :: ReadPrec [ReactiveAnomaly]
readPrec :: ReadPrec ReactiveAnomaly
$creadPrec :: ReadPrec ReactiveAnomaly
readList :: ReadS [ReactiveAnomaly]
$creadList :: ReadS [ReactiveAnomaly]
readsPrec :: Int -> ReadS ReactiveAnomaly
$creadsPrec :: Int -> ReadS ReactiveAnomaly
Prelude.Read, Int -> ReactiveAnomaly -> ShowS
[ReactiveAnomaly] -> ShowS
ReactiveAnomaly -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactiveAnomaly] -> ShowS
$cshowList :: [ReactiveAnomaly] -> ShowS
show :: ReactiveAnomaly -> String
$cshow :: ReactiveAnomaly -> String
showsPrec :: Int -> ReactiveAnomaly -> ShowS
$cshowsPrec :: Int -> ReactiveAnomaly -> ShowS
Prelude.Show, forall x. Rep ReactiveAnomaly x -> ReactiveAnomaly
forall x. ReactiveAnomaly -> Rep ReactiveAnomaly x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReactiveAnomaly x -> ReactiveAnomaly
$cfrom :: forall x. ReactiveAnomaly -> Rep ReactiveAnomaly x
Prelude.Generic)

-- |
-- Create a value of 'ReactiveAnomaly' 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:
--
-- 'anomalyReportedTimeRange', 'reactiveAnomaly_anomalyReportedTimeRange' - An @AnomalyReportedTimeRange@ object that specifies the time range
-- between when the anomaly is opened and the time when it is closed.
--
-- 'anomalyResources', 'reactiveAnomaly_anomalyResources' - The Amazon Web Services resources in which anomalous behavior was
-- detected by DevOps Guru.
--
-- 'anomalyTimeRange', 'reactiveAnomaly_anomalyTimeRange' - Undocumented member.
--
-- 'associatedInsightId', 'reactiveAnomaly_associatedInsightId' - The ID of the insight that contains this anomaly. An insight is composed
-- of related anomalies.
--
-- 'causalAnomalyId', 'reactiveAnomaly_causalAnomalyId' - The ID of the causal anomaly that is associated with this reactive
-- anomaly. The ID of a \`CAUSAL\` anomaly is always \`NULL\`.
--
-- 'description', 'reactiveAnomaly_description' - A description of the reactive anomaly.
--
-- 'id', 'reactiveAnomaly_id' - The ID of the reactive anomaly.
--
-- 'name', 'reactiveAnomaly_name' - The name of the reactive anomaly.
--
-- 'resourceCollection', 'reactiveAnomaly_resourceCollection' - Undocumented member.
--
-- 'severity', 'reactiveAnomaly_severity' - The severity of the anomaly. The severity of anomalies that generate an
-- insight determine that insight\'s severity. For more information, see
-- <https://docs.aws.amazon.com/devops-guru/latest/userguide/working-with-insights.html#understanding-insights-severities Understanding insight severities>
-- in the /Amazon DevOps Guru User Guide/.
--
-- 'sourceDetails', 'reactiveAnomaly_sourceDetails' - Details about the source of the analyzed operational data that triggered
-- the anomaly. The one supported source is Amazon CloudWatch metrics.
--
-- 'status', 'reactiveAnomaly_status' - The status of the anomaly.
--
-- 'type'', 'reactiveAnomaly_type' - The type of the reactive anomaly. It can be one of the following types.
--
-- -   @CAUSAL@ - the anomaly can cause a new insight.
--
-- -   @CONTEXTUAL@ - the anomaly contains additional information about an
--     insight or its causal anomaly.
newReactiveAnomaly ::
  ReactiveAnomaly
newReactiveAnomaly :: ReactiveAnomaly
newReactiveAnomaly =
  ReactiveAnomaly'
    { $sel:anomalyReportedTimeRange:ReactiveAnomaly' :: Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange =
        forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyResources:ReactiveAnomaly' :: Maybe [AnomalyResource]
anomalyResources = forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyTimeRange:ReactiveAnomaly' :: Maybe AnomalyTimeRange
anomalyTimeRange = forall a. Maybe a
Prelude.Nothing,
      $sel:associatedInsightId:ReactiveAnomaly' :: Maybe Text
associatedInsightId = forall a. Maybe a
Prelude.Nothing,
      $sel:causalAnomalyId:ReactiveAnomaly' :: Maybe Text
causalAnomalyId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ReactiveAnomaly' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ReactiveAnomaly' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ReactiveAnomaly' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceCollection:ReactiveAnomaly' :: Maybe ResourceCollection
resourceCollection = forall a. Maybe a
Prelude.Nothing,
      $sel:severity:ReactiveAnomaly' :: Maybe AnomalySeverity
severity = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceDetails:ReactiveAnomaly' :: Maybe AnomalySourceDetails
sourceDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ReactiveAnomaly' :: Maybe AnomalyStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:type':ReactiveAnomaly' :: Maybe AnomalyType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | An @AnomalyReportedTimeRange@ object that specifies the time range
-- between when the anomaly is opened and the time when it is closed.
reactiveAnomaly_anomalyReportedTimeRange :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalyReportedTimeRange)
reactiveAnomaly_anomalyReportedTimeRange :: Lens' ReactiveAnomaly (Maybe AnomalyReportedTimeRange)
reactiveAnomaly_anomalyReportedTimeRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange :: Maybe AnomalyReportedTimeRange
$sel:anomalyReportedTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange} -> Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalyReportedTimeRange
a -> ReactiveAnomaly
s {$sel:anomalyReportedTimeRange:ReactiveAnomaly' :: Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange = Maybe AnomalyReportedTimeRange
a} :: ReactiveAnomaly)

-- | The Amazon Web Services resources in which anomalous behavior was
-- detected by DevOps Guru.
reactiveAnomaly_anomalyResources :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe [AnomalyResource])
reactiveAnomaly_anomalyResources :: Lens' ReactiveAnomaly (Maybe [AnomalyResource])
reactiveAnomaly_anomalyResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe [AnomalyResource]
anomalyResources :: Maybe [AnomalyResource]
$sel:anomalyResources:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe [AnomalyResource]
anomalyResources} -> Maybe [AnomalyResource]
anomalyResources) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe [AnomalyResource]
a -> ReactiveAnomaly
s {$sel:anomalyResources:ReactiveAnomaly' :: Maybe [AnomalyResource]
anomalyResources = Maybe [AnomalyResource]
a} :: ReactiveAnomaly) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
reactiveAnomaly_anomalyTimeRange :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalyTimeRange)
reactiveAnomaly_anomalyTimeRange :: Lens' ReactiveAnomaly (Maybe AnomalyTimeRange)
reactiveAnomaly_anomalyTimeRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalyTimeRange
anomalyTimeRange :: Maybe AnomalyTimeRange
$sel:anomalyTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyTimeRange
anomalyTimeRange} -> Maybe AnomalyTimeRange
anomalyTimeRange) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalyTimeRange
a -> ReactiveAnomaly
s {$sel:anomalyTimeRange:ReactiveAnomaly' :: Maybe AnomalyTimeRange
anomalyTimeRange = Maybe AnomalyTimeRange
a} :: ReactiveAnomaly)

-- | The ID of the insight that contains this anomaly. An insight is composed
-- of related anomalies.
reactiveAnomaly_associatedInsightId :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe Prelude.Text)
reactiveAnomaly_associatedInsightId :: Lens' ReactiveAnomaly (Maybe Text)
reactiveAnomaly_associatedInsightId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe Text
associatedInsightId :: Maybe Text
$sel:associatedInsightId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
associatedInsightId} -> Maybe Text
associatedInsightId) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe Text
a -> ReactiveAnomaly
s {$sel:associatedInsightId:ReactiveAnomaly' :: Maybe Text
associatedInsightId = Maybe Text
a} :: ReactiveAnomaly)

-- | The ID of the causal anomaly that is associated with this reactive
-- anomaly. The ID of a \`CAUSAL\` anomaly is always \`NULL\`.
reactiveAnomaly_causalAnomalyId :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe Prelude.Text)
reactiveAnomaly_causalAnomalyId :: Lens' ReactiveAnomaly (Maybe Text)
reactiveAnomaly_causalAnomalyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe Text
causalAnomalyId :: Maybe Text
$sel:causalAnomalyId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
causalAnomalyId} -> Maybe Text
causalAnomalyId) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe Text
a -> ReactiveAnomaly
s {$sel:causalAnomalyId:ReactiveAnomaly' :: Maybe Text
causalAnomalyId = Maybe Text
a} :: ReactiveAnomaly)

-- | A description of the reactive anomaly.
reactiveAnomaly_description :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe Prelude.Text)
reactiveAnomaly_description :: Lens' ReactiveAnomaly (Maybe Text)
reactiveAnomaly_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe Text
description :: Maybe Text
$sel:description:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
description} -> Maybe Text
description) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe Text
a -> ReactiveAnomaly
s {$sel:description:ReactiveAnomaly' :: Maybe Text
description = Maybe Text
a} :: ReactiveAnomaly)

-- | The ID of the reactive anomaly.
reactiveAnomaly_id :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe Prelude.Text)
reactiveAnomaly_id :: Lens' ReactiveAnomaly (Maybe Text)
reactiveAnomaly_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe Text
id :: Maybe Text
$sel:id:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
id} -> Maybe Text
id) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe Text
a -> ReactiveAnomaly
s {$sel:id:ReactiveAnomaly' :: Maybe Text
id = Maybe Text
a} :: ReactiveAnomaly)

-- | The name of the reactive anomaly.
reactiveAnomaly_name :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe Prelude.Text)
reactiveAnomaly_name :: Lens' ReactiveAnomaly (Maybe Text)
reactiveAnomaly_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe Text
name :: Maybe Text
$sel:name:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
name} -> Maybe Text
name) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe Text
a -> ReactiveAnomaly
s {$sel:name:ReactiveAnomaly' :: Maybe Text
name = Maybe Text
a} :: ReactiveAnomaly)

-- | Undocumented member.
reactiveAnomaly_resourceCollection :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe ResourceCollection)
reactiveAnomaly_resourceCollection :: Lens' ReactiveAnomaly (Maybe ResourceCollection)
reactiveAnomaly_resourceCollection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe ResourceCollection
resourceCollection :: Maybe ResourceCollection
$sel:resourceCollection:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe ResourceCollection
resourceCollection} -> Maybe ResourceCollection
resourceCollection) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe ResourceCollection
a -> ReactiveAnomaly
s {$sel:resourceCollection:ReactiveAnomaly' :: Maybe ResourceCollection
resourceCollection = Maybe ResourceCollection
a} :: ReactiveAnomaly)

-- | The severity of the anomaly. The severity of anomalies that generate an
-- insight determine that insight\'s severity. For more information, see
-- <https://docs.aws.amazon.com/devops-guru/latest/userguide/working-with-insights.html#understanding-insights-severities Understanding insight severities>
-- in the /Amazon DevOps Guru User Guide/.
reactiveAnomaly_severity :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalySeverity)
reactiveAnomaly_severity :: Lens' ReactiveAnomaly (Maybe AnomalySeverity)
reactiveAnomaly_severity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalySeverity
severity :: Maybe AnomalySeverity
$sel:severity:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySeverity
severity} -> Maybe AnomalySeverity
severity) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalySeverity
a -> ReactiveAnomaly
s {$sel:severity:ReactiveAnomaly' :: Maybe AnomalySeverity
severity = Maybe AnomalySeverity
a} :: ReactiveAnomaly)

-- | Details about the source of the analyzed operational data that triggered
-- the anomaly. The one supported source is Amazon CloudWatch metrics.
reactiveAnomaly_sourceDetails :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalySourceDetails)
reactiveAnomaly_sourceDetails :: Lens' ReactiveAnomaly (Maybe AnomalySourceDetails)
reactiveAnomaly_sourceDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalySourceDetails
sourceDetails :: Maybe AnomalySourceDetails
$sel:sourceDetails:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySourceDetails
sourceDetails} -> Maybe AnomalySourceDetails
sourceDetails) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalySourceDetails
a -> ReactiveAnomaly
s {$sel:sourceDetails:ReactiveAnomaly' :: Maybe AnomalySourceDetails
sourceDetails = Maybe AnomalySourceDetails
a} :: ReactiveAnomaly)

-- | The status of the anomaly.
reactiveAnomaly_status :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalyStatus)
reactiveAnomaly_status :: Lens' ReactiveAnomaly (Maybe AnomalyStatus)
reactiveAnomaly_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalyStatus
status :: Maybe AnomalyStatus
$sel:status:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyStatus
status} -> Maybe AnomalyStatus
status) (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalyStatus
a -> ReactiveAnomaly
s {$sel:status:ReactiveAnomaly' :: Maybe AnomalyStatus
status = Maybe AnomalyStatus
a} :: ReactiveAnomaly)

-- | The type of the reactive anomaly. It can be one of the following types.
--
-- -   @CAUSAL@ - the anomaly can cause a new insight.
--
-- -   @CONTEXTUAL@ - the anomaly contains additional information about an
--     insight or its causal anomaly.
reactiveAnomaly_type :: Lens.Lens' ReactiveAnomaly (Prelude.Maybe AnomalyType)
reactiveAnomaly_type :: Lens' ReactiveAnomaly (Maybe AnomalyType)
reactiveAnomaly_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveAnomaly' {Maybe AnomalyType
type' :: Maybe AnomalyType
$sel:type':ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyType
type'} -> Maybe AnomalyType
type') (\s :: ReactiveAnomaly
s@ReactiveAnomaly' {} Maybe AnomalyType
a -> ReactiveAnomaly
s {$sel:type':ReactiveAnomaly' :: Maybe AnomalyType
type' = Maybe AnomalyType
a} :: ReactiveAnomaly)

instance Data.FromJSON ReactiveAnomaly where
  parseJSON :: Value -> Parser ReactiveAnomaly
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReactiveAnomaly"
      ( \Object
x ->
          Maybe AnomalyReportedTimeRange
-> Maybe [AnomalyResource]
-> Maybe AnomalyTimeRange
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceCollection
-> Maybe AnomalySeverity
-> Maybe AnomalySourceDetails
-> Maybe AnomalyStatus
-> Maybe AnomalyType
-> ReactiveAnomaly
ReactiveAnomaly'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AnomalyReportedTimeRange")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AnomalyResources"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AnomalyTimeRange")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssociatedInsightId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CausalAnomalyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceCollection")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Severity")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SourceDetails")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
      )

instance Prelude.Hashable ReactiveAnomaly where
  hashWithSalt :: Int -> ReactiveAnomaly -> Int
hashWithSalt Int
_salt ReactiveAnomaly' {Maybe [AnomalyResource]
Maybe Text
Maybe AnomalyReportedTimeRange
Maybe AnomalySeverity
Maybe AnomalyStatus
Maybe AnomalyTimeRange
Maybe AnomalyType
Maybe ResourceCollection
Maybe AnomalySourceDetails
type' :: Maybe AnomalyType
status :: Maybe AnomalyStatus
sourceDetails :: Maybe AnomalySourceDetails
severity :: Maybe AnomalySeverity
resourceCollection :: Maybe ResourceCollection
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
causalAnomalyId :: Maybe Text
associatedInsightId :: Maybe Text
anomalyTimeRange :: Maybe AnomalyTimeRange
anomalyResources :: Maybe [AnomalyResource]
anomalyReportedTimeRange :: Maybe AnomalyReportedTimeRange
$sel:type':ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyType
$sel:status:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyStatus
$sel:sourceDetails:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySourceDetails
$sel:severity:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySeverity
$sel:resourceCollection:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe ResourceCollection
$sel:name:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:id:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:description:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:causalAnomalyId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:associatedInsightId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:anomalyTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyTimeRange
$sel:anomalyResources:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe [AnomalyResource]
$sel:anomalyReportedTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyReportedTimeRange
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AnomalyResource]
anomalyResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyTimeRange
anomalyTimeRange
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associatedInsightId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
causalAnomalyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceCollection
resourceCollection
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalySeverity
severity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalySourceDetails
sourceDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnomalyType
type'

instance Prelude.NFData ReactiveAnomaly where
  rnf :: ReactiveAnomaly -> ()
rnf ReactiveAnomaly' {Maybe [AnomalyResource]
Maybe Text
Maybe AnomalyReportedTimeRange
Maybe AnomalySeverity
Maybe AnomalyStatus
Maybe AnomalyTimeRange
Maybe AnomalyType
Maybe ResourceCollection
Maybe AnomalySourceDetails
type' :: Maybe AnomalyType
status :: Maybe AnomalyStatus
sourceDetails :: Maybe AnomalySourceDetails
severity :: Maybe AnomalySeverity
resourceCollection :: Maybe ResourceCollection
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
causalAnomalyId :: Maybe Text
associatedInsightId :: Maybe Text
anomalyTimeRange :: Maybe AnomalyTimeRange
anomalyResources :: Maybe [AnomalyResource]
anomalyReportedTimeRange :: Maybe AnomalyReportedTimeRange
$sel:type':ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyType
$sel:status:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyStatus
$sel:sourceDetails:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySourceDetails
$sel:severity:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalySeverity
$sel:resourceCollection:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe ResourceCollection
$sel:name:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:id:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:description:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:causalAnomalyId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:associatedInsightId:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe Text
$sel:anomalyTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyTimeRange
$sel:anomalyResources:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe [AnomalyResource]
$sel:anomalyReportedTimeRange:ReactiveAnomaly' :: ReactiveAnomaly -> Maybe AnomalyReportedTimeRange
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyReportedTimeRange
anomalyReportedTimeRange
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AnomalyResource]
anomalyResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyTimeRange
anomalyTimeRange
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associatedInsightId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
causalAnomalyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceCollection
resourceCollection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalySeverity
severity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalySourceDetails
sourceDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnomalyType
type'