{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DevOpsGuru.Types.ReactiveInsight where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types.InsightSeverity
import Amazonka.DevOpsGuru.Types.InsightStatus
import Amazonka.DevOpsGuru.Types.InsightTimeRange
import Amazonka.DevOpsGuru.Types.ResourceCollection
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ReactiveInsight = ReactiveInsight'
{
ReactiveInsight -> Maybe InsightStatus
status :: Prelude.Maybe InsightStatus,
ReactiveInsight -> Maybe ResourceCollection
resourceCollection :: Prelude.Maybe ResourceCollection,
ReactiveInsight -> Maybe InsightSeverity
severity :: Prelude.Maybe InsightSeverity,
ReactiveInsight -> Maybe Text
ssmOpsItemId :: Prelude.Maybe Prelude.Text,
ReactiveInsight -> Maybe InsightTimeRange
insightTimeRange :: Prelude.Maybe InsightTimeRange,
ReactiveInsight -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ReactiveInsight -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (ReactiveInsight -> ReactiveInsight -> Bool
(ReactiveInsight -> ReactiveInsight -> Bool)
-> (ReactiveInsight -> ReactiveInsight -> Bool)
-> Eq ReactiveInsight
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactiveInsight -> ReactiveInsight -> Bool
$c/= :: ReactiveInsight -> ReactiveInsight -> Bool
== :: ReactiveInsight -> ReactiveInsight -> Bool
$c== :: ReactiveInsight -> ReactiveInsight -> Bool
Prelude.Eq, ReadPrec [ReactiveInsight]
ReadPrec ReactiveInsight
Int -> ReadS ReactiveInsight
ReadS [ReactiveInsight]
(Int -> ReadS ReactiveInsight)
-> ReadS [ReactiveInsight]
-> ReadPrec ReactiveInsight
-> ReadPrec [ReactiveInsight]
-> Read ReactiveInsight
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReactiveInsight]
$creadListPrec :: ReadPrec [ReactiveInsight]
readPrec :: ReadPrec ReactiveInsight
$creadPrec :: ReadPrec ReactiveInsight
readList :: ReadS [ReactiveInsight]
$creadList :: ReadS [ReactiveInsight]
readsPrec :: Int -> ReadS ReactiveInsight
$creadsPrec :: Int -> ReadS ReactiveInsight
Prelude.Read, Int -> ReactiveInsight -> ShowS
[ReactiveInsight] -> ShowS
ReactiveInsight -> String
(Int -> ReactiveInsight -> ShowS)
-> (ReactiveInsight -> String)
-> ([ReactiveInsight] -> ShowS)
-> Show ReactiveInsight
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactiveInsight] -> ShowS
$cshowList :: [ReactiveInsight] -> ShowS
show :: ReactiveInsight -> String
$cshow :: ReactiveInsight -> String
showsPrec :: Int -> ReactiveInsight -> ShowS
$cshowsPrec :: Int -> ReactiveInsight -> ShowS
Prelude.Show, (forall x. ReactiveInsight -> Rep ReactiveInsight x)
-> (forall x. Rep ReactiveInsight x -> ReactiveInsight)
-> Generic ReactiveInsight
forall x. Rep ReactiveInsight x -> ReactiveInsight
forall x. ReactiveInsight -> Rep ReactiveInsight x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReactiveInsight x -> ReactiveInsight
$cfrom :: forall x. ReactiveInsight -> Rep ReactiveInsight x
Prelude.Generic)
newReactiveInsight ::
ReactiveInsight
newReactiveInsight :: ReactiveInsight
newReactiveInsight =
ReactiveInsight' :: Maybe InsightStatus
-> Maybe ResourceCollection
-> Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight
ReactiveInsight'
{ $sel:status:ReactiveInsight' :: Maybe InsightStatus
status = Maybe InsightStatus
forall a. Maybe a
Prelude.Nothing,
$sel:resourceCollection:ReactiveInsight' :: Maybe ResourceCollection
resourceCollection = Maybe ResourceCollection
forall a. Maybe a
Prelude.Nothing,
$sel:severity:ReactiveInsight' :: Maybe InsightSeverity
severity = Maybe InsightSeverity
forall a. Maybe a
Prelude.Nothing,
$sel:ssmOpsItemId:ReactiveInsight' :: Maybe Text
ssmOpsItemId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:insightTimeRange:ReactiveInsight' :: Maybe InsightTimeRange
insightTimeRange = Maybe InsightTimeRange
forall a. Maybe a
Prelude.Nothing,
$sel:name:ReactiveInsight' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ReactiveInsight' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
reactiveInsight_status :: Lens.Lens' ReactiveInsight (Prelude.Maybe InsightStatus)
reactiveInsight_status :: (Maybe InsightStatus -> f (Maybe InsightStatus))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_status = (ReactiveInsight -> Maybe InsightStatus)
-> (ReactiveInsight -> Maybe InsightStatus -> ReactiveInsight)
-> Lens
ReactiveInsight
ReactiveInsight
(Maybe InsightStatus)
(Maybe InsightStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe InsightStatus
status :: Maybe InsightStatus
$sel:status:ReactiveInsight' :: ReactiveInsight -> Maybe InsightStatus
status} -> Maybe InsightStatus
status) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe InsightStatus
a -> ReactiveInsight
s {$sel:status:ReactiveInsight' :: Maybe InsightStatus
status = Maybe InsightStatus
a} :: ReactiveInsight)
reactiveInsight_resourceCollection :: Lens.Lens' ReactiveInsight (Prelude.Maybe ResourceCollection)
reactiveInsight_resourceCollection :: (Maybe ResourceCollection -> f (Maybe ResourceCollection))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_resourceCollection = (ReactiveInsight -> Maybe ResourceCollection)
-> (ReactiveInsight -> Maybe ResourceCollection -> ReactiveInsight)
-> Lens
ReactiveInsight
ReactiveInsight
(Maybe ResourceCollection)
(Maybe ResourceCollection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe ResourceCollection
resourceCollection :: Maybe ResourceCollection
$sel:resourceCollection:ReactiveInsight' :: ReactiveInsight -> Maybe ResourceCollection
resourceCollection} -> Maybe ResourceCollection
resourceCollection) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe ResourceCollection
a -> ReactiveInsight
s {$sel:resourceCollection:ReactiveInsight' :: Maybe ResourceCollection
resourceCollection = Maybe ResourceCollection
a} :: ReactiveInsight)
reactiveInsight_severity :: Lens.Lens' ReactiveInsight (Prelude.Maybe InsightSeverity)
reactiveInsight_severity :: (Maybe InsightSeverity -> f (Maybe InsightSeverity))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_severity = (ReactiveInsight -> Maybe InsightSeverity)
-> (ReactiveInsight -> Maybe InsightSeverity -> ReactiveInsight)
-> Lens
ReactiveInsight
ReactiveInsight
(Maybe InsightSeverity)
(Maybe InsightSeverity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe InsightSeverity
severity :: Maybe InsightSeverity
$sel:severity:ReactiveInsight' :: ReactiveInsight -> Maybe InsightSeverity
severity} -> Maybe InsightSeverity
severity) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe InsightSeverity
a -> ReactiveInsight
s {$sel:severity:ReactiveInsight' :: Maybe InsightSeverity
severity = Maybe InsightSeverity
a} :: ReactiveInsight)
reactiveInsight_ssmOpsItemId :: Lens.Lens' ReactiveInsight (Prelude.Maybe Prelude.Text)
reactiveInsight_ssmOpsItemId :: (Maybe Text -> f (Maybe Text))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_ssmOpsItemId = (ReactiveInsight -> Maybe Text)
-> (ReactiveInsight -> Maybe Text -> ReactiveInsight)
-> Lens ReactiveInsight ReactiveInsight (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe Text
ssmOpsItemId :: Maybe Text
$sel:ssmOpsItemId:ReactiveInsight' :: ReactiveInsight -> Maybe Text
ssmOpsItemId} -> Maybe Text
ssmOpsItemId) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe Text
a -> ReactiveInsight
s {$sel:ssmOpsItemId:ReactiveInsight' :: Maybe Text
ssmOpsItemId = Maybe Text
a} :: ReactiveInsight)
reactiveInsight_insightTimeRange :: Lens.Lens' ReactiveInsight (Prelude.Maybe InsightTimeRange)
reactiveInsight_insightTimeRange :: (Maybe InsightTimeRange -> f (Maybe InsightTimeRange))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_insightTimeRange = (ReactiveInsight -> Maybe InsightTimeRange)
-> (ReactiveInsight -> Maybe InsightTimeRange -> ReactiveInsight)
-> Lens
ReactiveInsight
ReactiveInsight
(Maybe InsightTimeRange)
(Maybe InsightTimeRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe InsightTimeRange
insightTimeRange :: Maybe InsightTimeRange
$sel:insightTimeRange:ReactiveInsight' :: ReactiveInsight -> Maybe InsightTimeRange
insightTimeRange} -> Maybe InsightTimeRange
insightTimeRange) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe InsightTimeRange
a -> ReactiveInsight
s {$sel:insightTimeRange:ReactiveInsight' :: Maybe InsightTimeRange
insightTimeRange = Maybe InsightTimeRange
a} :: ReactiveInsight)
reactiveInsight_name :: Lens.Lens' ReactiveInsight (Prelude.Maybe Prelude.Text)
reactiveInsight_name :: (Maybe Text -> f (Maybe Text))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_name = (ReactiveInsight -> Maybe Text)
-> (ReactiveInsight -> Maybe Text -> ReactiveInsight)
-> Lens ReactiveInsight ReactiveInsight (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe Text
name :: Maybe Text
$sel:name:ReactiveInsight' :: ReactiveInsight -> Maybe Text
name} -> Maybe Text
name) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe Text
a -> ReactiveInsight
s {$sel:name:ReactiveInsight' :: Maybe Text
name = Maybe Text
a} :: ReactiveInsight)
reactiveInsight_id :: Lens.Lens' ReactiveInsight (Prelude.Maybe Prelude.Text)
reactiveInsight_id :: (Maybe Text -> f (Maybe Text))
-> ReactiveInsight -> f ReactiveInsight
reactiveInsight_id = (ReactiveInsight -> Maybe Text)
-> (ReactiveInsight -> Maybe Text -> ReactiveInsight)
-> Lens ReactiveInsight ReactiveInsight (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactiveInsight' {Maybe Text
id :: Maybe Text
$sel:id:ReactiveInsight' :: ReactiveInsight -> Maybe Text
id} -> Maybe Text
id) (\s :: ReactiveInsight
s@ReactiveInsight' {} Maybe Text
a -> ReactiveInsight
s {$sel:id:ReactiveInsight' :: Maybe Text
id = Maybe Text
a} :: ReactiveInsight)
instance Core.FromJSON ReactiveInsight where
parseJSON :: Value -> Parser ReactiveInsight
parseJSON =
String
-> (Object -> Parser ReactiveInsight)
-> Value
-> Parser ReactiveInsight
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ReactiveInsight"
( \Object
x ->
Maybe InsightStatus
-> Maybe ResourceCollection
-> Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight
ReactiveInsight'
(Maybe InsightStatus
-> Maybe ResourceCollection
-> Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
-> Parser (Maybe InsightStatus)
-> Parser
(Maybe ResourceCollection
-> Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InsightStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe ResourceCollection
-> Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
-> Parser (Maybe ResourceCollection)
-> Parser
(Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceCollection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceCollection")
Parser
(Maybe InsightSeverity
-> Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
-> Parser (Maybe InsightSeverity)
-> Parser
(Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InsightSeverity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Severity")
Parser
(Maybe Text
-> Maybe InsightTimeRange
-> Maybe Text
-> Maybe Text
-> ReactiveInsight)
-> Parser (Maybe Text)
-> Parser
(Maybe InsightTimeRange
-> Maybe Text -> Maybe Text -> ReactiveInsight)
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
"SsmOpsItemId")
Parser
(Maybe InsightTimeRange
-> Maybe Text -> Maybe Text -> ReactiveInsight)
-> Parser (Maybe InsightTimeRange)
-> Parser (Maybe Text -> Maybe Text -> ReactiveInsight)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InsightTimeRange)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InsightTimeRange")
Parser (Maybe Text -> Maybe Text -> ReactiveInsight)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ReactiveInsight)
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
"Name")
Parser (Maybe Text -> ReactiveInsight)
-> Parser (Maybe Text) -> Parser ReactiveInsight
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
"Id")
)
instance Prelude.Hashable ReactiveInsight
instance Prelude.NFData ReactiveInsight