{-# 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.APIGateway.Types.DeploymentCanarySettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeploymentCanarySettings = DeploymentCanarySettings'
{
DeploymentCanarySettings -> Maybe (HashMap Text Text)
stageVariableOverrides :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DeploymentCanarySettings -> Maybe Bool
useStageCache :: Prelude.Maybe Prelude.Bool,
DeploymentCanarySettings -> Maybe Double
percentTraffic :: Prelude.Maybe Prelude.Double
}
deriving (DeploymentCanarySettings -> DeploymentCanarySettings -> Bool
(DeploymentCanarySettings -> DeploymentCanarySettings -> Bool)
-> (DeploymentCanarySettings -> DeploymentCanarySettings -> Bool)
-> Eq DeploymentCanarySettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentCanarySettings -> DeploymentCanarySettings -> Bool
$c/= :: DeploymentCanarySettings -> DeploymentCanarySettings -> Bool
== :: DeploymentCanarySettings -> DeploymentCanarySettings -> Bool
$c== :: DeploymentCanarySettings -> DeploymentCanarySettings -> Bool
Prelude.Eq, ReadPrec [DeploymentCanarySettings]
ReadPrec DeploymentCanarySettings
Int -> ReadS DeploymentCanarySettings
ReadS [DeploymentCanarySettings]
(Int -> ReadS DeploymentCanarySettings)
-> ReadS [DeploymentCanarySettings]
-> ReadPrec DeploymentCanarySettings
-> ReadPrec [DeploymentCanarySettings]
-> Read DeploymentCanarySettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentCanarySettings]
$creadListPrec :: ReadPrec [DeploymentCanarySettings]
readPrec :: ReadPrec DeploymentCanarySettings
$creadPrec :: ReadPrec DeploymentCanarySettings
readList :: ReadS [DeploymentCanarySettings]
$creadList :: ReadS [DeploymentCanarySettings]
readsPrec :: Int -> ReadS DeploymentCanarySettings
$creadsPrec :: Int -> ReadS DeploymentCanarySettings
Prelude.Read, Int -> DeploymentCanarySettings -> ShowS
[DeploymentCanarySettings] -> ShowS
DeploymentCanarySettings -> String
(Int -> DeploymentCanarySettings -> ShowS)
-> (DeploymentCanarySettings -> String)
-> ([DeploymentCanarySettings] -> ShowS)
-> Show DeploymentCanarySettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentCanarySettings] -> ShowS
$cshowList :: [DeploymentCanarySettings] -> ShowS
show :: DeploymentCanarySettings -> String
$cshow :: DeploymentCanarySettings -> String
showsPrec :: Int -> DeploymentCanarySettings -> ShowS
$cshowsPrec :: Int -> DeploymentCanarySettings -> ShowS
Prelude.Show, (forall x.
DeploymentCanarySettings -> Rep DeploymentCanarySettings x)
-> (forall x.
Rep DeploymentCanarySettings x -> DeploymentCanarySettings)
-> Generic DeploymentCanarySettings
forall x.
Rep DeploymentCanarySettings x -> DeploymentCanarySettings
forall x.
DeploymentCanarySettings -> Rep DeploymentCanarySettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeploymentCanarySettings x -> DeploymentCanarySettings
$cfrom :: forall x.
DeploymentCanarySettings -> Rep DeploymentCanarySettings x
Prelude.Generic)
newDeploymentCanarySettings ::
DeploymentCanarySettings
newDeploymentCanarySettings :: DeploymentCanarySettings
newDeploymentCanarySettings =
DeploymentCanarySettings' :: Maybe (HashMap Text Text)
-> Maybe Bool -> Maybe Double -> DeploymentCanarySettings
DeploymentCanarySettings'
{ $sel:stageVariableOverrides:DeploymentCanarySettings' :: Maybe (HashMap Text Text)
stageVariableOverrides =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:useStageCache:DeploymentCanarySettings' :: Maybe Bool
useStageCache = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:percentTraffic:DeploymentCanarySettings' :: Maybe Double
percentTraffic = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
deploymentCanarySettings_stageVariableOverrides :: Lens.Lens' DeploymentCanarySettings (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
deploymentCanarySettings_stageVariableOverrides :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DeploymentCanarySettings -> f DeploymentCanarySettings
deploymentCanarySettings_stageVariableOverrides = (DeploymentCanarySettings -> Maybe (HashMap Text Text))
-> (DeploymentCanarySettings
-> Maybe (HashMap Text Text) -> DeploymentCanarySettings)
-> Lens
DeploymentCanarySettings
DeploymentCanarySettings
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentCanarySettings' {Maybe (HashMap Text Text)
stageVariableOverrides :: Maybe (HashMap Text Text)
$sel:stageVariableOverrides:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe (HashMap Text Text)
stageVariableOverrides} -> Maybe (HashMap Text Text)
stageVariableOverrides) (\s :: DeploymentCanarySettings
s@DeploymentCanarySettings' {} Maybe (HashMap Text Text)
a -> DeploymentCanarySettings
s {$sel:stageVariableOverrides:DeploymentCanarySettings' :: Maybe (HashMap Text Text)
stageVariableOverrides = Maybe (HashMap Text Text)
a} :: DeploymentCanarySettings) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DeploymentCanarySettings -> f DeploymentCanarySettings)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DeploymentCanarySettings
-> f DeploymentCanarySettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deploymentCanarySettings_useStageCache :: Lens.Lens' DeploymentCanarySettings (Prelude.Maybe Prelude.Bool)
deploymentCanarySettings_useStageCache :: (Maybe Bool -> f (Maybe Bool))
-> DeploymentCanarySettings -> f DeploymentCanarySettings
deploymentCanarySettings_useStageCache = (DeploymentCanarySettings -> Maybe Bool)
-> (DeploymentCanarySettings
-> Maybe Bool -> DeploymentCanarySettings)
-> Lens
DeploymentCanarySettings
DeploymentCanarySettings
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentCanarySettings' {Maybe Bool
useStageCache :: Maybe Bool
$sel:useStageCache:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe Bool
useStageCache} -> Maybe Bool
useStageCache) (\s :: DeploymentCanarySettings
s@DeploymentCanarySettings' {} Maybe Bool
a -> DeploymentCanarySettings
s {$sel:useStageCache:DeploymentCanarySettings' :: Maybe Bool
useStageCache = Maybe Bool
a} :: DeploymentCanarySettings)
deploymentCanarySettings_percentTraffic :: Lens.Lens' DeploymentCanarySettings (Prelude.Maybe Prelude.Double)
deploymentCanarySettings_percentTraffic :: (Maybe Double -> f (Maybe Double))
-> DeploymentCanarySettings -> f DeploymentCanarySettings
deploymentCanarySettings_percentTraffic = (DeploymentCanarySettings -> Maybe Double)
-> (DeploymentCanarySettings
-> Maybe Double -> DeploymentCanarySettings)
-> Lens
DeploymentCanarySettings
DeploymentCanarySettings
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentCanarySettings' {Maybe Double
percentTraffic :: Maybe Double
$sel:percentTraffic:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe Double
percentTraffic} -> Maybe Double
percentTraffic) (\s :: DeploymentCanarySettings
s@DeploymentCanarySettings' {} Maybe Double
a -> DeploymentCanarySettings
s {$sel:percentTraffic:DeploymentCanarySettings' :: Maybe Double
percentTraffic = Maybe Double
a} :: DeploymentCanarySettings)
instance Prelude.Hashable DeploymentCanarySettings
instance Prelude.NFData DeploymentCanarySettings
instance Core.ToJSON DeploymentCanarySettings where
toJSON :: DeploymentCanarySettings -> Value
toJSON DeploymentCanarySettings' {Maybe Bool
Maybe Double
Maybe (HashMap Text Text)
percentTraffic :: Maybe Double
useStageCache :: Maybe Bool
stageVariableOverrides :: Maybe (HashMap Text Text)
$sel:percentTraffic:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe Double
$sel:useStageCache:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe Bool
$sel:stageVariableOverrides:DeploymentCanarySettings' :: DeploymentCanarySettings -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"stageVariableOverrides" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
stageVariableOverrides,
(Text
"useStageCache" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useStageCache,
(Text
"percentTraffic" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
percentTraffic
]
)