{-# 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.ECS.Types.DeploymentAlarms 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
data DeploymentAlarms = DeploymentAlarms'
{
DeploymentAlarms -> [Text]
alarmNames :: [Prelude.Text],
DeploymentAlarms -> Bool
enable :: Prelude.Bool,
DeploymentAlarms -> Bool
rollback :: Prelude.Bool
}
deriving (DeploymentAlarms -> DeploymentAlarms -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentAlarms -> DeploymentAlarms -> Bool
$c/= :: DeploymentAlarms -> DeploymentAlarms -> Bool
== :: DeploymentAlarms -> DeploymentAlarms -> Bool
$c== :: DeploymentAlarms -> DeploymentAlarms -> Bool
Prelude.Eq, ReadPrec [DeploymentAlarms]
ReadPrec DeploymentAlarms
Int -> ReadS DeploymentAlarms
ReadS [DeploymentAlarms]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentAlarms]
$creadListPrec :: ReadPrec [DeploymentAlarms]
readPrec :: ReadPrec DeploymentAlarms
$creadPrec :: ReadPrec DeploymentAlarms
readList :: ReadS [DeploymentAlarms]
$creadList :: ReadS [DeploymentAlarms]
readsPrec :: Int -> ReadS DeploymentAlarms
$creadsPrec :: Int -> ReadS DeploymentAlarms
Prelude.Read, Int -> DeploymentAlarms -> ShowS
[DeploymentAlarms] -> ShowS
DeploymentAlarms -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentAlarms] -> ShowS
$cshowList :: [DeploymentAlarms] -> ShowS
show :: DeploymentAlarms -> String
$cshow :: DeploymentAlarms -> String
showsPrec :: Int -> DeploymentAlarms -> ShowS
$cshowsPrec :: Int -> DeploymentAlarms -> ShowS
Prelude.Show, forall x. Rep DeploymentAlarms x -> DeploymentAlarms
forall x. DeploymentAlarms -> Rep DeploymentAlarms x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentAlarms x -> DeploymentAlarms
$cfrom :: forall x. DeploymentAlarms -> Rep DeploymentAlarms x
Prelude.Generic)
newDeploymentAlarms ::
Prelude.Bool ->
Prelude.Bool ->
DeploymentAlarms
newDeploymentAlarms :: Bool -> Bool -> DeploymentAlarms
newDeploymentAlarms Bool
pEnable_ Bool
pRollback_ =
DeploymentAlarms'
{ $sel:alarmNames:DeploymentAlarms' :: [Text]
alarmNames = forall a. Monoid a => a
Prelude.mempty,
$sel:enable:DeploymentAlarms' :: Bool
enable = Bool
pEnable_,
$sel:rollback:DeploymentAlarms' :: Bool
rollback = Bool
pRollback_
}
deploymentAlarms_alarmNames :: Lens.Lens' DeploymentAlarms [Prelude.Text]
deploymentAlarms_alarmNames :: Lens' DeploymentAlarms [Text]
deploymentAlarms_alarmNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentAlarms' {[Text]
alarmNames :: [Text]
$sel:alarmNames:DeploymentAlarms' :: DeploymentAlarms -> [Text]
alarmNames} -> [Text]
alarmNames) (\s :: DeploymentAlarms
s@DeploymentAlarms' {} [Text]
a -> DeploymentAlarms
s {$sel:alarmNames:DeploymentAlarms' :: [Text]
alarmNames = [Text]
a} :: DeploymentAlarms) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deploymentAlarms_enable :: Lens.Lens' DeploymentAlarms Prelude.Bool
deploymentAlarms_enable :: Lens' DeploymentAlarms Bool
deploymentAlarms_enable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentAlarms' {Bool
enable :: Bool
$sel:enable:DeploymentAlarms' :: DeploymentAlarms -> Bool
enable} -> Bool
enable) (\s :: DeploymentAlarms
s@DeploymentAlarms' {} Bool
a -> DeploymentAlarms
s {$sel:enable:DeploymentAlarms' :: Bool
enable = Bool
a} :: DeploymentAlarms)
deploymentAlarms_rollback :: Lens.Lens' DeploymentAlarms Prelude.Bool
deploymentAlarms_rollback :: Lens' DeploymentAlarms Bool
deploymentAlarms_rollback = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentAlarms' {Bool
rollback :: Bool
$sel:rollback:DeploymentAlarms' :: DeploymentAlarms -> Bool
rollback} -> Bool
rollback) (\s :: DeploymentAlarms
s@DeploymentAlarms' {} Bool
a -> DeploymentAlarms
s {$sel:rollback:DeploymentAlarms' :: Bool
rollback = Bool
a} :: DeploymentAlarms)
instance Data.FromJSON DeploymentAlarms where
parseJSON :: Value -> Parser DeploymentAlarms
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeploymentAlarms"
( \Object
x ->
[Text] -> Bool -> Bool -> DeploymentAlarms
DeploymentAlarms'
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
"alarmNames" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"enable")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"rollback")
)
instance Prelude.Hashable DeploymentAlarms where
hashWithSalt :: Int -> DeploymentAlarms -> Int
hashWithSalt Int
_salt DeploymentAlarms' {Bool
[Text]
rollback :: Bool
enable :: Bool
alarmNames :: [Text]
$sel:rollback:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:enable:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:alarmNames:DeploymentAlarms' :: DeploymentAlarms -> [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
alarmNames
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enable
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
rollback
instance Prelude.NFData DeploymentAlarms where
rnf :: DeploymentAlarms -> ()
rnf DeploymentAlarms' {Bool
[Text]
rollback :: Bool
enable :: Bool
alarmNames :: [Text]
$sel:rollback:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:enable:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:alarmNames:DeploymentAlarms' :: DeploymentAlarms -> [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [Text]
alarmNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enable
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
rollback
instance Data.ToJSON DeploymentAlarms where
toJSON :: DeploymentAlarms -> Value
toJSON DeploymentAlarms' {Bool
[Text]
rollback :: Bool
enable :: Bool
alarmNames :: [Text]
$sel:rollback:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:enable:DeploymentAlarms' :: DeploymentAlarms -> Bool
$sel:alarmNames:DeploymentAlarms' :: DeploymentAlarms -> [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"alarmNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
alarmNames),
forall a. a -> Maybe a
Prelude.Just (Key
"enable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enable),
forall a. a -> Maybe a
Prelude.Just (Key
"rollback" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
rollback)
]
)