{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeDeploy.CreateDeploymentConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a deployment configuration.
module Amazonka.CodeDeploy.CreateDeploymentConfig
  ( -- * Creating a Request
    CreateDeploymentConfig (..),
    newCreateDeploymentConfig,

    -- * Request Lenses
    createDeploymentConfig_computePlatform,
    createDeploymentConfig_minimumHealthyHosts,
    createDeploymentConfig_trafficRoutingConfig,
    createDeploymentConfig_deploymentConfigName,

    -- * Destructuring the Response
    CreateDeploymentConfigResponse (..),
    newCreateDeploymentConfigResponse,

    -- * Response Lenses
    createDeploymentConfigResponse_deploymentConfigId,
    createDeploymentConfigResponse_httpStatus,
  )
where

import Amazonka.CodeDeploy.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

-- | Represents the input of a @CreateDeploymentConfig@ operation.
--
-- /See:/ 'newCreateDeploymentConfig' smart constructor.
data CreateDeploymentConfig = CreateDeploymentConfig'
  { -- | The destination platform type for the deployment (@Lambda@, @Server@, or
    -- @ECS@).
    CreateDeploymentConfig -> Maybe ComputePlatform
computePlatform :: Prelude.Maybe ComputePlatform,
    -- | The minimum number of healthy instances that should be available at any
    -- time during the deployment. There are two parameters expected in the
    -- input: type and value.
    --
    -- The type parameter takes either of the following values:
    --
    -- -   HOST_COUNT: The value parameter represents the minimum number of
    --     healthy instances as an absolute value.
    --
    -- -   FLEET_PERCENT: The value parameter represents the minimum number of
    --     healthy instances as a percentage of the total number of instances
    --     in the deployment. If you specify FLEET_PERCENT, at the start of the
    --     deployment, AWS CodeDeploy converts the percentage to the equivalent
    --     number of instances and rounds up fractional instances.
    --
    -- The value parameter takes an integer.
    --
    -- For example, to set a minimum of 95% healthy instance, specify a type of
    -- FLEET_PERCENT and a value of 95.
    CreateDeploymentConfig -> Maybe MinimumHealthyHosts
minimumHealthyHosts :: Prelude.Maybe MinimumHealthyHosts,
    -- | The configuration that specifies how the deployment traffic is routed.
    CreateDeploymentConfig -> Maybe TrafficRoutingConfig
trafficRoutingConfig :: Prelude.Maybe TrafficRoutingConfig,
    -- | The name of the deployment configuration to create.
    CreateDeploymentConfig -> Text
deploymentConfigName :: Prelude.Text
  }
  deriving (CreateDeploymentConfig -> CreateDeploymentConfig -> Bool
(CreateDeploymentConfig -> CreateDeploymentConfig -> Bool)
-> (CreateDeploymentConfig -> CreateDeploymentConfig -> Bool)
-> Eq CreateDeploymentConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeploymentConfig -> CreateDeploymentConfig -> Bool
$c/= :: CreateDeploymentConfig -> CreateDeploymentConfig -> Bool
== :: CreateDeploymentConfig -> CreateDeploymentConfig -> Bool
$c== :: CreateDeploymentConfig -> CreateDeploymentConfig -> Bool
Prelude.Eq, ReadPrec [CreateDeploymentConfig]
ReadPrec CreateDeploymentConfig
Int -> ReadS CreateDeploymentConfig
ReadS [CreateDeploymentConfig]
(Int -> ReadS CreateDeploymentConfig)
-> ReadS [CreateDeploymentConfig]
-> ReadPrec CreateDeploymentConfig
-> ReadPrec [CreateDeploymentConfig]
-> Read CreateDeploymentConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeploymentConfig]
$creadListPrec :: ReadPrec [CreateDeploymentConfig]
readPrec :: ReadPrec CreateDeploymentConfig
$creadPrec :: ReadPrec CreateDeploymentConfig
readList :: ReadS [CreateDeploymentConfig]
$creadList :: ReadS [CreateDeploymentConfig]
readsPrec :: Int -> ReadS CreateDeploymentConfig
$creadsPrec :: Int -> ReadS CreateDeploymentConfig
Prelude.Read, Int -> CreateDeploymentConfig -> ShowS
[CreateDeploymentConfig] -> ShowS
CreateDeploymentConfig -> String
(Int -> CreateDeploymentConfig -> ShowS)
-> (CreateDeploymentConfig -> String)
-> ([CreateDeploymentConfig] -> ShowS)
-> Show CreateDeploymentConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeploymentConfig] -> ShowS
$cshowList :: [CreateDeploymentConfig] -> ShowS
show :: CreateDeploymentConfig -> String
$cshow :: CreateDeploymentConfig -> String
showsPrec :: Int -> CreateDeploymentConfig -> ShowS
$cshowsPrec :: Int -> CreateDeploymentConfig -> ShowS
Prelude.Show, (forall x. CreateDeploymentConfig -> Rep CreateDeploymentConfig x)
-> (forall x.
    Rep CreateDeploymentConfig x -> CreateDeploymentConfig)
-> Generic CreateDeploymentConfig
forall x. Rep CreateDeploymentConfig x -> CreateDeploymentConfig
forall x. CreateDeploymentConfig -> Rep CreateDeploymentConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDeploymentConfig x -> CreateDeploymentConfig
$cfrom :: forall x. CreateDeploymentConfig -> Rep CreateDeploymentConfig x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeploymentConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'computePlatform', 'createDeploymentConfig_computePlatform' - The destination platform type for the deployment (@Lambda@, @Server@, or
-- @ECS@).
--
-- 'minimumHealthyHosts', 'createDeploymentConfig_minimumHealthyHosts' - The minimum number of healthy instances that should be available at any
-- time during the deployment. There are two parameters expected in the
-- input: type and value.
--
-- The type parameter takes either of the following values:
--
-- -   HOST_COUNT: The value parameter represents the minimum number of
--     healthy instances as an absolute value.
--
-- -   FLEET_PERCENT: The value parameter represents the minimum number of
--     healthy instances as a percentage of the total number of instances
--     in the deployment. If you specify FLEET_PERCENT, at the start of the
--     deployment, AWS CodeDeploy converts the percentage to the equivalent
--     number of instances and rounds up fractional instances.
--
-- The value parameter takes an integer.
--
-- For example, to set a minimum of 95% healthy instance, specify a type of
-- FLEET_PERCENT and a value of 95.
--
-- 'trafficRoutingConfig', 'createDeploymentConfig_trafficRoutingConfig' - The configuration that specifies how the deployment traffic is routed.
--
-- 'deploymentConfigName', 'createDeploymentConfig_deploymentConfigName' - The name of the deployment configuration to create.
newCreateDeploymentConfig ::
  -- | 'deploymentConfigName'
  Prelude.Text ->
  CreateDeploymentConfig
newCreateDeploymentConfig :: Text -> CreateDeploymentConfig
newCreateDeploymentConfig Text
pDeploymentConfigName_ =
  CreateDeploymentConfig' :: Maybe ComputePlatform
-> Maybe MinimumHealthyHosts
-> Maybe TrafficRoutingConfig
-> Text
-> CreateDeploymentConfig
CreateDeploymentConfig'
    { $sel:computePlatform:CreateDeploymentConfig' :: Maybe ComputePlatform
computePlatform =
        Maybe ComputePlatform
forall a. Maybe a
Prelude.Nothing,
      $sel:minimumHealthyHosts:CreateDeploymentConfig' :: Maybe MinimumHealthyHosts
minimumHealthyHosts = Maybe MinimumHealthyHosts
forall a. Maybe a
Prelude.Nothing,
      $sel:trafficRoutingConfig:CreateDeploymentConfig' :: Maybe TrafficRoutingConfig
trafficRoutingConfig = Maybe TrafficRoutingConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentConfigName:CreateDeploymentConfig' :: Text
deploymentConfigName = Text
pDeploymentConfigName_
    }

-- | The destination platform type for the deployment (@Lambda@, @Server@, or
-- @ECS@).
createDeploymentConfig_computePlatform :: Lens.Lens' CreateDeploymentConfig (Prelude.Maybe ComputePlatform)
createDeploymentConfig_computePlatform :: (Maybe ComputePlatform -> f (Maybe ComputePlatform))
-> CreateDeploymentConfig -> f CreateDeploymentConfig
createDeploymentConfig_computePlatform = (CreateDeploymentConfig -> Maybe ComputePlatform)
-> (CreateDeploymentConfig
    -> Maybe ComputePlatform -> CreateDeploymentConfig)
-> Lens
     CreateDeploymentConfig
     CreateDeploymentConfig
     (Maybe ComputePlatform)
     (Maybe ComputePlatform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfig' {Maybe ComputePlatform
computePlatform :: Maybe ComputePlatform
$sel:computePlatform:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe ComputePlatform
computePlatform} -> Maybe ComputePlatform
computePlatform) (\s :: CreateDeploymentConfig
s@CreateDeploymentConfig' {} Maybe ComputePlatform
a -> CreateDeploymentConfig
s {$sel:computePlatform:CreateDeploymentConfig' :: Maybe ComputePlatform
computePlatform = Maybe ComputePlatform
a} :: CreateDeploymentConfig)

-- | The minimum number of healthy instances that should be available at any
-- time during the deployment. There are two parameters expected in the
-- input: type and value.
--
-- The type parameter takes either of the following values:
--
-- -   HOST_COUNT: The value parameter represents the minimum number of
--     healthy instances as an absolute value.
--
-- -   FLEET_PERCENT: The value parameter represents the minimum number of
--     healthy instances as a percentage of the total number of instances
--     in the deployment. If you specify FLEET_PERCENT, at the start of the
--     deployment, AWS CodeDeploy converts the percentage to the equivalent
--     number of instances and rounds up fractional instances.
--
-- The value parameter takes an integer.
--
-- For example, to set a minimum of 95% healthy instance, specify a type of
-- FLEET_PERCENT and a value of 95.
createDeploymentConfig_minimumHealthyHosts :: Lens.Lens' CreateDeploymentConfig (Prelude.Maybe MinimumHealthyHosts)
createDeploymentConfig_minimumHealthyHosts :: (Maybe MinimumHealthyHosts -> f (Maybe MinimumHealthyHosts))
-> CreateDeploymentConfig -> f CreateDeploymentConfig
createDeploymentConfig_minimumHealthyHosts = (CreateDeploymentConfig -> Maybe MinimumHealthyHosts)
-> (CreateDeploymentConfig
    -> Maybe MinimumHealthyHosts -> CreateDeploymentConfig)
-> Lens
     CreateDeploymentConfig
     CreateDeploymentConfig
     (Maybe MinimumHealthyHosts)
     (Maybe MinimumHealthyHosts)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfig' {Maybe MinimumHealthyHosts
minimumHealthyHosts :: Maybe MinimumHealthyHosts
$sel:minimumHealthyHosts:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe MinimumHealthyHosts
minimumHealthyHosts} -> Maybe MinimumHealthyHosts
minimumHealthyHosts) (\s :: CreateDeploymentConfig
s@CreateDeploymentConfig' {} Maybe MinimumHealthyHosts
a -> CreateDeploymentConfig
s {$sel:minimumHealthyHosts:CreateDeploymentConfig' :: Maybe MinimumHealthyHosts
minimumHealthyHosts = Maybe MinimumHealthyHosts
a} :: CreateDeploymentConfig)

-- | The configuration that specifies how the deployment traffic is routed.
createDeploymentConfig_trafficRoutingConfig :: Lens.Lens' CreateDeploymentConfig (Prelude.Maybe TrafficRoutingConfig)
createDeploymentConfig_trafficRoutingConfig :: (Maybe TrafficRoutingConfig -> f (Maybe TrafficRoutingConfig))
-> CreateDeploymentConfig -> f CreateDeploymentConfig
createDeploymentConfig_trafficRoutingConfig = (CreateDeploymentConfig -> Maybe TrafficRoutingConfig)
-> (CreateDeploymentConfig
    -> Maybe TrafficRoutingConfig -> CreateDeploymentConfig)
-> Lens
     CreateDeploymentConfig
     CreateDeploymentConfig
     (Maybe TrafficRoutingConfig)
     (Maybe TrafficRoutingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfig' {Maybe TrafficRoutingConfig
trafficRoutingConfig :: Maybe TrafficRoutingConfig
$sel:trafficRoutingConfig:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe TrafficRoutingConfig
trafficRoutingConfig} -> Maybe TrafficRoutingConfig
trafficRoutingConfig) (\s :: CreateDeploymentConfig
s@CreateDeploymentConfig' {} Maybe TrafficRoutingConfig
a -> CreateDeploymentConfig
s {$sel:trafficRoutingConfig:CreateDeploymentConfig' :: Maybe TrafficRoutingConfig
trafficRoutingConfig = Maybe TrafficRoutingConfig
a} :: CreateDeploymentConfig)

-- | The name of the deployment configuration to create.
createDeploymentConfig_deploymentConfigName :: Lens.Lens' CreateDeploymentConfig Prelude.Text
createDeploymentConfig_deploymentConfigName :: (Text -> f Text)
-> CreateDeploymentConfig -> f CreateDeploymentConfig
createDeploymentConfig_deploymentConfigName = (CreateDeploymentConfig -> Text)
-> (CreateDeploymentConfig -> Text -> CreateDeploymentConfig)
-> Lens CreateDeploymentConfig CreateDeploymentConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfig' {Text
deploymentConfigName :: Text
$sel:deploymentConfigName:CreateDeploymentConfig' :: CreateDeploymentConfig -> Text
deploymentConfigName} -> Text
deploymentConfigName) (\s :: CreateDeploymentConfig
s@CreateDeploymentConfig' {} Text
a -> CreateDeploymentConfig
s {$sel:deploymentConfigName:CreateDeploymentConfig' :: Text
deploymentConfigName = Text
a} :: CreateDeploymentConfig)

instance Core.AWSRequest CreateDeploymentConfig where
  type
    AWSResponse CreateDeploymentConfig =
      CreateDeploymentConfigResponse
  request :: CreateDeploymentConfig -> Request CreateDeploymentConfig
request = Service -> CreateDeploymentConfig -> Request CreateDeploymentConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDeploymentConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeploymentConfig)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDeploymentConfig))
-> Logger
-> Service
-> Proxy CreateDeploymentConfig
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDeploymentConfig)))
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 ->
          Maybe Text -> Int -> CreateDeploymentConfigResponse
CreateDeploymentConfigResponse'
            (Maybe Text -> Int -> CreateDeploymentConfigResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDeploymentConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"deploymentConfigId")
            Either String (Int -> CreateDeploymentConfigResponse)
-> Either String Int
-> Either String CreateDeploymentConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateDeploymentConfig

instance Prelude.NFData CreateDeploymentConfig

instance Core.ToHeaders CreateDeploymentConfig where
  toHeaders :: CreateDeploymentConfig -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDeploymentConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeDeploy_20141006.CreateDeploymentConfig" ::
                          Prelude.ByteString
                      ),
            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 CreateDeploymentConfig where
  toJSON :: CreateDeploymentConfig -> Value
toJSON CreateDeploymentConfig' {Maybe ComputePlatform
Maybe MinimumHealthyHosts
Maybe TrafficRoutingConfig
Text
deploymentConfigName :: Text
trafficRoutingConfig :: Maybe TrafficRoutingConfig
minimumHealthyHosts :: Maybe MinimumHealthyHosts
computePlatform :: Maybe ComputePlatform
$sel:deploymentConfigName:CreateDeploymentConfig' :: CreateDeploymentConfig -> Text
$sel:trafficRoutingConfig:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe TrafficRoutingConfig
$sel:minimumHealthyHosts:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe MinimumHealthyHosts
$sel:computePlatform:CreateDeploymentConfig' :: CreateDeploymentConfig -> Maybe ComputePlatform
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"computePlatform" Text -> ComputePlatform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ComputePlatform -> Pair) -> Maybe ComputePlatform -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputePlatform
computePlatform,
            (Text
"minimumHealthyHosts" Text -> MinimumHealthyHosts -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MinimumHealthyHosts -> Pair)
-> Maybe MinimumHealthyHosts -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MinimumHealthyHosts
minimumHealthyHosts,
            (Text
"trafficRoutingConfig" Text -> TrafficRoutingConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TrafficRoutingConfig -> Pair)
-> Maybe TrafficRoutingConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TrafficRoutingConfig
trafficRoutingConfig,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"deploymentConfigName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deploymentConfigName
              )
          ]
      )

instance Core.ToPath CreateDeploymentConfig where
  toPath :: CreateDeploymentConfig -> ByteString
toPath = ByteString -> CreateDeploymentConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateDeploymentConfig where
  toQuery :: CreateDeploymentConfig -> QueryString
toQuery = QueryString -> CreateDeploymentConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Represents the output of a @CreateDeploymentConfig@ operation.
--
-- /See:/ 'newCreateDeploymentConfigResponse' smart constructor.
data CreateDeploymentConfigResponse = CreateDeploymentConfigResponse'
  { -- | A unique deployment configuration ID.
    CreateDeploymentConfigResponse -> Maybe Text
deploymentConfigId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateDeploymentConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDeploymentConfigResponse
-> CreateDeploymentConfigResponse -> Bool
(CreateDeploymentConfigResponse
 -> CreateDeploymentConfigResponse -> Bool)
-> (CreateDeploymentConfigResponse
    -> CreateDeploymentConfigResponse -> Bool)
-> Eq CreateDeploymentConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeploymentConfigResponse
-> CreateDeploymentConfigResponse -> Bool
$c/= :: CreateDeploymentConfigResponse
-> CreateDeploymentConfigResponse -> Bool
== :: CreateDeploymentConfigResponse
-> CreateDeploymentConfigResponse -> Bool
$c== :: CreateDeploymentConfigResponse
-> CreateDeploymentConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateDeploymentConfigResponse]
ReadPrec CreateDeploymentConfigResponse
Int -> ReadS CreateDeploymentConfigResponse
ReadS [CreateDeploymentConfigResponse]
(Int -> ReadS CreateDeploymentConfigResponse)
-> ReadS [CreateDeploymentConfigResponse]
-> ReadPrec CreateDeploymentConfigResponse
-> ReadPrec [CreateDeploymentConfigResponse]
-> Read CreateDeploymentConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeploymentConfigResponse]
$creadListPrec :: ReadPrec [CreateDeploymentConfigResponse]
readPrec :: ReadPrec CreateDeploymentConfigResponse
$creadPrec :: ReadPrec CreateDeploymentConfigResponse
readList :: ReadS [CreateDeploymentConfigResponse]
$creadList :: ReadS [CreateDeploymentConfigResponse]
readsPrec :: Int -> ReadS CreateDeploymentConfigResponse
$creadsPrec :: Int -> ReadS CreateDeploymentConfigResponse
Prelude.Read, Int -> CreateDeploymentConfigResponse -> ShowS
[CreateDeploymentConfigResponse] -> ShowS
CreateDeploymentConfigResponse -> String
(Int -> CreateDeploymentConfigResponse -> ShowS)
-> (CreateDeploymentConfigResponse -> String)
-> ([CreateDeploymentConfigResponse] -> ShowS)
-> Show CreateDeploymentConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeploymentConfigResponse] -> ShowS
$cshowList :: [CreateDeploymentConfigResponse] -> ShowS
show :: CreateDeploymentConfigResponse -> String
$cshow :: CreateDeploymentConfigResponse -> String
showsPrec :: Int -> CreateDeploymentConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateDeploymentConfigResponse -> ShowS
Prelude.Show, (forall x.
 CreateDeploymentConfigResponse
 -> Rep CreateDeploymentConfigResponse x)
-> (forall x.
    Rep CreateDeploymentConfigResponse x
    -> CreateDeploymentConfigResponse)
-> Generic CreateDeploymentConfigResponse
forall x.
Rep CreateDeploymentConfigResponse x
-> CreateDeploymentConfigResponse
forall x.
CreateDeploymentConfigResponse
-> Rep CreateDeploymentConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeploymentConfigResponse x
-> CreateDeploymentConfigResponse
$cfrom :: forall x.
CreateDeploymentConfigResponse
-> Rep CreateDeploymentConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeploymentConfigResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'deploymentConfigId', 'createDeploymentConfigResponse_deploymentConfigId' - A unique deployment configuration ID.
--
-- 'httpStatus', 'createDeploymentConfigResponse_httpStatus' - The response's http status code.
newCreateDeploymentConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDeploymentConfigResponse
newCreateDeploymentConfigResponse :: Int -> CreateDeploymentConfigResponse
newCreateDeploymentConfigResponse Int
pHttpStatus_ =
  CreateDeploymentConfigResponse' :: Maybe Text -> Int -> CreateDeploymentConfigResponse
CreateDeploymentConfigResponse'
    { $sel:deploymentConfigId:CreateDeploymentConfigResponse' :: Maybe Text
deploymentConfigId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDeploymentConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A unique deployment configuration ID.
createDeploymentConfigResponse_deploymentConfigId :: Lens.Lens' CreateDeploymentConfigResponse (Prelude.Maybe Prelude.Text)
createDeploymentConfigResponse_deploymentConfigId :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentConfigResponse
-> f CreateDeploymentConfigResponse
createDeploymentConfigResponse_deploymentConfigId = (CreateDeploymentConfigResponse -> Maybe Text)
-> (CreateDeploymentConfigResponse
    -> Maybe Text -> CreateDeploymentConfigResponse)
-> Lens
     CreateDeploymentConfigResponse
     CreateDeploymentConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfigResponse' {Maybe Text
deploymentConfigId :: Maybe Text
$sel:deploymentConfigId:CreateDeploymentConfigResponse' :: CreateDeploymentConfigResponse -> Maybe Text
deploymentConfigId} -> Maybe Text
deploymentConfigId) (\s :: CreateDeploymentConfigResponse
s@CreateDeploymentConfigResponse' {} Maybe Text
a -> CreateDeploymentConfigResponse
s {$sel:deploymentConfigId:CreateDeploymentConfigResponse' :: Maybe Text
deploymentConfigId = Maybe Text
a} :: CreateDeploymentConfigResponse)

-- | The response's http status code.
createDeploymentConfigResponse_httpStatus :: Lens.Lens' CreateDeploymentConfigResponse Prelude.Int
createDeploymentConfigResponse_httpStatus :: (Int -> f Int)
-> CreateDeploymentConfigResponse
-> f CreateDeploymentConfigResponse
createDeploymentConfigResponse_httpStatus = (CreateDeploymentConfigResponse -> Int)
-> (CreateDeploymentConfigResponse
    -> Int -> CreateDeploymentConfigResponse)
-> Lens
     CreateDeploymentConfigResponse
     CreateDeploymentConfigResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDeploymentConfigResponse' :: CreateDeploymentConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDeploymentConfigResponse
s@CreateDeploymentConfigResponse' {} Int
a -> CreateDeploymentConfigResponse
s {$sel:httpStatus:CreateDeploymentConfigResponse' :: Int
httpStatus = Int
a} :: CreateDeploymentConfigResponse)

instance
  Prelude.NFData
    CreateDeploymentConfigResponse