{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SSMIncidents.Types.IncidentRecordSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IncidentRecordSource = IncidentRecordSource'
{
IncidentRecordSource -> Maybe Text
invokedBy :: Prelude.Maybe Prelude.Text,
IncidentRecordSource -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
IncidentRecordSource -> Text
createdBy :: Prelude.Text,
IncidentRecordSource -> Text
source :: Prelude.Text
}
deriving (IncidentRecordSource -> IncidentRecordSource -> Bool
(IncidentRecordSource -> IncidentRecordSource -> Bool)
-> (IncidentRecordSource -> IncidentRecordSource -> Bool)
-> Eq IncidentRecordSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IncidentRecordSource -> IncidentRecordSource -> Bool
$c/= :: IncidentRecordSource -> IncidentRecordSource -> Bool
== :: IncidentRecordSource -> IncidentRecordSource -> Bool
$c== :: IncidentRecordSource -> IncidentRecordSource -> Bool
Prelude.Eq, ReadPrec [IncidentRecordSource]
ReadPrec IncidentRecordSource
Int -> ReadS IncidentRecordSource
ReadS [IncidentRecordSource]
(Int -> ReadS IncidentRecordSource)
-> ReadS [IncidentRecordSource]
-> ReadPrec IncidentRecordSource
-> ReadPrec [IncidentRecordSource]
-> Read IncidentRecordSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IncidentRecordSource]
$creadListPrec :: ReadPrec [IncidentRecordSource]
readPrec :: ReadPrec IncidentRecordSource
$creadPrec :: ReadPrec IncidentRecordSource
readList :: ReadS [IncidentRecordSource]
$creadList :: ReadS [IncidentRecordSource]
readsPrec :: Int -> ReadS IncidentRecordSource
$creadsPrec :: Int -> ReadS IncidentRecordSource
Prelude.Read, Int -> IncidentRecordSource -> ShowS
[IncidentRecordSource] -> ShowS
IncidentRecordSource -> String
(Int -> IncidentRecordSource -> ShowS)
-> (IncidentRecordSource -> String)
-> ([IncidentRecordSource] -> ShowS)
-> Show IncidentRecordSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IncidentRecordSource] -> ShowS
$cshowList :: [IncidentRecordSource] -> ShowS
show :: IncidentRecordSource -> String
$cshow :: IncidentRecordSource -> String
showsPrec :: Int -> IncidentRecordSource -> ShowS
$cshowsPrec :: Int -> IncidentRecordSource -> ShowS
Prelude.Show, (forall x. IncidentRecordSource -> Rep IncidentRecordSource x)
-> (forall x. Rep IncidentRecordSource x -> IncidentRecordSource)
-> Generic IncidentRecordSource
forall x. Rep IncidentRecordSource x -> IncidentRecordSource
forall x. IncidentRecordSource -> Rep IncidentRecordSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IncidentRecordSource x -> IncidentRecordSource
$cfrom :: forall x. IncidentRecordSource -> Rep IncidentRecordSource x
Prelude.Generic)
newIncidentRecordSource ::
Prelude.Text ->
Prelude.Text ->
IncidentRecordSource
newIncidentRecordSource :: Text -> Text -> IncidentRecordSource
newIncidentRecordSource Text
pCreatedBy_ Text
pSource_ =
IncidentRecordSource' :: Maybe Text -> Maybe Text -> Text -> Text -> IncidentRecordSource
IncidentRecordSource'
{ $sel:invokedBy:IncidentRecordSource' :: Maybe Text
invokedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:IncidentRecordSource' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdBy:IncidentRecordSource' :: Text
createdBy = Text
pCreatedBy_,
$sel:source:IncidentRecordSource' :: Text
source = Text
pSource_
}
incidentRecordSource_invokedBy :: Lens.Lens' IncidentRecordSource (Prelude.Maybe Prelude.Text)
incidentRecordSource_invokedBy :: (Maybe Text -> f (Maybe Text))
-> IncidentRecordSource -> f IncidentRecordSource
incidentRecordSource_invokedBy = (IncidentRecordSource -> Maybe Text)
-> (IncidentRecordSource -> Maybe Text -> IncidentRecordSource)
-> Lens
IncidentRecordSource IncidentRecordSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSource' {Maybe Text
invokedBy :: Maybe Text
$sel:invokedBy:IncidentRecordSource' :: IncidentRecordSource -> Maybe Text
invokedBy} -> Maybe Text
invokedBy) (\s :: IncidentRecordSource
s@IncidentRecordSource' {} Maybe Text
a -> IncidentRecordSource
s {$sel:invokedBy:IncidentRecordSource' :: Maybe Text
invokedBy = Maybe Text
a} :: IncidentRecordSource)
incidentRecordSource_resourceArn :: Lens.Lens' IncidentRecordSource (Prelude.Maybe Prelude.Text)
incidentRecordSource_resourceArn :: (Maybe Text -> f (Maybe Text))
-> IncidentRecordSource -> f IncidentRecordSource
incidentRecordSource_resourceArn = (IncidentRecordSource -> Maybe Text)
-> (IncidentRecordSource -> Maybe Text -> IncidentRecordSource)
-> Lens
IncidentRecordSource IncidentRecordSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSource' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:IncidentRecordSource' :: IncidentRecordSource -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: IncidentRecordSource
s@IncidentRecordSource' {} Maybe Text
a -> IncidentRecordSource
s {$sel:resourceArn:IncidentRecordSource' :: Maybe Text
resourceArn = Maybe Text
a} :: IncidentRecordSource)
incidentRecordSource_createdBy :: Lens.Lens' IncidentRecordSource Prelude.Text
incidentRecordSource_createdBy :: (Text -> f Text) -> IncidentRecordSource -> f IncidentRecordSource
incidentRecordSource_createdBy = (IncidentRecordSource -> Text)
-> (IncidentRecordSource -> Text -> IncidentRecordSource)
-> Lens IncidentRecordSource IncidentRecordSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSource' {Text
createdBy :: Text
$sel:createdBy:IncidentRecordSource' :: IncidentRecordSource -> Text
createdBy} -> Text
createdBy) (\s :: IncidentRecordSource
s@IncidentRecordSource' {} Text
a -> IncidentRecordSource
s {$sel:createdBy:IncidentRecordSource' :: Text
createdBy = Text
a} :: IncidentRecordSource)
incidentRecordSource_source :: Lens.Lens' IncidentRecordSource Prelude.Text
incidentRecordSource_source :: (Text -> f Text) -> IncidentRecordSource -> f IncidentRecordSource
incidentRecordSource_source = (IncidentRecordSource -> Text)
-> (IncidentRecordSource -> Text -> IncidentRecordSource)
-> Lens IncidentRecordSource IncidentRecordSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncidentRecordSource' {Text
source :: Text
$sel:source:IncidentRecordSource' :: IncidentRecordSource -> Text
source} -> Text
source) (\s :: IncidentRecordSource
s@IncidentRecordSource' {} Text
a -> IncidentRecordSource
s {$sel:source:IncidentRecordSource' :: Text
source = Text
a} :: IncidentRecordSource)
instance Core.FromJSON IncidentRecordSource where
parseJSON :: Value -> Parser IncidentRecordSource
parseJSON =
String
-> (Object -> Parser IncidentRecordSource)
-> Value
-> Parser IncidentRecordSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IncidentRecordSource"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> Text -> IncidentRecordSource
IncidentRecordSource'
(Maybe Text -> Maybe Text -> Text -> Text -> IncidentRecordSource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> Text -> IncidentRecordSource)
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
"invokedBy")
Parser (Maybe Text -> Text -> Text -> IncidentRecordSource)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> IncidentRecordSource)
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
"resourceArn")
Parser (Text -> Text -> IncidentRecordSource)
-> Parser Text -> Parser (Text -> IncidentRecordSource)
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
"createdBy")
Parser (Text -> IncidentRecordSource)
-> Parser Text -> Parser IncidentRecordSource
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
"source")
)
instance Prelude.Hashable IncidentRecordSource
instance Prelude.NFData IncidentRecordSource