{-# 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.DeploymentStrategy where
import Amazonka.AppConfig.Types.GrowthType
import Amazonka.AppConfig.Types.ReplicateTo
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeploymentStrategy = DeploymentStrategy'
{
DeploymentStrategy -> Maybe Double
growthFactor :: Prelude.Maybe Prelude.Double,
DeploymentStrategy -> Maybe ReplicateTo
replicateTo :: Prelude.Maybe ReplicateTo,
DeploymentStrategy -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DeploymentStrategy -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
DeploymentStrategy -> Maybe Natural
deploymentDurationInMinutes :: Prelude.Maybe Prelude.Natural,
DeploymentStrategy -> Maybe Natural
finalBakeTimeInMinutes :: Prelude.Maybe Prelude.Natural,
DeploymentStrategy -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
DeploymentStrategy -> Maybe GrowthType
growthType :: Prelude.Maybe GrowthType
}
deriving (DeploymentStrategy -> DeploymentStrategy -> Bool
(DeploymentStrategy -> DeploymentStrategy -> Bool)
-> (DeploymentStrategy -> DeploymentStrategy -> Bool)
-> Eq DeploymentStrategy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentStrategy -> DeploymentStrategy -> Bool
$c/= :: DeploymentStrategy -> DeploymentStrategy -> Bool
== :: DeploymentStrategy -> DeploymentStrategy -> Bool
$c== :: DeploymentStrategy -> DeploymentStrategy -> Bool
Prelude.Eq, ReadPrec [DeploymentStrategy]
ReadPrec DeploymentStrategy
Int -> ReadS DeploymentStrategy
ReadS [DeploymentStrategy]
(Int -> ReadS DeploymentStrategy)
-> ReadS [DeploymentStrategy]
-> ReadPrec DeploymentStrategy
-> ReadPrec [DeploymentStrategy]
-> Read DeploymentStrategy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentStrategy]
$creadListPrec :: ReadPrec [DeploymentStrategy]
readPrec :: ReadPrec DeploymentStrategy
$creadPrec :: ReadPrec DeploymentStrategy
readList :: ReadS [DeploymentStrategy]
$creadList :: ReadS [DeploymentStrategy]
readsPrec :: Int -> ReadS DeploymentStrategy
$creadsPrec :: Int -> ReadS DeploymentStrategy
Prelude.Read, Int -> DeploymentStrategy -> ShowS
[DeploymentStrategy] -> ShowS
DeploymentStrategy -> String
(Int -> DeploymentStrategy -> ShowS)
-> (DeploymentStrategy -> String)
-> ([DeploymentStrategy] -> ShowS)
-> Show DeploymentStrategy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentStrategy] -> ShowS
$cshowList :: [DeploymentStrategy] -> ShowS
show :: DeploymentStrategy -> String
$cshow :: DeploymentStrategy -> String
showsPrec :: Int -> DeploymentStrategy -> ShowS
$cshowsPrec :: Int -> DeploymentStrategy -> ShowS
Prelude.Show, (forall x. DeploymentStrategy -> Rep DeploymentStrategy x)
-> (forall x. Rep DeploymentStrategy x -> DeploymentStrategy)
-> Generic DeploymentStrategy
forall x. Rep DeploymentStrategy x -> DeploymentStrategy
forall x. DeploymentStrategy -> Rep DeploymentStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentStrategy x -> DeploymentStrategy
$cfrom :: forall x. DeploymentStrategy -> Rep DeploymentStrategy x
Prelude.Generic)
newDeploymentStrategy ::
DeploymentStrategy
newDeploymentStrategy :: DeploymentStrategy
newDeploymentStrategy =
DeploymentStrategy' :: Maybe Double
-> Maybe ReplicateTo
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy
DeploymentStrategy'
{ $sel:growthFactor:DeploymentStrategy' :: Maybe Double
growthFactor = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:replicateTo:DeploymentStrategy' :: Maybe ReplicateTo
replicateTo = Maybe ReplicateTo
forall a. Maybe a
Prelude.Nothing,
$sel:name:DeploymentStrategy' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DeploymentStrategy' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentDurationInMinutes:DeploymentStrategy' :: Maybe Natural
deploymentDurationInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:finalBakeTimeInMinutes:DeploymentStrategy' :: Maybe Natural
finalBakeTimeInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:description:DeploymentStrategy' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:growthType:DeploymentStrategy' :: Maybe GrowthType
growthType = Maybe GrowthType
forall a. Maybe a
Prelude.Nothing
}
deploymentStrategy_growthFactor :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Double)
deploymentStrategy_growthFactor :: (Maybe Double -> f (Maybe Double))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_growthFactor = (DeploymentStrategy -> Maybe Double)
-> (DeploymentStrategy -> Maybe Double -> DeploymentStrategy)
-> Lens
DeploymentStrategy DeploymentStrategy (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Double
growthFactor :: Maybe Double
$sel:growthFactor:DeploymentStrategy' :: DeploymentStrategy -> Maybe Double
growthFactor} -> Maybe Double
growthFactor) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Double
a -> DeploymentStrategy
s {$sel:growthFactor:DeploymentStrategy' :: Maybe Double
growthFactor = Maybe Double
a} :: DeploymentStrategy)
deploymentStrategy_replicateTo :: Lens.Lens' DeploymentStrategy (Prelude.Maybe ReplicateTo)
deploymentStrategy_replicateTo :: (Maybe ReplicateTo -> f (Maybe ReplicateTo))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_replicateTo = (DeploymentStrategy -> Maybe ReplicateTo)
-> (DeploymentStrategy -> Maybe ReplicateTo -> DeploymentStrategy)
-> Lens
DeploymentStrategy
DeploymentStrategy
(Maybe ReplicateTo)
(Maybe ReplicateTo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe ReplicateTo
replicateTo :: Maybe ReplicateTo
$sel:replicateTo:DeploymentStrategy' :: DeploymentStrategy -> Maybe ReplicateTo
replicateTo} -> Maybe ReplicateTo
replicateTo) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe ReplicateTo
a -> DeploymentStrategy
s {$sel:replicateTo:DeploymentStrategy' :: Maybe ReplicateTo
replicateTo = Maybe ReplicateTo
a} :: DeploymentStrategy)
deploymentStrategy_name :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Text)
deploymentStrategy_name :: (Maybe Text -> f (Maybe Text))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_name = (DeploymentStrategy -> Maybe Text)
-> (DeploymentStrategy -> Maybe Text -> DeploymentStrategy)
-> Lens
DeploymentStrategy DeploymentStrategy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Text
name :: Maybe Text
$sel:name:DeploymentStrategy' :: DeploymentStrategy -> Maybe Text
name} -> Maybe Text
name) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Text
a -> DeploymentStrategy
s {$sel:name:DeploymentStrategy' :: Maybe Text
name = Maybe Text
a} :: DeploymentStrategy)
deploymentStrategy_id :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Text)
deploymentStrategy_id :: (Maybe Text -> f (Maybe Text))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_id = (DeploymentStrategy -> Maybe Text)
-> (DeploymentStrategy -> Maybe Text -> DeploymentStrategy)
-> Lens
DeploymentStrategy DeploymentStrategy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Text
id :: Maybe Text
$sel:id:DeploymentStrategy' :: DeploymentStrategy -> Maybe Text
id} -> Maybe Text
id) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Text
a -> DeploymentStrategy
s {$sel:id:DeploymentStrategy' :: Maybe Text
id = Maybe Text
a} :: DeploymentStrategy)
deploymentStrategy_deploymentDurationInMinutes :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Natural)
deploymentStrategy_deploymentDurationInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_deploymentDurationInMinutes = (DeploymentStrategy -> Maybe Natural)
-> (DeploymentStrategy -> Maybe Natural -> DeploymentStrategy)
-> Lens
DeploymentStrategy
DeploymentStrategy
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Natural
deploymentDurationInMinutes :: Maybe Natural
$sel:deploymentDurationInMinutes:DeploymentStrategy' :: DeploymentStrategy -> Maybe Natural
deploymentDurationInMinutes} -> Maybe Natural
deploymentDurationInMinutes) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Natural
a -> DeploymentStrategy
s {$sel:deploymentDurationInMinutes:DeploymentStrategy' :: Maybe Natural
deploymentDurationInMinutes = Maybe Natural
a} :: DeploymentStrategy)
deploymentStrategy_finalBakeTimeInMinutes :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Natural)
deploymentStrategy_finalBakeTimeInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_finalBakeTimeInMinutes = (DeploymentStrategy -> Maybe Natural)
-> (DeploymentStrategy -> Maybe Natural -> DeploymentStrategy)
-> Lens
DeploymentStrategy
DeploymentStrategy
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Natural
finalBakeTimeInMinutes :: Maybe Natural
$sel:finalBakeTimeInMinutes:DeploymentStrategy' :: DeploymentStrategy -> Maybe Natural
finalBakeTimeInMinutes} -> Maybe Natural
finalBakeTimeInMinutes) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Natural
a -> DeploymentStrategy
s {$sel:finalBakeTimeInMinutes:DeploymentStrategy' :: Maybe Natural
finalBakeTimeInMinutes = Maybe Natural
a} :: DeploymentStrategy)
deploymentStrategy_description :: Lens.Lens' DeploymentStrategy (Prelude.Maybe Prelude.Text)
deploymentStrategy_description :: (Maybe Text -> f (Maybe Text))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_description = (DeploymentStrategy -> Maybe Text)
-> (DeploymentStrategy -> Maybe Text -> DeploymentStrategy)
-> Lens
DeploymentStrategy DeploymentStrategy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe Text
description :: Maybe Text
$sel:description:DeploymentStrategy' :: DeploymentStrategy -> Maybe Text
description} -> Maybe Text
description) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe Text
a -> DeploymentStrategy
s {$sel:description:DeploymentStrategy' :: Maybe Text
description = Maybe Text
a} :: DeploymentStrategy)
deploymentStrategy_growthType :: Lens.Lens' DeploymentStrategy (Prelude.Maybe GrowthType)
deploymentStrategy_growthType :: (Maybe GrowthType -> f (Maybe GrowthType))
-> DeploymentStrategy -> f DeploymentStrategy
deploymentStrategy_growthType = (DeploymentStrategy -> Maybe GrowthType)
-> (DeploymentStrategy -> Maybe GrowthType -> DeploymentStrategy)
-> Lens
DeploymentStrategy
DeploymentStrategy
(Maybe GrowthType)
(Maybe GrowthType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStrategy' {Maybe GrowthType
growthType :: Maybe GrowthType
$sel:growthType:DeploymentStrategy' :: DeploymentStrategy -> Maybe GrowthType
growthType} -> Maybe GrowthType
growthType) (\s :: DeploymentStrategy
s@DeploymentStrategy' {} Maybe GrowthType
a -> DeploymentStrategy
s {$sel:growthType:DeploymentStrategy' :: Maybe GrowthType
growthType = Maybe GrowthType
a} :: DeploymentStrategy)
instance Core.FromJSON DeploymentStrategy where
parseJSON :: Value -> Parser DeploymentStrategy
parseJSON =
String
-> (Object -> Parser DeploymentStrategy)
-> Value
-> Parser DeploymentStrategy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeploymentStrategy"
( \Object
x ->
Maybe Double
-> Maybe ReplicateTo
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy
DeploymentStrategy'
(Maybe Double
-> Maybe ReplicateTo
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
-> Parser (Maybe Double)
-> Parser
(Maybe ReplicateTo
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GrowthFactor")
Parser
(Maybe ReplicateTo
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
-> Parser (Maybe ReplicateTo)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplicateTo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicateTo")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
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
"Name")
Parser
(Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
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
"Id")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> DeploymentStrategy)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Text -> Maybe GrowthType -> DeploymentStrategy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeploymentDurationInMinutes")
Parser
(Maybe Natural
-> Maybe Text -> Maybe GrowthType -> DeploymentStrategy)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> Maybe GrowthType -> DeploymentStrategy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FinalBakeTimeInMinutes")
Parser (Maybe Text -> Maybe GrowthType -> DeploymentStrategy)
-> Parser (Maybe Text)
-> Parser (Maybe GrowthType -> DeploymentStrategy)
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
"Description")
Parser (Maybe GrowthType -> DeploymentStrategy)
-> Parser (Maybe GrowthType) -> Parser DeploymentStrategy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GrowthType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GrowthType")
)
instance Prelude.Hashable DeploymentStrategy
instance Prelude.NFData DeploymentStrategy