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