{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AppConfig.UpdateDeploymentStrategy
(
UpdateDeploymentStrategy (..),
newUpdateDeploymentStrategy,
updateDeploymentStrategy_growthFactor,
updateDeploymentStrategy_deploymentDurationInMinutes,
updateDeploymentStrategy_finalBakeTimeInMinutes,
updateDeploymentStrategy_description,
updateDeploymentStrategy_growthType,
updateDeploymentStrategy_deploymentStrategyId,
DeploymentStrategy (..),
newDeploymentStrategy,
deploymentStrategy_growthFactor,
deploymentStrategy_replicateTo,
deploymentStrategy_name,
deploymentStrategy_id,
deploymentStrategy_deploymentDurationInMinutes,
deploymentStrategy_finalBakeTimeInMinutes,
deploymentStrategy_description,
deploymentStrategy_growthType,
)
where
import Amazonka.AppConfig.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateDeploymentStrategy = UpdateDeploymentStrategy'
{
UpdateDeploymentStrategy -> Maybe Double
growthFactor :: Prelude.Maybe Prelude.Double,
UpdateDeploymentStrategy -> Maybe Natural
deploymentDurationInMinutes :: Prelude.Maybe Prelude.Natural,
UpdateDeploymentStrategy -> Maybe Natural
finalBakeTimeInMinutes :: Prelude.Maybe Prelude.Natural,
UpdateDeploymentStrategy -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateDeploymentStrategy -> Maybe GrowthType
growthType :: Prelude.Maybe GrowthType,
UpdateDeploymentStrategy -> Text
deploymentStrategyId :: Prelude.Text
}
deriving (UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool
(UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool)
-> (UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool)
-> Eq UpdateDeploymentStrategy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool
$c/= :: UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool
== :: UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool
$c== :: UpdateDeploymentStrategy -> UpdateDeploymentStrategy -> Bool
Prelude.Eq, ReadPrec [UpdateDeploymentStrategy]
ReadPrec UpdateDeploymentStrategy
Int -> ReadS UpdateDeploymentStrategy
ReadS [UpdateDeploymentStrategy]
(Int -> ReadS UpdateDeploymentStrategy)
-> ReadS [UpdateDeploymentStrategy]
-> ReadPrec UpdateDeploymentStrategy
-> ReadPrec [UpdateDeploymentStrategy]
-> Read UpdateDeploymentStrategy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDeploymentStrategy]
$creadListPrec :: ReadPrec [UpdateDeploymentStrategy]
readPrec :: ReadPrec UpdateDeploymentStrategy
$creadPrec :: ReadPrec UpdateDeploymentStrategy
readList :: ReadS [UpdateDeploymentStrategy]
$creadList :: ReadS [UpdateDeploymentStrategy]
readsPrec :: Int -> ReadS UpdateDeploymentStrategy
$creadsPrec :: Int -> ReadS UpdateDeploymentStrategy
Prelude.Read, Int -> UpdateDeploymentStrategy -> ShowS
[UpdateDeploymentStrategy] -> ShowS
UpdateDeploymentStrategy -> String
(Int -> UpdateDeploymentStrategy -> ShowS)
-> (UpdateDeploymentStrategy -> String)
-> ([UpdateDeploymentStrategy] -> ShowS)
-> Show UpdateDeploymentStrategy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDeploymentStrategy] -> ShowS
$cshowList :: [UpdateDeploymentStrategy] -> ShowS
show :: UpdateDeploymentStrategy -> String
$cshow :: UpdateDeploymentStrategy -> String
showsPrec :: Int -> UpdateDeploymentStrategy -> ShowS
$cshowsPrec :: Int -> UpdateDeploymentStrategy -> ShowS
Prelude.Show, (forall x.
UpdateDeploymentStrategy -> Rep UpdateDeploymentStrategy x)
-> (forall x.
Rep UpdateDeploymentStrategy x -> UpdateDeploymentStrategy)
-> Generic UpdateDeploymentStrategy
forall x.
Rep UpdateDeploymentStrategy x -> UpdateDeploymentStrategy
forall x.
UpdateDeploymentStrategy -> Rep UpdateDeploymentStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDeploymentStrategy x -> UpdateDeploymentStrategy
$cfrom :: forall x.
UpdateDeploymentStrategy -> Rep UpdateDeploymentStrategy x
Prelude.Generic)
newUpdateDeploymentStrategy ::
Prelude.Text ->
UpdateDeploymentStrategy
newUpdateDeploymentStrategy :: Text -> UpdateDeploymentStrategy
newUpdateDeploymentStrategy Text
pDeploymentStrategyId_ =
UpdateDeploymentStrategy' :: Maybe Double
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe GrowthType
-> Text
-> UpdateDeploymentStrategy
UpdateDeploymentStrategy'
{ $sel:growthFactor:UpdateDeploymentStrategy' :: Maybe Double
growthFactor =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentDurationInMinutes:UpdateDeploymentStrategy' :: Maybe Natural
deploymentDurationInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:finalBakeTimeInMinutes:UpdateDeploymentStrategy' :: Maybe Natural
finalBakeTimeInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateDeploymentStrategy' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:growthType:UpdateDeploymentStrategy' :: Maybe GrowthType
growthType = Maybe GrowthType
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentStrategyId:UpdateDeploymentStrategy' :: Text
deploymentStrategyId = Text
pDeploymentStrategyId_
}
updateDeploymentStrategy_growthFactor :: Lens.Lens' UpdateDeploymentStrategy (Prelude.Maybe Prelude.Double)
updateDeploymentStrategy_growthFactor :: (Maybe Double -> f (Maybe Double))
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_growthFactor = (UpdateDeploymentStrategy -> Maybe Double)
-> (UpdateDeploymentStrategy
-> Maybe Double -> UpdateDeploymentStrategy)
-> Lens
UpdateDeploymentStrategy
UpdateDeploymentStrategy
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Maybe Double
growthFactor :: Maybe Double
$sel:growthFactor:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Double
growthFactor} -> Maybe Double
growthFactor) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Maybe Double
a -> UpdateDeploymentStrategy
s {$sel:growthFactor:UpdateDeploymentStrategy' :: Maybe Double
growthFactor = Maybe Double
a} :: UpdateDeploymentStrategy)
updateDeploymentStrategy_deploymentDurationInMinutes :: Lens.Lens' UpdateDeploymentStrategy (Prelude.Maybe Prelude.Natural)
updateDeploymentStrategy_deploymentDurationInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_deploymentDurationInMinutes = (UpdateDeploymentStrategy -> Maybe Natural)
-> (UpdateDeploymentStrategy
-> Maybe Natural -> UpdateDeploymentStrategy)
-> Lens
UpdateDeploymentStrategy
UpdateDeploymentStrategy
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Maybe Natural
deploymentDurationInMinutes :: Maybe Natural
$sel:deploymentDurationInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
deploymentDurationInMinutes} -> Maybe Natural
deploymentDurationInMinutes) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Maybe Natural
a -> UpdateDeploymentStrategy
s {$sel:deploymentDurationInMinutes:UpdateDeploymentStrategy' :: Maybe Natural
deploymentDurationInMinutes = Maybe Natural
a} :: UpdateDeploymentStrategy)
updateDeploymentStrategy_finalBakeTimeInMinutes :: Lens.Lens' UpdateDeploymentStrategy (Prelude.Maybe Prelude.Natural)
updateDeploymentStrategy_finalBakeTimeInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_finalBakeTimeInMinutes = (UpdateDeploymentStrategy -> Maybe Natural)
-> (UpdateDeploymentStrategy
-> Maybe Natural -> UpdateDeploymentStrategy)
-> Lens
UpdateDeploymentStrategy
UpdateDeploymentStrategy
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Maybe Natural
finalBakeTimeInMinutes :: Maybe Natural
$sel:finalBakeTimeInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
finalBakeTimeInMinutes} -> Maybe Natural
finalBakeTimeInMinutes) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Maybe Natural
a -> UpdateDeploymentStrategy
s {$sel:finalBakeTimeInMinutes:UpdateDeploymentStrategy' :: Maybe Natural
finalBakeTimeInMinutes = Maybe Natural
a} :: UpdateDeploymentStrategy)
updateDeploymentStrategy_description :: Lens.Lens' UpdateDeploymentStrategy (Prelude.Maybe Prelude.Text)
updateDeploymentStrategy_description :: (Maybe Text -> f (Maybe Text))
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_description = (UpdateDeploymentStrategy -> Maybe Text)
-> (UpdateDeploymentStrategy
-> Maybe Text -> UpdateDeploymentStrategy)
-> Lens
UpdateDeploymentStrategy
UpdateDeploymentStrategy
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Maybe Text
a -> UpdateDeploymentStrategy
s {$sel:description:UpdateDeploymentStrategy' :: Maybe Text
description = Maybe Text
a} :: UpdateDeploymentStrategy)
updateDeploymentStrategy_growthType :: Lens.Lens' UpdateDeploymentStrategy (Prelude.Maybe GrowthType)
updateDeploymentStrategy_growthType :: (Maybe GrowthType -> f (Maybe GrowthType))
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_growthType = (UpdateDeploymentStrategy -> Maybe GrowthType)
-> (UpdateDeploymentStrategy
-> Maybe GrowthType -> UpdateDeploymentStrategy)
-> Lens
UpdateDeploymentStrategy
UpdateDeploymentStrategy
(Maybe GrowthType)
(Maybe GrowthType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Maybe GrowthType
growthType :: Maybe GrowthType
$sel:growthType:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe GrowthType
growthType} -> Maybe GrowthType
growthType) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Maybe GrowthType
a -> UpdateDeploymentStrategy
s {$sel:growthType:UpdateDeploymentStrategy' :: Maybe GrowthType
growthType = Maybe GrowthType
a} :: UpdateDeploymentStrategy)
updateDeploymentStrategy_deploymentStrategyId :: Lens.Lens' UpdateDeploymentStrategy Prelude.Text
updateDeploymentStrategy_deploymentStrategyId :: (Text -> f Text)
-> UpdateDeploymentStrategy -> f UpdateDeploymentStrategy
updateDeploymentStrategy_deploymentStrategyId = (UpdateDeploymentStrategy -> Text)
-> (UpdateDeploymentStrategy -> Text -> UpdateDeploymentStrategy)
-> Lens UpdateDeploymentStrategy UpdateDeploymentStrategy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeploymentStrategy' {Text
deploymentStrategyId :: Text
$sel:deploymentStrategyId:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Text
deploymentStrategyId} -> Text
deploymentStrategyId) (\s :: UpdateDeploymentStrategy
s@UpdateDeploymentStrategy' {} Text
a -> UpdateDeploymentStrategy
s {$sel:deploymentStrategyId:UpdateDeploymentStrategy' :: Text
deploymentStrategyId = Text
a} :: UpdateDeploymentStrategy)
instance Core.AWSRequest UpdateDeploymentStrategy where
type
AWSResponse UpdateDeploymentStrategy =
DeploymentStrategy
request :: UpdateDeploymentStrategy -> Request UpdateDeploymentStrategy
request = Service
-> UpdateDeploymentStrategy -> Request UpdateDeploymentStrategy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDeploymentStrategy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDeploymentStrategy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateDeploymentStrategy))
-> Logger
-> Service
-> Proxy UpdateDeploymentStrategy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDeploymentStrategy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String DeploymentStrategy
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable UpdateDeploymentStrategy
instance Prelude.NFData UpdateDeploymentStrategy
instance Core.ToHeaders UpdateDeploymentStrategy where
toHeaders :: UpdateDeploymentStrategy -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDeploymentStrategy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateDeploymentStrategy where
toJSON :: UpdateDeploymentStrategy -> Value
toJSON UpdateDeploymentStrategy' {Maybe Double
Maybe Natural
Maybe Text
Maybe GrowthType
Text
deploymentStrategyId :: Text
growthType :: Maybe GrowthType
description :: Maybe Text
finalBakeTimeInMinutes :: Maybe Natural
deploymentDurationInMinutes :: Maybe Natural
growthFactor :: Maybe Double
$sel:deploymentStrategyId:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Text
$sel:growthType:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe GrowthType
$sel:description:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Text
$sel:finalBakeTimeInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
$sel:deploymentDurationInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
$sel:growthFactor:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Double
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GrowthFactor" 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
growthFactor,
(Text
"DeploymentDurationInMinutes" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
deploymentDurationInMinutes,
(Text
"FinalBakeTimeInMinutes" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
finalBakeTimeInMinutes,
(Text
"Description" 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
description,
(Text
"GrowthType" Text -> GrowthType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (GrowthType -> Pair) -> Maybe GrowthType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GrowthType
growthType
]
)
instance Core.ToPath UpdateDeploymentStrategy where
toPath :: UpdateDeploymentStrategy -> ByteString
toPath UpdateDeploymentStrategy' {Maybe Double
Maybe Natural
Maybe Text
Maybe GrowthType
Text
deploymentStrategyId :: Text
growthType :: Maybe GrowthType
description :: Maybe Text
finalBakeTimeInMinutes :: Maybe Natural
deploymentDurationInMinutes :: Maybe Natural
growthFactor :: Maybe Double
$sel:deploymentStrategyId:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Text
$sel:growthType:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe GrowthType
$sel:description:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Text
$sel:finalBakeTimeInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
$sel:deploymentDurationInMinutes:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Natural
$sel:growthFactor:UpdateDeploymentStrategy' :: UpdateDeploymentStrategy -> Maybe Double
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/deploymentstrategies/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deploymentStrategyId
]
instance Core.ToQuery UpdateDeploymentStrategy where
toQuery :: UpdateDeploymentStrategy -> QueryString
toQuery = QueryString -> UpdateDeploymentStrategy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty