{-# 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.ItemValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.PagerDutyIncidentDetail
data ItemValue = ItemValue'
{
ItemValue -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ItemValue -> Maybe Text
metricDefinition :: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe PagerDutyIncidentDetail,
ItemValue -> Maybe Text
url :: Prelude.Maybe Prelude.Text
}
deriving (ItemValue -> ItemValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ItemValue -> ItemValue -> Bool
$c/= :: ItemValue -> ItemValue -> Bool
== :: ItemValue -> ItemValue -> Bool
$c== :: ItemValue -> ItemValue -> Bool
Prelude.Eq, ReadPrec [ItemValue]
ReadPrec ItemValue
Int -> ReadS ItemValue
ReadS [ItemValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ItemValue]
$creadListPrec :: ReadPrec [ItemValue]
readPrec :: ReadPrec ItemValue
$creadPrec :: ReadPrec ItemValue
readList :: ReadS [ItemValue]
$creadList :: ReadS [ItemValue]
readsPrec :: Int -> ReadS ItemValue
$creadsPrec :: Int -> ReadS ItemValue
Prelude.Read, Int -> ItemValue -> ShowS
[ItemValue] -> ShowS
ItemValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ItemValue] -> ShowS
$cshowList :: [ItemValue] -> ShowS
show :: ItemValue -> String
$cshow :: ItemValue -> String
showsPrec :: Int -> ItemValue -> ShowS
$cshowsPrec :: Int -> ItemValue -> ShowS
Prelude.Show, forall x. Rep ItemValue x -> ItemValue
forall x. ItemValue -> Rep ItemValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ItemValue x -> ItemValue
$cfrom :: forall x. ItemValue -> Rep ItemValue x
Prelude.Generic)
newItemValue ::
ItemValue
newItemValue :: ItemValue
newItemValue =
ItemValue'
{ $sel:arn:ItemValue' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:metricDefinition:ItemValue' :: Maybe Text
metricDefinition = forall a. Maybe a
Prelude.Nothing,
$sel:pagerDutyIncidentDetail:ItemValue' :: Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail = forall a. Maybe a
Prelude.Nothing,
$sel:url:ItemValue' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
}
itemValue_arn :: Lens.Lens' ItemValue (Prelude.Maybe Prelude.Text)
itemValue_arn :: Lens' ItemValue (Maybe Text)
itemValue_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemValue' {Maybe Text
arn :: Maybe Text
$sel:arn:ItemValue' :: ItemValue -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ItemValue
s@ItemValue' {} Maybe Text
a -> ItemValue
s {$sel:arn:ItemValue' :: Maybe Text
arn = Maybe Text
a} :: ItemValue)
itemValue_metricDefinition :: Lens.Lens' ItemValue (Prelude.Maybe Prelude.Text)
itemValue_metricDefinition :: Lens' ItemValue (Maybe Text)
itemValue_metricDefinition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemValue' {Maybe Text
metricDefinition :: Maybe Text
$sel:metricDefinition:ItemValue' :: ItemValue -> Maybe Text
metricDefinition} -> Maybe Text
metricDefinition) (\s :: ItemValue
s@ItemValue' {} Maybe Text
a -> ItemValue
s {$sel:metricDefinition:ItemValue' :: Maybe Text
metricDefinition = Maybe Text
a} :: ItemValue)
itemValue_pagerDutyIncidentDetail :: Lens.Lens' ItemValue (Prelude.Maybe PagerDutyIncidentDetail)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemValue' {Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail :: Maybe PagerDutyIncidentDetail
$sel:pagerDutyIncidentDetail:ItemValue' :: ItemValue -> Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail} -> Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail) (\s :: ItemValue
s@ItemValue' {} Maybe PagerDutyIncidentDetail
a -> ItemValue
s {$sel:pagerDutyIncidentDetail:ItemValue' :: Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail = Maybe PagerDutyIncidentDetail
a} :: ItemValue)
itemValue_url :: Lens.Lens' ItemValue (Prelude.Maybe Prelude.Text)
itemValue_url :: Lens' ItemValue (Maybe Text)
itemValue_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemValue' {Maybe Text
url :: Maybe Text
$sel:url:ItemValue' :: ItemValue -> Maybe Text
url} -> Maybe Text
url) (\s :: ItemValue
s@ItemValue' {} Maybe Text
a -> ItemValue
s {$sel:url:ItemValue' :: Maybe Text
url = Maybe Text
a} :: ItemValue)
instance Data.FromJSON ItemValue where
parseJSON :: Value -> Parser ItemValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ItemValue"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe PagerDutyIncidentDetail
-> Maybe Text
-> ItemValue
ItemValue'
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
"arn")
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
"metricDefinition")
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
"pagerDutyIncidentDetail")
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
"url")
)
instance Prelude.Hashable ItemValue where
hashWithSalt :: Int -> ItemValue -> Int
hashWithSalt Int
_salt ItemValue' {Maybe Text
Maybe PagerDutyIncidentDetail
url :: Maybe Text
pagerDutyIncidentDetail :: Maybe PagerDutyIncidentDetail
metricDefinition :: Maybe Text
arn :: Maybe Text
$sel:url:ItemValue' :: ItemValue -> Maybe Text
$sel:pagerDutyIncidentDetail:ItemValue' :: ItemValue -> Maybe PagerDutyIncidentDetail
$sel:metricDefinition:ItemValue' :: ItemValue -> Maybe Text
$sel:arn:ItemValue' :: ItemValue -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricDefinition
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
instance Prelude.NFData ItemValue where
rnf :: ItemValue -> ()
rnf ItemValue' {Maybe Text
Maybe PagerDutyIncidentDetail
url :: Maybe Text
pagerDutyIncidentDetail :: Maybe PagerDutyIncidentDetail
metricDefinition :: Maybe Text
arn :: Maybe Text
$sel:url:ItemValue' :: ItemValue -> Maybe Text
$sel:pagerDutyIncidentDetail:ItemValue' :: ItemValue -> Maybe PagerDutyIncidentDetail
$sel:metricDefinition:ItemValue' :: ItemValue -> Maybe Text
$sel:arn:ItemValue' :: ItemValue -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricDefinition
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url
instance Data.ToJSON ItemValue where
toJSON :: ItemValue -> Value
toJSON ItemValue' {Maybe Text
Maybe PagerDutyIncidentDetail
url :: Maybe Text
pagerDutyIncidentDetail :: Maybe PagerDutyIncidentDetail
metricDefinition :: Maybe Text
arn :: Maybe Text
$sel:url:ItemValue' :: ItemValue -> Maybe Text
$sel:pagerDutyIncidentDetail:ItemValue' :: ItemValue -> Maybe PagerDutyIncidentDetail
$sel:metricDefinition:ItemValue' :: ItemValue -> Maybe Text
$sel:arn:ItemValue' :: ItemValue -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
arn,
(Key
"metricDefinition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
metricDefinition,
(Key
"pagerDutyIncidentDetail" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PagerDutyIncidentDetail
pagerDutyIncidentDetail,
(Key
"url" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
url
]
)