{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.APIGateway.Types.Stage
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.APIGateway.Types.Stage where

import Amazonka.APIGateway.Types.AccessLogSettings
import Amazonka.APIGateway.Types.CacheClusterSize
import Amazonka.APIGateway.Types.CacheClusterStatus
import Amazonka.APIGateway.Types.CanarySettings
import Amazonka.APIGateway.Types.MethodSetting
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Represents a unique identifier for a version of a deployed RestApi that
-- is callable by users.
--
-- /See:/ 'newStage' smart constructor.
data Stage = Stage'
  { -- | Settings for logging access in this stage.
    Stage -> Maybe AccessLogSettings
accessLogSettings :: Prelude.Maybe AccessLogSettings,
    -- | Specifies whether a cache cluster is enabled for the stage.
    Stage -> Maybe Bool
cacheClusterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The stage\'s cache capacity in GB. For more information about choosing a
    -- cache size, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html Enabling API caching to enhance responsiveness>.
    Stage -> Maybe CacheClusterSize
cacheClusterSize :: Prelude.Maybe CacheClusterSize,
    -- | The status of the cache cluster for the stage, if enabled.
    Stage -> Maybe CacheClusterStatus
cacheClusterStatus :: Prelude.Maybe CacheClusterStatus,
    -- | Settings for the canary deployment in this stage.
    Stage -> Maybe CanarySettings
canarySettings :: Prelude.Maybe CanarySettings,
    -- | The identifier of a client certificate for an API stage.
    Stage -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the stage was created.
    Stage -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    -- | The identifier of the Deployment that the stage points to.
    Stage -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The stage\'s description.
    Stage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The version of the associated API documentation.
    Stage -> Maybe Text
documentationVersion :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the stage last updated.
    Stage -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Data.POSIX,
    -- | A map that defines the method settings for a Stage resource. Keys
    -- (designated as @\/{method_setting_key@ below) are method paths defined
    -- as @{resource_path}\/{http_method}@ for an individual method override,
    -- or @\/\\*\/\\*@ for overriding all methods in the stage.
    Stage -> Maybe (HashMap Text MethodSetting)
methodSettings :: Prelude.Maybe (Prelude.HashMap Prelude.Text MethodSetting),
    -- | The name of the stage is the first path segment in the Uniform Resource
    -- Identifier (URI) of a call to API Gateway. Stage names can only contain
    -- alphanumeric characters, hyphens, and underscores. Maximum length is 128
    -- characters.
    Stage -> Maybe Text
stageName :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    Stage -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies whether active tracing with X-ray is enabled for the Stage.
    Stage -> Maybe Bool
tracingEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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-._~:\/?#&=,]+@.
    Stage -> Maybe (HashMap Text Text)
variables :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARN of the WebAcl associated with the Stage.
    Stage -> Maybe Text
webAclArn :: Prelude.Maybe Prelude.Text
  }
  deriving (Stage -> Stage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Stage -> Stage -> Bool
$c/= :: Stage -> Stage -> Bool
== :: Stage -> Stage -> Bool
$c== :: Stage -> Stage -> Bool
Prelude.Eq, ReadPrec [Stage]
ReadPrec Stage
Int -> ReadS Stage
ReadS [Stage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Stage]
$creadListPrec :: ReadPrec [Stage]
readPrec :: ReadPrec Stage
$creadPrec :: ReadPrec Stage
readList :: ReadS [Stage]
$creadList :: ReadS [Stage]
readsPrec :: Int -> ReadS Stage
$creadsPrec :: Int -> ReadS Stage
Prelude.Read, Int -> Stage -> ShowS
[Stage] -> ShowS
Stage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Stage] -> ShowS
$cshowList :: [Stage] -> ShowS
show :: Stage -> String
$cshow :: Stage -> String
showsPrec :: Int -> Stage -> ShowS
$cshowsPrec :: Int -> Stage -> ShowS
Prelude.Show, forall x. Rep Stage x -> Stage
forall x. Stage -> Rep Stage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Stage x -> Stage
$cfrom :: forall x. Stage -> Rep Stage x
Prelude.Generic)

-- |
-- Create a value of 'Stage' 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:
--
-- 'accessLogSettings', 'stage_accessLogSettings' - Settings for logging access in this stage.
--
-- 'cacheClusterEnabled', 'stage_cacheClusterEnabled' - Specifies whether a cache cluster is enabled for the stage.
--
-- 'cacheClusterSize', 'stage_cacheClusterSize' - The stage\'s cache capacity in GB. For more information about choosing a
-- cache size, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html Enabling API caching to enhance responsiveness>.
--
-- 'cacheClusterStatus', 'stage_cacheClusterStatus' - The status of the cache cluster for the stage, if enabled.
--
-- 'canarySettings', 'stage_canarySettings' - Settings for the canary deployment in this stage.
--
-- 'clientCertificateId', 'stage_clientCertificateId' - The identifier of a client certificate for an API stage.
--
-- 'createdDate', 'stage_createdDate' - The timestamp when the stage was created.
--
-- 'deploymentId', 'stage_deploymentId' - The identifier of the Deployment that the stage points to.
--
-- 'description', 'stage_description' - The stage\'s description.
--
-- 'documentationVersion', 'stage_documentationVersion' - The version of the associated API documentation.
--
-- 'lastUpdatedDate', 'stage_lastUpdatedDate' - The timestamp when the stage last updated.
--
-- 'methodSettings', 'stage_methodSettings' - A map that defines the method settings for a Stage resource. Keys
-- (designated as @\/{method_setting_key@ below) are method paths defined
-- as @{resource_path}\/{http_method}@ for an individual method override,
-- or @\/\\*\/\\*@ for overriding all methods in the stage.
--
-- 'stageName', 'stage_stageName' - The name of the stage is the first path segment in the Uniform Resource
-- Identifier (URI) of a call to API Gateway. Stage names can only contain
-- alphanumeric characters, hyphens, and underscores. Maximum length is 128
-- characters.
--
-- 'tags', 'stage_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'tracingEnabled', 'stage_tracingEnabled' - Specifies whether active tracing with X-ray is enabled for the Stage.
--
-- 'variables', 'stage_variables' - 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-._~:\/?#&=,]+@.
--
-- 'webAclArn', 'stage_webAclArn' - The ARN of the WebAcl associated with the Stage.
newStage ::
  Stage
newStage :: Stage
newStage =
  Stage'
    { $sel:accessLogSettings:Stage' :: Maybe AccessLogSettings
accessLogSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheClusterEnabled:Stage' :: Maybe Bool
cacheClusterEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheClusterSize:Stage' :: Maybe CacheClusterSize
cacheClusterSize = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheClusterStatus:Stage' :: Maybe CacheClusterStatus
cacheClusterStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:canarySettings:Stage' :: Maybe CanarySettings
canarySettings = forall a. Maybe a
Prelude.Nothing,
      $sel:clientCertificateId:Stage' :: Maybe Text
clientCertificateId = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:Stage' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentId:Stage' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Stage' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:documentationVersion:Stage' :: Maybe Text
documentationVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:Stage' :: Maybe POSIX
lastUpdatedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:methodSettings:Stage' :: Maybe (HashMap Text MethodSetting)
methodSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:stageName:Stage' :: Maybe Text
stageName = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Stage' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:tracingEnabled:Stage' :: Maybe Bool
tracingEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:variables:Stage' :: Maybe (HashMap Text Text)
variables = forall a. Maybe a
Prelude.Nothing,
      $sel:webAclArn:Stage' :: Maybe Text
webAclArn = forall a. Maybe a
Prelude.Nothing
    }

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

-- | Specifies whether a cache cluster is enabled for the stage.
stage_cacheClusterEnabled :: Lens.Lens' Stage (Prelude.Maybe Prelude.Bool)
stage_cacheClusterEnabled :: Lens' Stage (Maybe Bool)
stage_cacheClusterEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Bool
cacheClusterEnabled :: Maybe Bool
$sel:cacheClusterEnabled:Stage' :: Stage -> Maybe Bool
cacheClusterEnabled} -> Maybe Bool
cacheClusterEnabled) (\s :: Stage
s@Stage' {} Maybe Bool
a -> Stage
s {$sel:cacheClusterEnabled:Stage' :: Maybe Bool
cacheClusterEnabled = Maybe Bool
a} :: Stage)

-- | The stage\'s cache capacity in GB. For more information about choosing a
-- cache size, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html Enabling API caching to enhance responsiveness>.
stage_cacheClusterSize :: Lens.Lens' Stage (Prelude.Maybe CacheClusterSize)
stage_cacheClusterSize :: Lens' Stage (Maybe CacheClusterSize)
stage_cacheClusterSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe CacheClusterSize
cacheClusterSize :: Maybe CacheClusterSize
$sel:cacheClusterSize:Stage' :: Stage -> Maybe CacheClusterSize
cacheClusterSize} -> Maybe CacheClusterSize
cacheClusterSize) (\s :: Stage
s@Stage' {} Maybe CacheClusterSize
a -> Stage
s {$sel:cacheClusterSize:Stage' :: Maybe CacheClusterSize
cacheClusterSize = Maybe CacheClusterSize
a} :: Stage)

-- | The status of the cache cluster for the stage, if enabled.
stage_cacheClusterStatus :: Lens.Lens' Stage (Prelude.Maybe CacheClusterStatus)
stage_cacheClusterStatus :: Lens' Stage (Maybe CacheClusterStatus)
stage_cacheClusterStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe CacheClusterStatus
cacheClusterStatus :: Maybe CacheClusterStatus
$sel:cacheClusterStatus:Stage' :: Stage -> Maybe CacheClusterStatus
cacheClusterStatus} -> Maybe CacheClusterStatus
cacheClusterStatus) (\s :: Stage
s@Stage' {} Maybe CacheClusterStatus
a -> Stage
s {$sel:cacheClusterStatus:Stage' :: Maybe CacheClusterStatus
cacheClusterStatus = Maybe CacheClusterStatus
a} :: Stage)

-- | Settings for the canary deployment in this stage.
stage_canarySettings :: Lens.Lens' Stage (Prelude.Maybe CanarySettings)
stage_canarySettings :: Lens' Stage (Maybe CanarySettings)
stage_canarySettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe CanarySettings
canarySettings :: Maybe CanarySettings
$sel:canarySettings:Stage' :: Stage -> Maybe CanarySettings
canarySettings} -> Maybe CanarySettings
canarySettings) (\s :: Stage
s@Stage' {} Maybe CanarySettings
a -> Stage
s {$sel:canarySettings:Stage' :: Maybe CanarySettings
canarySettings = Maybe CanarySettings
a} :: Stage)

-- | The identifier of a client certificate for an API stage.
stage_clientCertificateId :: Lens.Lens' Stage (Prelude.Maybe Prelude.Text)
stage_clientCertificateId :: Lens' Stage (Maybe Text)
stage_clientCertificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Text
clientCertificateId :: Maybe Text
$sel:clientCertificateId:Stage' :: Stage -> Maybe Text
clientCertificateId} -> Maybe Text
clientCertificateId) (\s :: Stage
s@Stage' {} Maybe Text
a -> Stage
s {$sel:clientCertificateId:Stage' :: Maybe Text
clientCertificateId = Maybe Text
a} :: Stage)

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

-- | The identifier of the Deployment that the stage points to.
stage_deploymentId :: Lens.Lens' Stage (Prelude.Maybe Prelude.Text)
stage_deploymentId :: Lens' Stage (Maybe Text)
stage_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:Stage' :: Stage -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: Stage
s@Stage' {} Maybe Text
a -> Stage
s {$sel:deploymentId:Stage' :: Maybe Text
deploymentId = Maybe Text
a} :: Stage)

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

-- | The version of the associated API documentation.
stage_documentationVersion :: Lens.Lens' Stage (Prelude.Maybe Prelude.Text)
stage_documentationVersion :: Lens' Stage (Maybe Text)
stage_documentationVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Text
documentationVersion :: Maybe Text
$sel:documentationVersion:Stage' :: Stage -> Maybe Text
documentationVersion} -> Maybe Text
documentationVersion) (\s :: Stage
s@Stage' {} Maybe Text
a -> Stage
s {$sel:documentationVersion:Stage' :: Maybe Text
documentationVersion = Maybe Text
a} :: Stage)

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

-- | A map that defines the method settings for a Stage resource. Keys
-- (designated as @\/{method_setting_key@ below) are method paths defined
-- as @{resource_path}\/{http_method}@ for an individual method override,
-- or @\/\\*\/\\*@ for overriding all methods in the stage.
stage_methodSettings :: Lens.Lens' Stage (Prelude.Maybe (Prelude.HashMap Prelude.Text MethodSetting))
stage_methodSettings :: Lens' Stage (Maybe (HashMap Text MethodSetting))
stage_methodSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe (HashMap Text MethodSetting)
methodSettings :: Maybe (HashMap Text MethodSetting)
$sel:methodSettings:Stage' :: Stage -> Maybe (HashMap Text MethodSetting)
methodSettings} -> Maybe (HashMap Text MethodSetting)
methodSettings) (\s :: Stage
s@Stage' {} Maybe (HashMap Text MethodSetting)
a -> Stage
s {$sel:methodSettings:Stage' :: Maybe (HashMap Text MethodSetting)
methodSettings = Maybe (HashMap Text MethodSetting)
a} :: Stage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the stage is the first path segment in the Uniform Resource
-- Identifier (URI) of a call to API Gateway. Stage names can only contain
-- alphanumeric characters, hyphens, and underscores. Maximum length is 128
-- characters.
stage_stageName :: Lens.Lens' Stage (Prelude.Maybe Prelude.Text)
stage_stageName :: Lens' Stage (Maybe Text)
stage_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Text
stageName :: Maybe Text
$sel:stageName:Stage' :: Stage -> Maybe Text
stageName} -> Maybe Text
stageName) (\s :: Stage
s@Stage' {} Maybe Text
a -> Stage
s {$sel:stageName:Stage' :: Maybe Text
stageName = Maybe Text
a} :: Stage)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
stage_tags :: Lens.Lens' Stage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
stage_tags :: Lens' Stage (Maybe (HashMap Text Text))
stage_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Stage' :: Stage -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Stage
s@Stage' {} Maybe (HashMap Text Text)
a -> Stage
s {$sel:tags:Stage' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Stage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether active tracing with X-ray is enabled for the Stage.
stage_tracingEnabled :: Lens.Lens' Stage (Prelude.Maybe Prelude.Bool)
stage_tracingEnabled :: Lens' Stage (Maybe Bool)
stage_tracingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Bool
tracingEnabled :: Maybe Bool
$sel:tracingEnabled:Stage' :: Stage -> Maybe Bool
tracingEnabled} -> Maybe Bool
tracingEnabled) (\s :: Stage
s@Stage' {} Maybe Bool
a -> Stage
s {$sel:tracingEnabled:Stage' :: Maybe Bool
tracingEnabled = Maybe Bool
a} :: Stage)

-- | 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-._~:\/?#&=,]+@.
stage_variables :: Lens.Lens' Stage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
stage_variables :: Lens' Stage (Maybe (HashMap Text Text))
stage_variables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe (HashMap Text Text)
variables :: Maybe (HashMap Text Text)
$sel:variables:Stage' :: Stage -> Maybe (HashMap Text Text)
variables} -> Maybe (HashMap Text Text)
variables) (\s :: Stage
s@Stage' {} Maybe (HashMap Text Text)
a -> Stage
s {$sel:variables:Stage' :: Maybe (HashMap Text Text)
variables = Maybe (HashMap Text Text)
a} :: Stage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the WebAcl associated with the Stage.
stage_webAclArn :: Lens.Lens' Stage (Prelude.Maybe Prelude.Text)
stage_webAclArn :: Lens' Stage (Maybe Text)
stage_webAclArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Text
webAclArn :: Maybe Text
$sel:webAclArn:Stage' :: Stage -> Maybe Text
webAclArn} -> Maybe Text
webAclArn) (\s :: Stage
s@Stage' {} Maybe Text
a -> Stage
s {$sel:webAclArn:Stage' :: Maybe Text
webAclArn = Maybe Text
a} :: Stage)

instance Data.FromJSON Stage where
  parseJSON :: Value -> Parser Stage
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Stage"
      ( \Object
x ->
          Maybe AccessLogSettings
-> Maybe Bool
-> Maybe CacheClusterSize
-> Maybe CacheClusterStatus
-> Maybe CanarySettings
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text MethodSetting)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Stage
Stage'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accessLogSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"cacheClusterEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"cacheClusterSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"cacheClusterStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"canarySettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"clientCertificateId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deploymentId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"documentationVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"methodSettings" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"stageName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tracingEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"variables" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"webAclArn")
      )

instance Prelude.Hashable Stage where
  hashWithSalt :: Int -> Stage -> Int
hashWithSalt Int
_salt Stage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text MethodSetting)
Maybe POSIX
Maybe AccessLogSettings
Maybe CacheClusterSize
Maybe CacheClusterStatus
Maybe CanarySettings
webAclArn :: Maybe Text
variables :: Maybe (HashMap Text Text)
tracingEnabled :: Maybe Bool
tags :: Maybe (HashMap Text Text)
stageName :: Maybe Text
methodSettings :: Maybe (HashMap Text MethodSetting)
lastUpdatedDate :: Maybe POSIX
documentationVersion :: Maybe Text
description :: Maybe Text
deploymentId :: Maybe Text
createdDate :: Maybe POSIX
clientCertificateId :: Maybe Text
canarySettings :: Maybe CanarySettings
cacheClusterStatus :: Maybe CacheClusterStatus
cacheClusterSize :: Maybe CacheClusterSize
cacheClusterEnabled :: Maybe Bool
accessLogSettings :: Maybe AccessLogSettings
$sel:webAclArn:Stage' :: Stage -> Maybe Text
$sel:variables:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:tracingEnabled:Stage' :: Stage -> Maybe Bool
$sel:tags:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:stageName:Stage' :: Stage -> Maybe Text
$sel:methodSettings:Stage' :: Stage -> Maybe (HashMap Text MethodSetting)
$sel:lastUpdatedDate:Stage' :: Stage -> Maybe POSIX
$sel:documentationVersion:Stage' :: Stage -> Maybe Text
$sel:description:Stage' :: Stage -> Maybe Text
$sel:deploymentId:Stage' :: Stage -> Maybe Text
$sel:createdDate:Stage' :: Stage -> Maybe POSIX
$sel:clientCertificateId:Stage' :: Stage -> Maybe Text
$sel:canarySettings:Stage' :: Stage -> Maybe CanarySettings
$sel:cacheClusterStatus:Stage' :: Stage -> Maybe CacheClusterStatus
$sel:cacheClusterSize:Stage' :: Stage -> Maybe CacheClusterSize
$sel:cacheClusterEnabled:Stage' :: Stage -> Maybe Bool
$sel:accessLogSettings:Stage' :: Stage -> Maybe AccessLogSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccessLogSettings
accessLogSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
cacheClusterEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CacheClusterSize
cacheClusterSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CacheClusterStatus
cacheClusterStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CanarySettings
canarySettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientCertificateId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deploymentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentationVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text MethodSetting)
methodSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stageName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
tracingEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
variables
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
webAclArn

instance Prelude.NFData Stage where
  rnf :: Stage -> ()
rnf Stage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text MethodSetting)
Maybe POSIX
Maybe AccessLogSettings
Maybe CacheClusterSize
Maybe CacheClusterStatus
Maybe CanarySettings
webAclArn :: Maybe Text
variables :: Maybe (HashMap Text Text)
tracingEnabled :: Maybe Bool
tags :: Maybe (HashMap Text Text)
stageName :: Maybe Text
methodSettings :: Maybe (HashMap Text MethodSetting)
lastUpdatedDate :: Maybe POSIX
documentationVersion :: Maybe Text
description :: Maybe Text
deploymentId :: Maybe Text
createdDate :: Maybe POSIX
clientCertificateId :: Maybe Text
canarySettings :: Maybe CanarySettings
cacheClusterStatus :: Maybe CacheClusterStatus
cacheClusterSize :: Maybe CacheClusterSize
cacheClusterEnabled :: Maybe Bool
accessLogSettings :: Maybe AccessLogSettings
$sel:webAclArn:Stage' :: Stage -> Maybe Text
$sel:variables:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:tracingEnabled:Stage' :: Stage -> Maybe Bool
$sel:tags:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:stageName:Stage' :: Stage -> Maybe Text
$sel:methodSettings:Stage' :: Stage -> Maybe (HashMap Text MethodSetting)
$sel:lastUpdatedDate:Stage' :: Stage -> Maybe POSIX
$sel:documentationVersion:Stage' :: Stage -> Maybe Text
$sel:description:Stage' :: Stage -> Maybe Text
$sel:deploymentId:Stage' :: Stage -> Maybe Text
$sel:createdDate:Stage' :: Stage -> Maybe POSIX
$sel:clientCertificateId:Stage' :: Stage -> Maybe Text
$sel:canarySettings:Stage' :: Stage -> Maybe CanarySettings
$sel:cacheClusterStatus:Stage' :: Stage -> Maybe CacheClusterStatus
$sel:cacheClusterSize:Stage' :: Stage -> Maybe CacheClusterSize
$sel:cacheClusterEnabled:Stage' :: Stage -> Maybe Bool
$sel:accessLogSettings:Stage' :: Stage -> Maybe AccessLogSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AccessLogSettings
accessLogSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
cacheClusterEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheClusterSize
cacheClusterSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheClusterStatus
cacheClusterStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CanarySettings
canarySettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientCertificateId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentationVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text MethodSetting)
methodSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stageName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
tracingEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
variables
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
webAclArn