{-# 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.ApiGatewayV2.CreateStage
-- 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 Stage for an API.
module Amazonka.ApiGatewayV2.CreateStage
  ( -- * Creating a Request
    CreateStage (..),
    newCreateStage,

    -- * Request Lenses
    createStage_deploymentId,
    createStage_routeSettings,
    createStage_accessLogSettings,
    createStage_clientCertificateId,
    createStage_stageVariables,
    createStage_autoDeploy,
    createStage_defaultRouteSettings,
    createStage_description,
    createStage_tags,
    createStage_apiId,
    createStage_stageName,

    -- * Destructuring the Response
    CreateStageResponse (..),
    newCreateStageResponse,

    -- * Response Lenses
    createStageResponse_lastDeploymentStatusMessage,
    createStageResponse_deploymentId,
    createStageResponse_routeSettings,
    createStageResponse_accessLogSettings,
    createStageResponse_clientCertificateId,
    createStageResponse_stageVariables,
    createStageResponse_autoDeploy,
    createStageResponse_createdDate,
    createStageResponse_defaultRouteSettings,
    createStageResponse_apiGatewayManaged,
    createStageResponse_stageName,
    createStageResponse_lastUpdatedDate,
    createStageResponse_description,
    createStageResponse_tags,
    createStageResponse_httpStatus,
  )
where

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

-- | Creates a new Stage resource to represent a stage.
--
-- /See:/ 'newCreateStage' smart constructor.
data CreateStage = CreateStage'
  { -- | The deployment identifier of the API stage.
    CreateStage -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | Route settings for the stage, by routeKey.
    CreateStage -> Maybe (HashMap Text RouteSettings)
routeSettings :: Prelude.Maybe (Prelude.HashMap Prelude.Text RouteSettings),
    -- | Settings for logging access in this stage.
    CreateStage -> Maybe AccessLogSettings
accessLogSettings :: Prelude.Maybe AccessLogSettings,
    -- | The identifier of a client certificate for a Stage. Supported only for
    -- WebSocket APIs.
    CreateStage -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
    -- | A map that defines the stage variables for a Stage. Variable names can
    -- have alphanumeric and underscore characters, and the values must match
    -- [A-Za-z0-9-._~:\/?#&=,]+.
    CreateStage -> Maybe (HashMap Text Text)
stageVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies whether updates to an API automatically trigger a new
    -- deployment. The default value is false.
    CreateStage -> Maybe Bool
autoDeploy :: Prelude.Maybe Prelude.Bool,
    -- | The default route settings for the stage.
    CreateStage -> Maybe RouteSettings
defaultRouteSettings :: Prelude.Maybe RouteSettings,
    -- | The description for the API stage.
    CreateStage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    CreateStage -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The API identifier.
    CreateStage -> Text
apiId :: Prelude.Text,
    -- | The name of the stage.
    CreateStage -> Text
stageName :: Prelude.Text
  }
  deriving (CreateStage -> CreateStage -> Bool
(CreateStage -> CreateStage -> Bool)
-> (CreateStage -> CreateStage -> Bool) -> Eq CreateStage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStage -> CreateStage -> Bool
$c/= :: CreateStage -> CreateStage -> Bool
== :: CreateStage -> CreateStage -> Bool
$c== :: CreateStage -> CreateStage -> Bool
Prelude.Eq, ReadPrec [CreateStage]
ReadPrec CreateStage
Int -> ReadS CreateStage
ReadS [CreateStage]
(Int -> ReadS CreateStage)
-> ReadS [CreateStage]
-> ReadPrec CreateStage
-> ReadPrec [CreateStage]
-> Read CreateStage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStage]
$creadListPrec :: ReadPrec [CreateStage]
readPrec :: ReadPrec CreateStage
$creadPrec :: ReadPrec CreateStage
readList :: ReadS [CreateStage]
$creadList :: ReadS [CreateStage]
readsPrec :: Int -> ReadS CreateStage
$creadsPrec :: Int -> ReadS CreateStage
Prelude.Read, Int -> CreateStage -> ShowS
[CreateStage] -> ShowS
CreateStage -> String
(Int -> CreateStage -> ShowS)
-> (CreateStage -> String)
-> ([CreateStage] -> ShowS)
-> Show CreateStage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStage] -> ShowS
$cshowList :: [CreateStage] -> ShowS
show :: CreateStage -> String
$cshow :: CreateStage -> String
showsPrec :: Int -> CreateStage -> ShowS
$cshowsPrec :: Int -> CreateStage -> ShowS
Prelude.Show, (forall x. CreateStage -> Rep CreateStage x)
-> (forall x. Rep CreateStage x -> CreateStage)
-> Generic CreateStage
forall x. Rep CreateStage x -> CreateStage
forall x. CreateStage -> Rep CreateStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStage x -> CreateStage
$cfrom :: forall x. CreateStage -> Rep CreateStage x
Prelude.Generic)

-- |
-- Create a value of 'CreateStage' 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', 'createStage_deploymentId' - The deployment identifier of the API stage.
--
-- 'routeSettings', 'createStage_routeSettings' - Route settings for the stage, by routeKey.
--
-- 'accessLogSettings', 'createStage_accessLogSettings' - Settings for logging access in this stage.
--
-- 'clientCertificateId', 'createStage_clientCertificateId' - The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
--
-- 'stageVariables', 'createStage_stageVariables' - A map that defines the stage variables for a Stage. Variable names can
-- have alphanumeric and underscore characters, and the values must match
-- [A-Za-z0-9-._~:\/?#&=,]+.
--
-- 'autoDeploy', 'createStage_autoDeploy' - Specifies whether updates to an API automatically trigger a new
-- deployment. The default value is false.
--
-- 'defaultRouteSettings', 'createStage_defaultRouteSettings' - The default route settings for the stage.
--
-- 'description', 'createStage_description' - The description for the API stage.
--
-- 'tags', 'createStage_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'apiId', 'createStage_apiId' - The API identifier.
--
-- 'stageName', 'createStage_stageName' - The name of the stage.
newCreateStage ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'stageName'
  Prelude.Text ->
  CreateStage
newCreateStage :: Text -> Text -> CreateStage
newCreateStage Text
pApiId_ Text
pStageName_ =
  CreateStage' :: Maybe Text
-> Maybe (HashMap Text RouteSettings)
-> Maybe AccessLogSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe RouteSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> CreateStage
CreateStage'
    { $sel:deploymentId:CreateStage' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSettings:CreateStage' :: Maybe (HashMap Text RouteSettings)
routeSettings = Maybe (HashMap Text RouteSettings)
forall a. Maybe a
Prelude.Nothing,
      $sel:accessLogSettings:CreateStage' :: Maybe AccessLogSettings
accessLogSettings = Maybe AccessLogSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:clientCertificateId:CreateStage' :: Maybe Text
clientCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stageVariables:CreateStage' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:autoDeploy:CreateStage' :: Maybe Bool
autoDeploy = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRouteSettings:CreateStage' :: Maybe RouteSettings
defaultRouteSettings = Maybe RouteSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateStage' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateStage' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:CreateStage' :: Text
apiId = Text
pApiId_,
      $sel:stageName:CreateStage' :: Text
stageName = Text
pStageName_
    }

-- | The deployment identifier of the API stage.
createStage_deploymentId :: Lens.Lens' CreateStage (Prelude.Maybe Prelude.Text)
createStage_deploymentId :: (Maybe Text -> f (Maybe Text)) -> CreateStage -> f CreateStage
createStage_deploymentId = (CreateStage -> Maybe Text)
-> (CreateStage -> Maybe Text -> CreateStage)
-> Lens CreateStage CreateStage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CreateStage' :: CreateStage -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CreateStage
s@CreateStage' {} Maybe Text
a -> CreateStage
s {$sel:deploymentId:CreateStage' :: Maybe Text
deploymentId = Maybe Text
a} :: CreateStage)

-- | Route settings for the stage, by routeKey.
createStage_routeSettings :: Lens.Lens' CreateStage (Prelude.Maybe (Prelude.HashMap Prelude.Text RouteSettings))
createStage_routeSettings :: (Maybe (HashMap Text RouteSettings)
 -> f (Maybe (HashMap Text RouteSettings)))
-> CreateStage -> f CreateStage
createStage_routeSettings = (CreateStage -> Maybe (HashMap Text RouteSettings))
-> (CreateStage
    -> Maybe (HashMap Text RouteSettings) -> CreateStage)
-> Lens
     CreateStage
     CreateStage
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe (HashMap Text RouteSettings)
routeSettings :: Maybe (HashMap Text RouteSettings)
$sel:routeSettings:CreateStage' :: CreateStage -> Maybe (HashMap Text RouteSettings)
routeSettings} -> Maybe (HashMap Text RouteSettings)
routeSettings) (\s :: CreateStage
s@CreateStage' {} Maybe (HashMap Text RouteSettings)
a -> CreateStage
s {$sel:routeSettings:CreateStage' :: Maybe (HashMap Text RouteSettings)
routeSettings = Maybe (HashMap Text RouteSettings)
a} :: CreateStage) ((Maybe (HashMap Text RouteSettings)
  -> f (Maybe (HashMap Text RouteSettings)))
 -> CreateStage -> f CreateStage)
-> ((Maybe (HashMap Text RouteSettings)
     -> f (Maybe (HashMap Text RouteSettings)))
    -> Maybe (HashMap Text RouteSettings)
    -> f (Maybe (HashMap Text RouteSettings)))
-> (Maybe (HashMap Text RouteSettings)
    -> f (Maybe (HashMap Text RouteSettings)))
-> CreateStage
-> f CreateStage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
-> Iso
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
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 RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Settings for logging access in this stage.
createStage_accessLogSettings :: Lens.Lens' CreateStage (Prelude.Maybe AccessLogSettings)
createStage_accessLogSettings :: (Maybe AccessLogSettings -> f (Maybe AccessLogSettings))
-> CreateStage -> f CreateStage
createStage_accessLogSettings = (CreateStage -> Maybe AccessLogSettings)
-> (CreateStage -> Maybe AccessLogSettings -> CreateStage)
-> Lens
     CreateStage
     CreateStage
     (Maybe AccessLogSettings)
     (Maybe AccessLogSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe AccessLogSettings
accessLogSettings :: Maybe AccessLogSettings
$sel:accessLogSettings:CreateStage' :: CreateStage -> Maybe AccessLogSettings
accessLogSettings} -> Maybe AccessLogSettings
accessLogSettings) (\s :: CreateStage
s@CreateStage' {} Maybe AccessLogSettings
a -> CreateStage
s {$sel:accessLogSettings:CreateStage' :: Maybe AccessLogSettings
accessLogSettings = Maybe AccessLogSettings
a} :: CreateStage)

-- | The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
createStage_clientCertificateId :: Lens.Lens' CreateStage (Prelude.Maybe Prelude.Text)
createStage_clientCertificateId :: (Maybe Text -> f (Maybe Text)) -> CreateStage -> f CreateStage
createStage_clientCertificateId = (CreateStage -> Maybe Text)
-> (CreateStage -> Maybe Text -> CreateStage)
-> Lens CreateStage CreateStage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe Text
clientCertificateId :: Maybe Text
$sel:clientCertificateId:CreateStage' :: CreateStage -> Maybe Text
clientCertificateId} -> Maybe Text
clientCertificateId) (\s :: CreateStage
s@CreateStage' {} Maybe Text
a -> CreateStage
s {$sel:clientCertificateId:CreateStage' :: Maybe Text
clientCertificateId = Maybe Text
a} :: CreateStage)

-- | A map that defines the stage variables for a Stage. Variable names can
-- have alphanumeric and underscore characters, and the values must match
-- [A-Za-z0-9-._~:\/?#&=,]+.
createStage_stageVariables :: Lens.Lens' CreateStage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createStage_stageVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStage -> f CreateStage
createStage_stageVariables = (CreateStage -> Maybe (HashMap Text Text))
-> (CreateStage -> Maybe (HashMap Text Text) -> CreateStage)
-> Lens
     CreateStage
     CreateStage
     (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 (\CreateStage' {Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
$sel:stageVariables:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
stageVariables} -> Maybe (HashMap Text Text)
stageVariables) (\s :: CreateStage
s@CreateStage' {} Maybe (HashMap Text Text)
a -> CreateStage
s {$sel:stageVariables:CreateStage' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
a} :: CreateStage) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateStage -> f CreateStage)
-> ((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)))
-> CreateStage
-> f CreateStage
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

-- | Specifies whether updates to an API automatically trigger a new
-- deployment. The default value is false.
createStage_autoDeploy :: Lens.Lens' CreateStage (Prelude.Maybe Prelude.Bool)
createStage_autoDeploy :: (Maybe Bool -> f (Maybe Bool)) -> CreateStage -> f CreateStage
createStage_autoDeploy = (CreateStage -> Maybe Bool)
-> (CreateStage -> Maybe Bool -> CreateStage)
-> Lens CreateStage CreateStage (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe Bool
autoDeploy :: Maybe Bool
$sel:autoDeploy:CreateStage' :: CreateStage -> Maybe Bool
autoDeploy} -> Maybe Bool
autoDeploy) (\s :: CreateStage
s@CreateStage' {} Maybe Bool
a -> CreateStage
s {$sel:autoDeploy:CreateStage' :: Maybe Bool
autoDeploy = Maybe Bool
a} :: CreateStage)

-- | The default route settings for the stage.
createStage_defaultRouteSettings :: Lens.Lens' CreateStage (Prelude.Maybe RouteSettings)
createStage_defaultRouteSettings :: (Maybe RouteSettings -> f (Maybe RouteSettings))
-> CreateStage -> f CreateStage
createStage_defaultRouteSettings = (CreateStage -> Maybe RouteSettings)
-> (CreateStage -> Maybe RouteSettings -> CreateStage)
-> Lens
     CreateStage CreateStage (Maybe RouteSettings) (Maybe RouteSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe RouteSettings
defaultRouteSettings :: Maybe RouteSettings
$sel:defaultRouteSettings:CreateStage' :: CreateStage -> Maybe RouteSettings
defaultRouteSettings} -> Maybe RouteSettings
defaultRouteSettings) (\s :: CreateStage
s@CreateStage' {} Maybe RouteSettings
a -> CreateStage
s {$sel:defaultRouteSettings:CreateStage' :: Maybe RouteSettings
defaultRouteSettings = Maybe RouteSettings
a} :: CreateStage)

-- | The description for the API stage.
createStage_description :: Lens.Lens' CreateStage (Prelude.Maybe Prelude.Text)
createStage_description :: (Maybe Text -> f (Maybe Text)) -> CreateStage -> f CreateStage
createStage_description = (CreateStage -> Maybe Text)
-> (CreateStage -> Maybe Text -> CreateStage)
-> Lens CreateStage CreateStage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Maybe Text
description :: Maybe Text
$sel:description:CreateStage' :: CreateStage -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateStage
s@CreateStage' {} Maybe Text
a -> CreateStage
s {$sel:description:CreateStage' :: Maybe Text
description = Maybe Text
a} :: CreateStage)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
createStage_tags :: Lens.Lens' CreateStage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createStage_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStage -> f CreateStage
createStage_tags = (CreateStage -> Maybe (HashMap Text Text))
-> (CreateStage -> Maybe (HashMap Text Text) -> CreateStage)
-> Lens
     CreateStage
     CreateStage
     (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 (\CreateStage' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateStage
s@CreateStage' {} Maybe (HashMap Text Text)
a -> CreateStage
s {$sel:tags:CreateStage' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateStage) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateStage -> f CreateStage)
-> ((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)))
-> CreateStage
-> f CreateStage
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

-- | The API identifier.
createStage_apiId :: Lens.Lens' CreateStage Prelude.Text
createStage_apiId :: (Text -> f Text) -> CreateStage -> f CreateStage
createStage_apiId = (CreateStage -> Text)
-> (CreateStage -> Text -> CreateStage)
-> Lens CreateStage CreateStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Text
apiId :: Text
$sel:apiId:CreateStage' :: CreateStage -> Text
apiId} -> Text
apiId) (\s :: CreateStage
s@CreateStage' {} Text
a -> CreateStage
s {$sel:apiId:CreateStage' :: Text
apiId = Text
a} :: CreateStage)

-- | The name of the stage.
createStage_stageName :: Lens.Lens' CreateStage Prelude.Text
createStage_stageName :: (Text -> f Text) -> CreateStage -> f CreateStage
createStage_stageName = (CreateStage -> Text)
-> (CreateStage -> Text -> CreateStage)
-> Lens CreateStage CreateStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStage' {Text
stageName :: Text
$sel:stageName:CreateStage' :: CreateStage -> Text
stageName} -> Text
stageName) (\s :: CreateStage
s@CreateStage' {} Text
a -> CreateStage
s {$sel:stageName:CreateStage' :: Text
stageName = Text
a} :: CreateStage)

instance Core.AWSRequest CreateStage where
  type AWSResponse CreateStage = CreateStageResponse
  request :: CreateStage -> Request CreateStage
request = Service -> CreateStage -> Request CreateStage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateStage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateStage))
-> Logger
-> Service
-> Proxy CreateStage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateStage)))
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
-> Maybe (HashMap Text RouteSettings)
-> Maybe AccessLogSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe POSIX
-> Maybe RouteSettings
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateStageResponse
CreateStageResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text RouteSettings)
 -> Maybe AccessLogSettings
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Bool
 -> Maybe POSIX
 -> Maybe RouteSettings
 -> Maybe Bool
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateStageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text RouteSettings)
      -> Maybe AccessLogSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
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
"lastDeploymentStatusMessage")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text RouteSettings)
   -> Maybe AccessLogSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text RouteSettings)
      -> Maybe AccessLogSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
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
"deploymentId")
            Either
  String
  (Maybe (HashMap Text RouteSettings)
   -> Maybe AccessLogSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe (HashMap Text RouteSettings))
-> Either
     String
     (Maybe AccessLogSettings
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text RouteSettings)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"routeSettings" Either String (Maybe (Maybe (HashMap Text RouteSettings)))
-> Maybe (HashMap Text RouteSettings)
-> Either String (Maybe (HashMap Text RouteSettings))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text RouteSettings)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe AccessLogSettings
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe AccessLogSettings)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AccessLogSettings)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"accessLogSettings")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
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
"clientCertificateId")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe Bool
      -> Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"stageVariables" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Bool
   -> Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe POSIX
      -> Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"autoDeploy")
            Either
  String
  (Maybe POSIX
   -> Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe RouteSettings
      -> Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdDate")
            Either
  String
  (Maybe RouteSettings
   -> Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe RouteSettings)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe RouteSettings)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"defaultRouteSettings")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiGatewayManaged")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateStageResponse)
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
"stageName")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateStageResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastUpdatedDate")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> CreateStageResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> CreateStageResponse)
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
"description")
            Either
  String (Maybe (HashMap Text Text) -> Int -> CreateStageResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateStageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateStageResponse)
-> Either String Int -> Either String CreateStageResponse
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 CreateStage

instance Prelude.NFData CreateStage

instance Core.ToHeaders CreateStage where
  toHeaders :: CreateStage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateStage -> 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 CreateStage where
  toJSON :: CreateStage -> Value
toJSON CreateStage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text RouteSettings)
Maybe AccessLogSettings
Maybe RouteSettings
Text
stageName :: Text
apiId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
defaultRouteSettings :: Maybe RouteSettings
autoDeploy :: Maybe Bool
stageVariables :: Maybe (HashMap Text Text)
clientCertificateId :: Maybe Text
accessLogSettings :: Maybe AccessLogSettings
routeSettings :: Maybe (HashMap Text RouteSettings)
deploymentId :: Maybe Text
$sel:stageName:CreateStage' :: CreateStage -> Text
$sel:apiId:CreateStage' :: CreateStage -> Text
$sel:tags:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
$sel:description:CreateStage' :: CreateStage -> Maybe Text
$sel:defaultRouteSettings:CreateStage' :: CreateStage -> Maybe RouteSettings
$sel:autoDeploy:CreateStage' :: CreateStage -> Maybe Bool
$sel:stageVariables:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
$sel:clientCertificateId:CreateStage' :: CreateStage -> Maybe Text
$sel:accessLogSettings:CreateStage' :: CreateStage -> Maybe AccessLogSettings
$sel:routeSettings:CreateStage' :: CreateStage -> Maybe (HashMap Text RouteSettings)
$sel:deploymentId:CreateStage' :: CreateStage -> 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
"routeSettings" Text -> HashMap Text RouteSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text RouteSettings -> Pair)
-> Maybe (HashMap Text RouteSettings) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text RouteSettings)
routeSettings,
            (Text
"accessLogSettings" Text -> AccessLogSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AccessLogSettings -> Pair)
-> Maybe AccessLogSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessLogSettings
accessLogSettings,
            (Text
"clientCertificateId" 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
clientCertificateId,
            (Text
"stageVariables" 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)
stageVariables,
            (Text
"autoDeploy" 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
autoDeploy,
            (Text
"defaultRouteSettings" Text -> RouteSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RouteSettings -> Pair) -> Maybe RouteSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RouteSettings
defaultRouteSettings,
            (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
"tags" 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)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"stageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stageName)
          ]
      )

instance Core.ToPath CreateStage where
  toPath :: CreateStage -> ByteString
toPath CreateStage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text RouteSettings)
Maybe AccessLogSettings
Maybe RouteSettings
Text
stageName :: Text
apiId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
defaultRouteSettings :: Maybe RouteSettings
autoDeploy :: Maybe Bool
stageVariables :: Maybe (HashMap Text Text)
clientCertificateId :: Maybe Text
accessLogSettings :: Maybe AccessLogSettings
routeSettings :: Maybe (HashMap Text RouteSettings)
deploymentId :: Maybe Text
$sel:stageName:CreateStage' :: CreateStage -> Text
$sel:apiId:CreateStage' :: CreateStage -> Text
$sel:tags:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
$sel:description:CreateStage' :: CreateStage -> Maybe Text
$sel:defaultRouteSettings:CreateStage' :: CreateStage -> Maybe RouteSettings
$sel:autoDeploy:CreateStage' :: CreateStage -> Maybe Bool
$sel:stageVariables:CreateStage' :: CreateStage -> Maybe (HashMap Text Text)
$sel:clientCertificateId:CreateStage' :: CreateStage -> Maybe Text
$sel:accessLogSettings:CreateStage' :: CreateStage -> Maybe AccessLogSettings
$sel:routeSettings:CreateStage' :: CreateStage -> Maybe (HashMap Text RouteSettings)
$sel:deploymentId:CreateStage' :: CreateStage -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/stages"]

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

-- | /See:/ 'newCreateStageResponse' smart constructor.
data CreateStageResponse = CreateStageResponse'
  { -- | Describes the status of the last deployment of a stage. Supported only
    -- for stages with autoDeploy enabled.
    CreateStageResponse -> Maybe Text
lastDeploymentStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Deployment that the Stage is associated with.
    -- Can\'t be updated if autoDeploy is enabled.
    CreateStageResponse -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | Route settings for the stage, by routeKey.
    CreateStageResponse -> Maybe (HashMap Text RouteSettings)
routeSettings :: Prelude.Maybe (Prelude.HashMap Prelude.Text RouteSettings),
    -- | Settings for logging access in this stage.
    CreateStageResponse -> Maybe AccessLogSettings
accessLogSettings :: Prelude.Maybe AccessLogSettings,
    -- | The identifier of a client certificate for a Stage. Supported only for
    -- WebSocket APIs.
    CreateStageResponse -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
    -- | A map that defines the stage variables for a stage resource. Variable
    -- names can have alphanumeric and underscore characters, and the values
    -- must match [A-Za-z0-9-._~:\/?#&=,]+.
    CreateStageResponse -> Maybe (HashMap Text Text)
stageVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies whether updates to an API automatically trigger a new
    -- deployment. The default value is false.
    CreateStageResponse -> Maybe Bool
autoDeploy :: Prelude.Maybe Prelude.Bool,
    -- | The timestamp when the stage was created.
    CreateStageResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | Default route settings for the stage.
    CreateStageResponse -> Maybe RouteSettings
defaultRouteSettings :: Prelude.Maybe RouteSettings,
    -- | Specifies whether a stage is managed by API Gateway. If you created an
    -- API using quick create, the $default stage is managed by API Gateway.
    -- You can\'t modify the $default stage.
    CreateStageResponse -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | The name of the stage.
    CreateStageResponse -> Maybe Text
stageName :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the stage was last updated.
    CreateStageResponse -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
    -- | The description of the stage.
    CreateStageResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    CreateStageResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateStageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateStageResponse -> CreateStageResponse -> Bool
(CreateStageResponse -> CreateStageResponse -> Bool)
-> (CreateStageResponse -> CreateStageResponse -> Bool)
-> Eq CreateStageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStageResponse -> CreateStageResponse -> Bool
$c/= :: CreateStageResponse -> CreateStageResponse -> Bool
== :: CreateStageResponse -> CreateStageResponse -> Bool
$c== :: CreateStageResponse -> CreateStageResponse -> Bool
Prelude.Eq, ReadPrec [CreateStageResponse]
ReadPrec CreateStageResponse
Int -> ReadS CreateStageResponse
ReadS [CreateStageResponse]
(Int -> ReadS CreateStageResponse)
-> ReadS [CreateStageResponse]
-> ReadPrec CreateStageResponse
-> ReadPrec [CreateStageResponse]
-> Read CreateStageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStageResponse]
$creadListPrec :: ReadPrec [CreateStageResponse]
readPrec :: ReadPrec CreateStageResponse
$creadPrec :: ReadPrec CreateStageResponse
readList :: ReadS [CreateStageResponse]
$creadList :: ReadS [CreateStageResponse]
readsPrec :: Int -> ReadS CreateStageResponse
$creadsPrec :: Int -> ReadS CreateStageResponse
Prelude.Read, Int -> CreateStageResponse -> ShowS
[CreateStageResponse] -> ShowS
CreateStageResponse -> String
(Int -> CreateStageResponse -> ShowS)
-> (CreateStageResponse -> String)
-> ([CreateStageResponse] -> ShowS)
-> Show CreateStageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStageResponse] -> ShowS
$cshowList :: [CreateStageResponse] -> ShowS
show :: CreateStageResponse -> String
$cshow :: CreateStageResponse -> String
showsPrec :: Int -> CreateStageResponse -> ShowS
$cshowsPrec :: Int -> CreateStageResponse -> ShowS
Prelude.Show, (forall x. CreateStageResponse -> Rep CreateStageResponse x)
-> (forall x. Rep CreateStageResponse x -> CreateStageResponse)
-> Generic CreateStageResponse
forall x. Rep CreateStageResponse x -> CreateStageResponse
forall x. CreateStageResponse -> Rep CreateStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStageResponse x -> CreateStageResponse
$cfrom :: forall x. CreateStageResponse -> Rep CreateStageResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateStageResponse' 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:
--
-- 'lastDeploymentStatusMessage', 'createStageResponse_lastDeploymentStatusMessage' - Describes the status of the last deployment of a stage. Supported only
-- for stages with autoDeploy enabled.
--
-- 'deploymentId', 'createStageResponse_deploymentId' - The identifier of the Deployment that the Stage is associated with.
-- Can\'t be updated if autoDeploy is enabled.
--
-- 'routeSettings', 'createStageResponse_routeSettings' - Route settings for the stage, by routeKey.
--
-- 'accessLogSettings', 'createStageResponse_accessLogSettings' - Settings for logging access in this stage.
--
-- 'clientCertificateId', 'createStageResponse_clientCertificateId' - The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
--
-- 'stageVariables', 'createStageResponse_stageVariables' - A map that defines the stage variables for a stage resource. Variable
-- names can have alphanumeric and underscore characters, and the values
-- must match [A-Za-z0-9-._~:\/?#&=,]+.
--
-- 'autoDeploy', 'createStageResponse_autoDeploy' - Specifies whether updates to an API automatically trigger a new
-- deployment. The default value is false.
--
-- 'createdDate', 'createStageResponse_createdDate' - The timestamp when the stage was created.
--
-- 'defaultRouteSettings', 'createStageResponse_defaultRouteSettings' - Default route settings for the stage.
--
-- 'apiGatewayManaged', 'createStageResponse_apiGatewayManaged' - Specifies whether a stage is managed by API Gateway. If you created an
-- API using quick create, the $default stage is managed by API Gateway.
-- You can\'t modify the $default stage.
--
-- 'stageName', 'createStageResponse_stageName' - The name of the stage.
--
-- 'lastUpdatedDate', 'createStageResponse_lastUpdatedDate' - The timestamp when the stage was last updated.
--
-- 'description', 'createStageResponse_description' - The description of the stage.
--
-- 'tags', 'createStageResponse_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'httpStatus', 'createStageResponse_httpStatus' - The response's http status code.
newCreateStageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateStageResponse
newCreateStageResponse :: Int -> CreateStageResponse
newCreateStageResponse Int
pHttpStatus_ =
  CreateStageResponse' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text RouteSettings)
-> Maybe AccessLogSettings
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe POSIX
-> Maybe RouteSettings
-> Maybe Bool
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateStageResponse
CreateStageResponse'
    { $sel:lastDeploymentStatusMessage:CreateStageResponse' :: Maybe Text
lastDeploymentStatusMessage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentId:CreateStageResponse' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSettings:CreateStageResponse' :: Maybe (HashMap Text RouteSettings)
routeSettings = Maybe (HashMap Text RouteSettings)
forall a. Maybe a
Prelude.Nothing,
      $sel:accessLogSettings:CreateStageResponse' :: Maybe AccessLogSettings
accessLogSettings = Maybe AccessLogSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:clientCertificateId:CreateStageResponse' :: Maybe Text
clientCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stageVariables:CreateStageResponse' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:autoDeploy:CreateStageResponse' :: Maybe Bool
autoDeploy = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:CreateStageResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRouteSettings:CreateStageResponse' :: Maybe RouteSettings
defaultRouteSettings = Maybe RouteSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:CreateStageResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:stageName:CreateStageResponse' :: Maybe Text
stageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:CreateStageResponse' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateStageResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateStageResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateStageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Describes the status of the last deployment of a stage. Supported only
-- for stages with autoDeploy enabled.
createStageResponse_lastDeploymentStatusMessage :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Text)
createStageResponse_lastDeploymentStatusMessage :: (Maybe Text -> f (Maybe Text))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_lastDeploymentStatusMessage = (CreateStageResponse -> Maybe Text)
-> (CreateStageResponse -> Maybe Text -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Text
lastDeploymentStatusMessage :: Maybe Text
$sel:lastDeploymentStatusMessage:CreateStageResponse' :: CreateStageResponse -> Maybe Text
lastDeploymentStatusMessage} -> Maybe Text
lastDeploymentStatusMessage) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Text
a -> CreateStageResponse
s {$sel:lastDeploymentStatusMessage:CreateStageResponse' :: Maybe Text
lastDeploymentStatusMessage = Maybe Text
a} :: CreateStageResponse)

-- | The identifier of the Deployment that the Stage is associated with.
-- Can\'t be updated if autoDeploy is enabled.
createStageResponse_deploymentId :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Text)
createStageResponse_deploymentId :: (Maybe Text -> f (Maybe Text))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_deploymentId = (CreateStageResponse -> Maybe Text)
-> (CreateStageResponse -> Maybe Text -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CreateStageResponse' :: CreateStageResponse -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Text
a -> CreateStageResponse
s {$sel:deploymentId:CreateStageResponse' :: Maybe Text
deploymentId = Maybe Text
a} :: CreateStageResponse)

-- | Route settings for the stage, by routeKey.
createStageResponse_routeSettings :: Lens.Lens' CreateStageResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text RouteSettings))
createStageResponse_routeSettings :: (Maybe (HashMap Text RouteSettings)
 -> f (Maybe (HashMap Text RouteSettings)))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_routeSettings = (CreateStageResponse -> Maybe (HashMap Text RouteSettings))
-> (CreateStageResponse
    -> Maybe (HashMap Text RouteSettings) -> CreateStageResponse)
-> Lens
     CreateStageResponse
     CreateStageResponse
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe (HashMap Text RouteSettings)
routeSettings :: Maybe (HashMap Text RouteSettings)
$sel:routeSettings:CreateStageResponse' :: CreateStageResponse -> Maybe (HashMap Text RouteSettings)
routeSettings} -> Maybe (HashMap Text RouteSettings)
routeSettings) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe (HashMap Text RouteSettings)
a -> CreateStageResponse
s {$sel:routeSettings:CreateStageResponse' :: Maybe (HashMap Text RouteSettings)
routeSettings = Maybe (HashMap Text RouteSettings)
a} :: CreateStageResponse) ((Maybe (HashMap Text RouteSettings)
  -> f (Maybe (HashMap Text RouteSettings)))
 -> CreateStageResponse -> f CreateStageResponse)
-> ((Maybe (HashMap Text RouteSettings)
     -> f (Maybe (HashMap Text RouteSettings)))
    -> Maybe (HashMap Text RouteSettings)
    -> f (Maybe (HashMap Text RouteSettings)))
-> (Maybe (HashMap Text RouteSettings)
    -> f (Maybe (HashMap Text RouteSettings)))
-> CreateStageResponse
-> f CreateStageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
-> Iso
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
     (Maybe (HashMap Text RouteSettings))
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 RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
  (HashMap Text RouteSettings)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Settings for logging access in this stage.
createStageResponse_accessLogSettings :: Lens.Lens' CreateStageResponse (Prelude.Maybe AccessLogSettings)
createStageResponse_accessLogSettings :: (Maybe AccessLogSettings -> f (Maybe AccessLogSettings))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_accessLogSettings = (CreateStageResponse -> Maybe AccessLogSettings)
-> (CreateStageResponse
    -> Maybe AccessLogSettings -> CreateStageResponse)
-> Lens
     CreateStageResponse
     CreateStageResponse
     (Maybe AccessLogSettings)
     (Maybe AccessLogSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe AccessLogSettings
accessLogSettings :: Maybe AccessLogSettings
$sel:accessLogSettings:CreateStageResponse' :: CreateStageResponse -> Maybe AccessLogSettings
accessLogSettings} -> Maybe AccessLogSettings
accessLogSettings) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe AccessLogSettings
a -> CreateStageResponse
s {$sel:accessLogSettings:CreateStageResponse' :: Maybe AccessLogSettings
accessLogSettings = Maybe AccessLogSettings
a} :: CreateStageResponse)

-- | The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
createStageResponse_clientCertificateId :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Text)
createStageResponse_clientCertificateId :: (Maybe Text -> f (Maybe Text))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_clientCertificateId = (CreateStageResponse -> Maybe Text)
-> (CreateStageResponse -> Maybe Text -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Text
clientCertificateId :: Maybe Text
$sel:clientCertificateId:CreateStageResponse' :: CreateStageResponse -> Maybe Text
clientCertificateId} -> Maybe Text
clientCertificateId) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Text
a -> CreateStageResponse
s {$sel:clientCertificateId:CreateStageResponse' :: Maybe Text
clientCertificateId = Maybe Text
a} :: CreateStageResponse)

-- | A map that defines the stage variables for a stage resource. Variable
-- names can have alphanumeric and underscore characters, and the values
-- must match [A-Za-z0-9-._~:\/?#&=,]+.
createStageResponse_stageVariables :: Lens.Lens' CreateStageResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createStageResponse_stageVariables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_stageVariables = (CreateStageResponse -> Maybe (HashMap Text Text))
-> (CreateStageResponse
    -> Maybe (HashMap Text Text) -> CreateStageResponse)
-> Lens
     CreateStageResponse
     CreateStageResponse
     (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 (\CreateStageResponse' {Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
$sel:stageVariables:CreateStageResponse' :: CreateStageResponse -> Maybe (HashMap Text Text)
stageVariables} -> Maybe (HashMap Text Text)
stageVariables) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe (HashMap Text Text)
a -> CreateStageResponse
s {$sel:stageVariables:CreateStageResponse' :: Maybe (HashMap Text Text)
stageVariables = Maybe (HashMap Text Text)
a} :: CreateStageResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateStageResponse -> f CreateStageResponse)
-> ((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)))
-> CreateStageResponse
-> f CreateStageResponse
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

-- | Specifies whether updates to an API automatically trigger a new
-- deployment. The default value is false.
createStageResponse_autoDeploy :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Bool)
createStageResponse_autoDeploy :: (Maybe Bool -> f (Maybe Bool))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_autoDeploy = (CreateStageResponse -> Maybe Bool)
-> (CreateStageResponse -> Maybe Bool -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Bool
autoDeploy :: Maybe Bool
$sel:autoDeploy:CreateStageResponse' :: CreateStageResponse -> Maybe Bool
autoDeploy} -> Maybe Bool
autoDeploy) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Bool
a -> CreateStageResponse
s {$sel:autoDeploy:CreateStageResponse' :: Maybe Bool
autoDeploy = Maybe Bool
a} :: CreateStageResponse)

-- | The timestamp when the stage was created.
createStageResponse_createdDate :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.UTCTime)
createStageResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_createdDate = (CreateStageResponse -> Maybe POSIX)
-> (CreateStageResponse -> Maybe POSIX -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:CreateStageResponse' :: CreateStageResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe POSIX
a -> CreateStageResponse
s {$sel:createdDate:CreateStageResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: CreateStageResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateStageResponse -> f CreateStageResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStageResponse
-> f CreateStageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Default route settings for the stage.
createStageResponse_defaultRouteSettings :: Lens.Lens' CreateStageResponse (Prelude.Maybe RouteSettings)
createStageResponse_defaultRouteSettings :: (Maybe RouteSettings -> f (Maybe RouteSettings))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_defaultRouteSettings = (CreateStageResponse -> Maybe RouteSettings)
-> (CreateStageResponse
    -> Maybe RouteSettings -> CreateStageResponse)
-> Lens
     CreateStageResponse
     CreateStageResponse
     (Maybe RouteSettings)
     (Maybe RouteSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe RouteSettings
defaultRouteSettings :: Maybe RouteSettings
$sel:defaultRouteSettings:CreateStageResponse' :: CreateStageResponse -> Maybe RouteSettings
defaultRouteSettings} -> Maybe RouteSettings
defaultRouteSettings) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe RouteSettings
a -> CreateStageResponse
s {$sel:defaultRouteSettings:CreateStageResponse' :: Maybe RouteSettings
defaultRouteSettings = Maybe RouteSettings
a} :: CreateStageResponse)

-- | Specifies whether a stage is managed by API Gateway. If you created an
-- API using quick create, the $default stage is managed by API Gateway.
-- You can\'t modify the $default stage.
createStageResponse_apiGatewayManaged :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Bool)
createStageResponse_apiGatewayManaged :: (Maybe Bool -> f (Maybe Bool))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_apiGatewayManaged = (CreateStageResponse -> Maybe Bool)
-> (CreateStageResponse -> Maybe Bool -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:apiGatewayManaged:CreateStageResponse' :: CreateStageResponse -> Maybe Bool
apiGatewayManaged} -> Maybe Bool
apiGatewayManaged) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Bool
a -> CreateStageResponse
s {$sel:apiGatewayManaged:CreateStageResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
a} :: CreateStageResponse)

-- | The name of the stage.
createStageResponse_stageName :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Text)
createStageResponse_stageName :: (Maybe Text -> f (Maybe Text))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_stageName = (CreateStageResponse -> Maybe Text)
-> (CreateStageResponse -> Maybe Text -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Text
stageName :: Maybe Text
$sel:stageName:CreateStageResponse' :: CreateStageResponse -> Maybe Text
stageName} -> Maybe Text
stageName) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Text
a -> CreateStageResponse
s {$sel:stageName:CreateStageResponse' :: Maybe Text
stageName = Maybe Text
a} :: CreateStageResponse)

-- | The timestamp when the stage was last updated.
createStageResponse_lastUpdatedDate :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.UTCTime)
createStageResponse_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_lastUpdatedDate = (CreateStageResponse -> Maybe POSIX)
-> (CreateStageResponse -> Maybe POSIX -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:CreateStageResponse' :: CreateStageResponse -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe POSIX
a -> CreateStageResponse
s {$sel:lastUpdatedDate:CreateStageResponse' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: CreateStageResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateStageResponse -> f CreateStageResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateStageResponse
-> f CreateStageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description of the stage.
createStageResponse_description :: Lens.Lens' CreateStageResponse (Prelude.Maybe Prelude.Text)
createStageResponse_description :: (Maybe Text -> f (Maybe Text))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_description = (CreateStageResponse -> Maybe Text)
-> (CreateStageResponse -> Maybe Text -> CreateStageResponse)
-> Lens
     CreateStageResponse CreateStageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStageResponse' {Maybe Text
description :: Maybe Text
$sel:description:CreateStageResponse' :: CreateStageResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe Text
a -> CreateStageResponse
s {$sel:description:CreateStageResponse' :: Maybe Text
description = Maybe Text
a} :: CreateStageResponse)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
createStageResponse_tags :: Lens.Lens' CreateStageResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createStageResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateStageResponse -> f CreateStageResponse
createStageResponse_tags = (CreateStageResponse -> Maybe (HashMap Text Text))
-> (CreateStageResponse
    -> Maybe (HashMap Text Text) -> CreateStageResponse)
-> Lens
     CreateStageResponse
     CreateStageResponse
     (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 (\CreateStageResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateStageResponse' :: CreateStageResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateStageResponse
s@CreateStageResponse' {} Maybe (HashMap Text Text)
a -> CreateStageResponse
s {$sel:tags:CreateStageResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateStageResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateStageResponse -> f CreateStageResponse)
-> ((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)))
-> CreateStageResponse
-> f CreateStageResponse
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

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

instance Prelude.NFData CreateStageResponse