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