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