{-# 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.ApiGatewayV2.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.ApiGatewayV2.Types.Stage where

import Amazonka.ApiGatewayV2.Types.AccessLogSettings
import Amazonka.ApiGatewayV2.Types.RouteSettings
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 an API stage.
--
-- /See:/ 'newStage' smart constructor.
data Stage = Stage'
  { -- | Settings for logging access in this stage.
    Stage -> Maybe AccessLogSettings
accessLogSettings :: Prelude.Maybe AccessLogSettings,
    -- | 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.
    Stage -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether updates to an API automatically trigger a new
    -- deployment. The default value is false.
    Stage -> Maybe Bool
autoDeploy :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of a client certificate for a Stage. Supported only for
    -- WebSocket APIs.
    Stage -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the stage was created.
    Stage -> Maybe ISO8601
createdDate :: Prelude.Maybe Data.ISO8601,
    -- | Default route settings for the stage.
    Stage -> Maybe RouteSettings
defaultRouteSettings :: Prelude.Maybe RouteSettings,
    -- | The identifier of the Deployment that the Stage is associated with.
    -- Can\'t be updated if autoDeploy is enabled.
    Stage -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The description of the stage.
    Stage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Describes the status of the last deployment of a stage. Supported only
    -- for stages with autoDeploy enabled.
    Stage -> Maybe Text
lastDeploymentStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the stage was last updated.
    Stage -> Maybe ISO8601
lastUpdatedDate :: Prelude.Maybe Data.ISO8601,
    -- | Route settings for the stage, by routeKey.
    Stage -> Maybe (HashMap Text RouteSettings)
routeSettings :: Prelude.Maybe (Prelude.HashMap Prelude.Text RouteSettings),
    -- | 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)
stageVariables :: Prelude.Maybe (Prelude.HashMap Prelude.Text 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),
    -- | The name of the stage.
    Stage -> Text
stageName :: 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.
--
-- 'apiGatewayManaged', 'stage_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.
--
-- 'autoDeploy', 'stage_autoDeploy' - Specifies whether updates to an API automatically trigger a new
-- deployment. The default value is false.
--
-- 'clientCertificateId', 'stage_clientCertificateId' - The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
--
-- 'createdDate', 'stage_createdDate' - The timestamp when the stage was created.
--
-- 'defaultRouteSettings', 'stage_defaultRouteSettings' - Default route settings for the stage.
--
-- 'deploymentId', 'stage_deploymentId' - The identifier of the Deployment that the Stage is associated with.
-- Can\'t be updated if autoDeploy is enabled.
--
-- 'description', 'stage_description' - The description of the stage.
--
-- 'lastDeploymentStatusMessage', 'stage_lastDeploymentStatusMessage' - Describes the status of the last deployment of a stage. Supported only
-- for stages with autoDeploy enabled.
--
-- 'lastUpdatedDate', 'stage_lastUpdatedDate' - The timestamp when the stage was last updated.
--
-- 'routeSettings', 'stage_routeSettings' - Route settings for the stage, by routeKey.
--
-- 'stageVariables', 'stage_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-._~:\/?#&=,]+.
--
-- 'tags', 'stage_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'stageName', 'stage_stageName' - The name of the stage.
newStage ::
  -- | 'stageName'
  Prelude.Text ->
  Stage
newStage :: Text -> Stage
newStage Text
pStageName_ =
  Stage'
    { $sel:accessLogSettings:Stage' :: Maybe AccessLogSettings
accessLogSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:Stage' :: Maybe Bool
apiGatewayManaged = forall a. Maybe a
Prelude.Nothing,
      $sel:autoDeploy:Stage' :: Maybe Bool
autoDeploy = forall a. Maybe a
Prelude.Nothing,
      $sel:clientCertificateId:Stage' :: Maybe Text
clientCertificateId = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:Stage' :: Maybe ISO8601
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultRouteSettings:Stage' :: Maybe RouteSettings
defaultRouteSettings = 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:lastDeploymentStatusMessage:Stage' :: Maybe Text
lastDeploymentStatusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:Stage' :: Maybe ISO8601
lastUpdatedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:routeSettings:Stage' :: Maybe (HashMap Text RouteSettings)
routeSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:stageVariables:Stage' :: Maybe (HashMap Text Text)
stageVariables = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Stage' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:stageName:Stage' :: Text
stageName = Text
pStageName_
    }

-- | 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 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.
stage_apiGatewayManaged :: Lens.Lens' Stage (Prelude.Maybe Prelude.Bool)
stage_apiGatewayManaged :: Lens' Stage (Maybe Bool)
stage_apiGatewayManaged = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:apiGatewayManaged:Stage' :: Stage -> Maybe Bool
apiGatewayManaged} -> Maybe Bool
apiGatewayManaged) (\s :: Stage
s@Stage' {} Maybe Bool
a -> Stage
s {$sel:apiGatewayManaged:Stage' :: Maybe Bool
apiGatewayManaged = Maybe Bool
a} :: Stage)

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

-- | The identifier of a client certificate for a Stage. Supported only for
-- WebSocket APIs.
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 ISO8601
createdDate :: Maybe ISO8601
$sel:createdDate:Stage' :: Stage -> Maybe ISO8601
createdDate} -> Maybe ISO8601
createdDate) (\s :: Stage
s@Stage' {} Maybe ISO8601
a -> Stage
s {$sel:createdDate:Stage' :: Maybe ISO8601
createdDate = Maybe ISO8601
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

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

-- | The identifier of the Deployment that the Stage is associated with.
-- Can\'t be updated if autoDeploy is enabled.
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 description of the stage.
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)

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

-- | The timestamp when the stage was 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 ISO8601
lastUpdatedDate :: Maybe ISO8601
$sel:lastUpdatedDate:Stage' :: Stage -> Maybe ISO8601
lastUpdatedDate} -> Maybe ISO8601
lastUpdatedDate) (\s :: Stage
s@Stage' {} Maybe ISO8601
a -> Stage
s {$sel:lastUpdatedDate:Stage' :: Maybe ISO8601
lastUpdatedDate = Maybe ISO8601
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

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

-- | 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_stageVariables :: Lens.Lens' Stage (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
stage_stageVariables :: Lens' Stage (Maybe (HashMap Text Text))
stage_stageVariables = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
$sel:stageVariables:Stage' :: Stage -> Maybe (HashMap Text Text)
stageVariables} -> Maybe (HashMap Text Text)
stageVariables) (\s :: Stage
s@Stage' {} Maybe (HashMap Text Text)
a -> Stage
s {$sel:stageVariables:Stage' :: Maybe (HashMap Text Text)
stageVariables = 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 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

-- | The name of the stage.
stage_stageName :: Lens.Lens' Stage Prelude.Text
stage_stageName :: Lens' Stage Text
stage_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stage' {Text
stageName :: Text
$sel:stageName:Stage' :: Stage -> Text
stageName} -> Text
stageName) (\s :: Stage
s@Stage' {} Text
a -> Stage
s {$sel:stageName:Stage' :: Text
stageName = 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 Bool
-> Maybe Text
-> Maybe ISO8601
-> Maybe RouteSettings
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe (HashMap Text RouteSettings)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> 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
"apiGatewayManaged")
            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
"autoDeploy")
            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
"defaultRouteSettings")
            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
"lastDeploymentStatusMessage")
            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
"routeSettings" 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
"stageVariables" 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
"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 a
Data..: Key
"stageName")
      )

instance Prelude.Hashable Stage where
  hashWithSalt :: Int -> Stage -> Int
hashWithSalt Int
_salt Stage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text RouteSettings)
Maybe ISO8601
Maybe AccessLogSettings
Maybe RouteSettings
Text
stageName :: Text
tags :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
routeSettings :: Maybe (HashMap Text RouteSettings)
lastUpdatedDate :: Maybe ISO8601
lastDeploymentStatusMessage :: Maybe Text
description :: Maybe Text
deploymentId :: Maybe Text
defaultRouteSettings :: Maybe RouteSettings
createdDate :: Maybe ISO8601
clientCertificateId :: Maybe Text
autoDeploy :: Maybe Bool
apiGatewayManaged :: Maybe Bool
accessLogSettings :: Maybe AccessLogSettings
$sel:stageName:Stage' :: Stage -> Text
$sel:tags:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:stageVariables:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:routeSettings:Stage' :: Stage -> Maybe (HashMap Text RouteSettings)
$sel:lastUpdatedDate:Stage' :: Stage -> Maybe ISO8601
$sel:lastDeploymentStatusMessage:Stage' :: Stage -> Maybe Text
$sel:description:Stage' :: Stage -> Maybe Text
$sel:deploymentId:Stage' :: Stage -> Maybe Text
$sel:defaultRouteSettings:Stage' :: Stage -> Maybe RouteSettings
$sel:createdDate:Stage' :: Stage -> Maybe ISO8601
$sel:clientCertificateId:Stage' :: Stage -> Maybe Text
$sel:autoDeploy:Stage' :: Stage -> Maybe Bool
$sel:apiGatewayManaged: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
apiGatewayManaged
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoDeploy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientCertificateId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RouteSettings
defaultRouteSettings
      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
lastDeploymentStatusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastUpdatedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text RouteSettings)
routeSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
stageVariables
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName

instance Prelude.NFData Stage where
  rnf :: Stage -> ()
rnf Stage' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text RouteSettings)
Maybe ISO8601
Maybe AccessLogSettings
Maybe RouteSettings
Text
stageName :: Text
tags :: Maybe (HashMap Text Text)
stageVariables :: Maybe (HashMap Text Text)
routeSettings :: Maybe (HashMap Text RouteSettings)
lastUpdatedDate :: Maybe ISO8601
lastDeploymentStatusMessage :: Maybe Text
description :: Maybe Text
deploymentId :: Maybe Text
defaultRouteSettings :: Maybe RouteSettings
createdDate :: Maybe ISO8601
clientCertificateId :: Maybe Text
autoDeploy :: Maybe Bool
apiGatewayManaged :: Maybe Bool
accessLogSettings :: Maybe AccessLogSettings
$sel:stageName:Stage' :: Stage -> Text
$sel:tags:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:stageVariables:Stage' :: Stage -> Maybe (HashMap Text Text)
$sel:routeSettings:Stage' :: Stage -> Maybe (HashMap Text RouteSettings)
$sel:lastUpdatedDate:Stage' :: Stage -> Maybe ISO8601
$sel:lastDeploymentStatusMessage:Stage' :: Stage -> Maybe Text
$sel:description:Stage' :: Stage -> Maybe Text
$sel:deploymentId:Stage' :: Stage -> Maybe Text
$sel:defaultRouteSettings:Stage' :: Stage -> Maybe RouteSettings
$sel:createdDate:Stage' :: Stage -> Maybe ISO8601
$sel:clientCertificateId:Stage' :: Stage -> Maybe Text
$sel:autoDeploy:Stage' :: Stage -> Maybe Bool
$sel:apiGatewayManaged: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
apiGatewayManaged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoDeploy
      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 ISO8601
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteSettings
defaultRouteSettings
      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
lastDeploymentStatusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastUpdatedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text RouteSettings)
routeSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
stageVariables
      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 Text
stageName