{-# 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.Greengrass.CreateDeployment
-- 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. \'\'CreateDeployment\'\' requests are idempotent
-- with respect to the \'\'X-Amzn-Client-Token\'\' token and the request
-- parameters.
module Amazonka.Greengrass.CreateDeployment
  ( -- * Creating a Request
    CreateDeployment (..),
    newCreateDeployment,

    -- * Request Lenses
    createDeployment_deploymentId,
    createDeployment_amznClientToken,
    createDeployment_groupVersionId,
    createDeployment_groupId,
    createDeployment_deploymentType,

    -- * Destructuring the Response
    CreateDeploymentResponse (..),
    newCreateDeploymentResponse,

    -- * Response Lenses
    createDeploymentResponse_deploymentId,
    createDeploymentResponse_deploymentArn,
    createDeploymentResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateDeployment' smart constructor.
data CreateDeployment = CreateDeployment'
  { -- | The ID of the deployment if you wish to redeploy a previous deployment.
    CreateDeployment -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | A client token used to correlate requests and responses.
    CreateDeployment -> Maybe Text
amznClientToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the group version to be deployed.
    CreateDeployment -> Maybe Text
groupVersionId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Greengrass group.
    CreateDeployment -> Text
groupId :: Prelude.Text,
    -- | The type of deployment. When used for \'\'CreateDeployment\'\', only
    -- \'\'NewDeployment\'\' and \'\'Redeployment\'\' are valid.
    CreateDeployment -> DeploymentType
deploymentType :: DeploymentType
  }
  deriving (CreateDeployment -> CreateDeployment -> Bool
(CreateDeployment -> CreateDeployment -> Bool)
-> (CreateDeployment -> CreateDeployment -> Bool)
-> Eq CreateDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeployment -> CreateDeployment -> Bool
$c/= :: CreateDeployment -> CreateDeployment -> Bool
== :: CreateDeployment -> CreateDeployment -> Bool
$c== :: CreateDeployment -> CreateDeployment -> Bool
Prelude.Eq, ReadPrec [CreateDeployment]
ReadPrec CreateDeployment
Int -> ReadS CreateDeployment
ReadS [CreateDeployment]
(Int -> ReadS CreateDeployment)
-> ReadS [CreateDeployment]
-> ReadPrec CreateDeployment
-> ReadPrec [CreateDeployment]
-> Read CreateDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeployment]
$creadListPrec :: ReadPrec [CreateDeployment]
readPrec :: ReadPrec CreateDeployment
$creadPrec :: ReadPrec CreateDeployment
readList :: ReadS [CreateDeployment]
$creadList :: ReadS [CreateDeployment]
readsPrec :: Int -> ReadS CreateDeployment
$creadsPrec :: Int -> ReadS CreateDeployment
Prelude.Read, Int -> CreateDeployment -> ShowS
[CreateDeployment] -> ShowS
CreateDeployment -> String
(Int -> CreateDeployment -> ShowS)
-> (CreateDeployment -> String)
-> ([CreateDeployment] -> ShowS)
-> Show CreateDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeployment] -> ShowS
$cshowList :: [CreateDeployment] -> ShowS
show :: CreateDeployment -> String
$cshow :: CreateDeployment -> String
showsPrec :: Int -> CreateDeployment -> ShowS
$cshowsPrec :: Int -> CreateDeployment -> ShowS
Prelude.Show, (forall x. CreateDeployment -> Rep CreateDeployment x)
-> (forall x. Rep CreateDeployment x -> CreateDeployment)
-> Generic CreateDeployment
forall x. Rep CreateDeployment x -> CreateDeployment
forall x. CreateDeployment -> Rep CreateDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDeployment x -> CreateDeployment
$cfrom :: forall x. CreateDeployment -> Rep CreateDeployment x
Prelude.Generic)

-- |
-- Create a value of 'CreateDeployment' 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:
--
-- 'deploymentId', 'createDeployment_deploymentId' - The ID of the deployment if you wish to redeploy a previous deployment.
--
-- 'amznClientToken', 'createDeployment_amznClientToken' - A client token used to correlate requests and responses.
--
-- 'groupVersionId', 'createDeployment_groupVersionId' - The ID of the group version to be deployed.
--
-- 'groupId', 'createDeployment_groupId' - The ID of the Greengrass group.
--
-- 'deploymentType', 'createDeployment_deploymentType' - The type of deployment. When used for \'\'CreateDeployment\'\', only
-- \'\'NewDeployment\'\' and \'\'Redeployment\'\' are valid.
newCreateDeployment ::
  -- | 'groupId'
  Prelude.Text ->
  -- | 'deploymentType'
  DeploymentType ->
  CreateDeployment
newCreateDeployment :: Text -> DeploymentType -> CreateDeployment
newCreateDeployment Text
pGroupId_ DeploymentType
pDeploymentType_ =
  CreateDeployment' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> DeploymentType
-> CreateDeployment
CreateDeployment'
    { $sel:deploymentId:CreateDeployment' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:amznClientToken:CreateDeployment' :: Maybe Text
amznClientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupVersionId:CreateDeployment' :: Maybe Text
groupVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:CreateDeployment' :: Text
groupId = Text
pGroupId_,
      $sel:deploymentType:CreateDeployment' :: DeploymentType
deploymentType = DeploymentType
pDeploymentType_
    }

-- | The ID of the deployment if you wish to redeploy a previous deployment.
createDeployment_deploymentId :: Lens.Lens' CreateDeployment (Prelude.Maybe Prelude.Text)
createDeployment_deploymentId :: (Maybe Text -> f (Maybe Text))
-> CreateDeployment -> f CreateDeployment
createDeployment_deploymentId = (CreateDeployment -> Maybe Text)
-> (CreateDeployment -> Maybe Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CreateDeployment' :: CreateDeployment -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe Text
a -> CreateDeployment
s {$sel:deploymentId:CreateDeployment' :: Maybe Text
deploymentId = Maybe Text
a} :: CreateDeployment)

-- | A client token used to correlate requests and responses.
createDeployment_amznClientToken :: Lens.Lens' CreateDeployment (Prelude.Maybe Prelude.Text)
createDeployment_amznClientToken :: (Maybe Text -> f (Maybe Text))
-> CreateDeployment -> f CreateDeployment
createDeployment_amznClientToken = (CreateDeployment -> Maybe Text)
-> (CreateDeployment -> Maybe Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe Text
amznClientToken :: Maybe Text
$sel:amznClientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
amznClientToken} -> Maybe Text
amznClientToken) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe Text
a -> CreateDeployment
s {$sel:amznClientToken:CreateDeployment' :: Maybe Text
amznClientToken = Maybe Text
a} :: CreateDeployment)

-- | The ID of the group version to be deployed.
createDeployment_groupVersionId :: Lens.Lens' CreateDeployment (Prelude.Maybe Prelude.Text)
createDeployment_groupVersionId :: (Maybe Text -> f (Maybe Text))
-> CreateDeployment -> f CreateDeployment
createDeployment_groupVersionId = (CreateDeployment -> Maybe Text)
-> (CreateDeployment -> Maybe Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe Text
groupVersionId :: Maybe Text
$sel:groupVersionId:CreateDeployment' :: CreateDeployment -> Maybe Text
groupVersionId} -> Maybe Text
groupVersionId) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe Text
a -> CreateDeployment
s {$sel:groupVersionId:CreateDeployment' :: Maybe Text
groupVersionId = Maybe Text
a} :: CreateDeployment)

-- | The ID of the Greengrass group.
createDeployment_groupId :: Lens.Lens' CreateDeployment Prelude.Text
createDeployment_groupId :: (Text -> f Text) -> CreateDeployment -> f CreateDeployment
createDeployment_groupId = (CreateDeployment -> Text)
-> (CreateDeployment -> Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Text
groupId :: Text
$sel:groupId:CreateDeployment' :: CreateDeployment -> Text
groupId} -> Text
groupId) (\s :: CreateDeployment
s@CreateDeployment' {} Text
a -> CreateDeployment
s {$sel:groupId:CreateDeployment' :: Text
groupId = Text
a} :: CreateDeployment)

-- | The type of deployment. When used for \'\'CreateDeployment\'\', only
-- \'\'NewDeployment\'\' and \'\'Redeployment\'\' are valid.
createDeployment_deploymentType :: Lens.Lens' CreateDeployment DeploymentType
createDeployment_deploymentType :: (DeploymentType -> f DeploymentType)
-> CreateDeployment -> f CreateDeployment
createDeployment_deploymentType = (CreateDeployment -> DeploymentType)
-> (CreateDeployment -> DeploymentType -> CreateDeployment)
-> Lens
     CreateDeployment CreateDeployment DeploymentType DeploymentType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {DeploymentType
deploymentType :: DeploymentType
$sel:deploymentType:CreateDeployment' :: CreateDeployment -> DeploymentType
deploymentType} -> DeploymentType
deploymentType) (\s :: CreateDeployment
s@CreateDeployment' {} DeploymentType
a -> CreateDeployment
s {$sel:deploymentType:CreateDeployment' :: DeploymentType
deploymentType = DeploymentType
a} :: CreateDeployment)

instance Core.AWSRequest CreateDeployment where
  type
    AWSResponse CreateDeployment =
      CreateDeploymentResponse
  request :: CreateDeployment -> Request CreateDeployment
request = Service -> CreateDeployment -> Request CreateDeployment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDeployment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDeployment))
-> Logger
-> Service
-> Proxy CreateDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDeployment)))
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 -> Maybe Text -> Int -> CreateDeploymentResponse
CreateDeploymentResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDeploymentResponse)
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
"DeploymentId")
            Either String (Maybe Text -> Int -> CreateDeploymentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDeploymentResponse)
forall (f :: * -> *) a b. Applicative f => 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
"DeploymentArn")
            Either String (Int -> CreateDeploymentResponse)
-> Either String Int -> Either String CreateDeploymentResponse
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 CreateDeployment

instance Prelude.NFData CreateDeployment

instance Core.ToHeaders CreateDeployment where
  toHeaders :: CreateDeployment -> ResponseHeaders
toHeaders CreateDeployment' {Maybe Text
Text
DeploymentType
deploymentType :: DeploymentType
groupId :: Text
groupVersionId :: Maybe Text
amznClientToken :: Maybe Text
deploymentId :: Maybe Text
$sel:deploymentType:CreateDeployment' :: CreateDeployment -> DeploymentType
$sel:groupId:CreateDeployment' :: CreateDeployment -> Text
$sel:groupVersionId:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:amznClientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:deploymentId:CreateDeployment' :: CreateDeployment -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
amznClientToken,
        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 CreateDeployment where
  toJSON :: CreateDeployment -> Value
toJSON CreateDeployment' {Maybe Text
Text
DeploymentType
deploymentType :: DeploymentType
groupId :: Text
groupVersionId :: Maybe Text
amznClientToken :: Maybe Text
deploymentId :: Maybe Text
$sel:deploymentType:CreateDeployment' :: CreateDeployment -> DeploymentType
$sel:groupId:CreateDeployment' :: CreateDeployment -> Text
$sel:groupVersionId:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:amznClientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:deploymentId:CreateDeployment' :: CreateDeployment -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DeploymentId" 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
deploymentId,
            (Text
"GroupVersionId" 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
groupVersionId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DeploymentType" Text -> DeploymentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeploymentType
deploymentType)
          ]
      )

instance Core.ToPath CreateDeployment where
  toPath :: CreateDeployment -> ByteString
toPath CreateDeployment' {Maybe Text
Text
DeploymentType
deploymentType :: DeploymentType
groupId :: Text
groupVersionId :: Maybe Text
amznClientToken :: Maybe Text
deploymentId :: Maybe Text
$sel:deploymentType:CreateDeployment' :: CreateDeployment -> DeploymentType
$sel:groupId:CreateDeployment' :: CreateDeployment -> Text
$sel:groupVersionId:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:amznClientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:deploymentId:CreateDeployment' :: CreateDeployment -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/groups/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
groupId,
        ByteString
"/deployments"
      ]

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

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

-- |
-- Create a value of 'CreateDeploymentResponse' 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:
--
-- 'deploymentId', 'createDeploymentResponse_deploymentId' - The ID of the deployment.
--
-- 'deploymentArn', 'createDeploymentResponse_deploymentArn' - The ARN of the deployment.
--
-- 'httpStatus', 'createDeploymentResponse_httpStatus' - The response's http status code.
newCreateDeploymentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDeploymentResponse
newCreateDeploymentResponse :: Int -> CreateDeploymentResponse
newCreateDeploymentResponse Int
pHttpStatus_ =
  CreateDeploymentResponse' :: Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse
CreateDeploymentResponse'
    { $sel:deploymentId:CreateDeploymentResponse' :: Maybe Text
deploymentId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentArn:CreateDeploymentResponse' :: Maybe Text
deploymentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDeploymentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the deployment.
createDeploymentResponse_deploymentId :: Lens.Lens' CreateDeploymentResponse (Prelude.Maybe Prelude.Text)
createDeploymentResponse_deploymentId :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_deploymentId = (CreateDeploymentResponse -> Maybe Text)
-> (CreateDeploymentResponse
    -> Maybe Text -> CreateDeploymentResponse)
-> Lens
     CreateDeploymentResponse
     CreateDeploymentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CreateDeploymentResponse' :: CreateDeploymentResponse -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Maybe Text
a -> CreateDeploymentResponse
s {$sel:deploymentId:CreateDeploymentResponse' :: Maybe Text
deploymentId = Maybe Text
a} :: CreateDeploymentResponse)

-- | The ARN of the deployment.
createDeploymentResponse_deploymentArn :: Lens.Lens' CreateDeploymentResponse (Prelude.Maybe Prelude.Text)
createDeploymentResponse_deploymentArn :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_deploymentArn = (CreateDeploymentResponse -> Maybe Text)
-> (CreateDeploymentResponse
    -> Maybe Text -> CreateDeploymentResponse)
-> Lens
     CreateDeploymentResponse
     CreateDeploymentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Maybe Text
deploymentArn :: Maybe Text
$sel:deploymentArn:CreateDeploymentResponse' :: CreateDeploymentResponse -> Maybe Text
deploymentArn} -> Maybe Text
deploymentArn) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Maybe Text
a -> CreateDeploymentResponse
s {$sel:deploymentArn:CreateDeploymentResponse' :: Maybe Text
deploymentArn = Maybe Text
a} :: CreateDeploymentResponse)

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

instance Prelude.NFData CreateDeploymentResponse