{-# 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.Api
-- 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.Api where

import Amazonka.ApiGatewayV2.Types.Cors
import Amazonka.ApiGatewayV2.Types.ProtocolType
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.
--
-- /See:/ 'newApi' smart constructor.
data Api = Api'
  { -- | The URI of the API, of the form
    -- {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically
    -- appended to this URI to form a complete path to a deployed API stage.
    Api -> Maybe Text
apiEndpoint :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether an API is managed by API Gateway. You can\'t update or
    -- delete a managed API by using API Gateway. A managed API can be deleted
    -- only through the tooling or service that created it.
    Api -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | The API ID.
    Api -> Maybe Text
apiId :: Prelude.Maybe Prelude.Text,
    -- | An API key selection expression. Supported only for WebSocket APIs. See
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions API Key Selection Expressions>.
    Api -> Maybe Text
apiKeySelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A CORS configuration. Supported only for HTTP APIs.
    Api -> Maybe Cors
corsConfiguration :: Prelude.Maybe Cors,
    -- | The timestamp when the API was created.
    Api -> Maybe ISO8601
createdDate :: Prelude.Maybe Data.ISO8601,
    -- | The description of the API.
    Api -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether clients can invoke your API by using the default
    -- execute-api endpoint. By default, clients can invoke your API with the
    -- default https:\/\/{api_id}.execute-api.{region}.amazonaws.com endpoint.
    -- To require that clients use a custom domain name to invoke your API,
    -- disable the default endpoint.
    Api -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | Avoid validating models when creating a deployment. Supported only for
    -- WebSocket APIs.
    Api -> Maybe Bool
disableSchemaValidation :: Prelude.Maybe Prelude.Bool,
    -- | The validation information during API import. This may include
    -- particular properties of your OpenAPI definition which are ignored
    -- during import. Supported only for HTTP APIs.
    Api -> Maybe [Text]
importInfo :: Prelude.Maybe [Prelude.Text],
    -- | A collection of tags associated with the API.
    Api -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A version identifier for the API.
    Api -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The warning messages reported when failonwarnings is turned on during
    -- API import.
    Api -> Maybe [Text]
warnings :: Prelude.Maybe [Prelude.Text],
    -- | The route selection expression for the API. For HTTP APIs, the
    -- routeSelectionExpression must be ${request.method} ${request.path}. If
    -- not provided, this will be the default for HTTP APIs. This property is
    -- required for WebSocket APIs.
    Api -> Text
routeSelectionExpression :: Prelude.Text,
    -- | The name of the API.
    Api -> Text
name :: Prelude.Text,
    -- | The API protocol.
    Api -> ProtocolType
protocolType :: ProtocolType
  }
  deriving (Api -> Api -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Api -> Api -> Bool
$c/= :: Api -> Api -> Bool
== :: Api -> Api -> Bool
$c== :: Api -> Api -> Bool
Prelude.Eq, ReadPrec [Api]
ReadPrec Api
Int -> ReadS Api
ReadS [Api]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Api]
$creadListPrec :: ReadPrec [Api]
readPrec :: ReadPrec Api
$creadPrec :: ReadPrec Api
readList :: ReadS [Api]
$creadList :: ReadS [Api]
readsPrec :: Int -> ReadS Api
$creadsPrec :: Int -> ReadS Api
Prelude.Read, Int -> Api -> ShowS
[Api] -> ShowS
Api -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Api] -> ShowS
$cshowList :: [Api] -> ShowS
show :: Api -> String
$cshow :: Api -> String
showsPrec :: Int -> Api -> ShowS
$cshowsPrec :: Int -> Api -> ShowS
Prelude.Show, forall x. Rep Api x -> Api
forall x. Api -> Rep Api x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Api x -> Api
$cfrom :: forall x. Api -> Rep Api x
Prelude.Generic)

-- |
-- Create a value of 'Api' 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:
--
-- 'apiEndpoint', 'api_apiEndpoint' - The URI of the API, of the form
-- {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically
-- appended to this URI to form a complete path to a deployed API stage.
--
-- 'apiGatewayManaged', 'api_apiGatewayManaged' - Specifies whether an API is managed by API Gateway. You can\'t update or
-- delete a managed API by using API Gateway. A managed API can be deleted
-- only through the tooling or service that created it.
--
-- 'apiId', 'api_apiId' - The API ID.
--
-- 'apiKeySelectionExpression', 'api_apiKeySelectionExpression' - An API key selection expression. Supported only for WebSocket APIs. See
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions API Key Selection Expressions>.
--
-- 'corsConfiguration', 'api_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'createdDate', 'api_createdDate' - The timestamp when the API was created.
--
-- 'description', 'api_description' - The description of the API.
--
-- 'disableExecuteApiEndpoint', 'api_disableExecuteApiEndpoint' - Specifies whether clients can invoke your API by using the default
-- execute-api endpoint. By default, clients can invoke your API with the
-- default https:\/\/{api_id}.execute-api.{region}.amazonaws.com endpoint.
-- To require that clients use a custom domain name to invoke your API,
-- disable the default endpoint.
--
-- 'disableSchemaValidation', 'api_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'importInfo', 'api_importInfo' - The validation information during API import. This may include
-- particular properties of your OpenAPI definition which are ignored
-- during import. Supported only for HTTP APIs.
--
-- 'tags', 'api_tags' - A collection of tags associated with the API.
--
-- 'version', 'api_version' - A version identifier for the API.
--
-- 'warnings', 'api_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'routeSelectionExpression', 'api_routeSelectionExpression' - The route selection expression for the API. For HTTP APIs, the
-- routeSelectionExpression must be ${request.method} ${request.path}. If
-- not provided, this will be the default for HTTP APIs. This property is
-- required for WebSocket APIs.
--
-- 'name', 'api_name' - The name of the API.
--
-- 'protocolType', 'api_protocolType' - The API protocol.
newApi ::
  -- | 'routeSelectionExpression'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'protocolType'
  ProtocolType ->
  Api
newApi :: Text -> Text -> ProtocolType -> Api
newApi
  Text
pRouteSelectionExpression_
  Text
pName_
  ProtocolType
pProtocolType_ =
    Api'
      { $sel:apiEndpoint:Api' :: Maybe Text
apiEndpoint = forall a. Maybe a
Prelude.Nothing,
        $sel:apiGatewayManaged:Api' :: Maybe Bool
apiGatewayManaged = forall a. Maybe a
Prelude.Nothing,
        $sel:apiId:Api' :: Maybe Text
apiId = forall a. Maybe a
Prelude.Nothing,
        $sel:apiKeySelectionExpression:Api' :: Maybe Text
apiKeySelectionExpression = forall a. Maybe a
Prelude.Nothing,
        $sel:corsConfiguration:Api' :: Maybe Cors
corsConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:createdDate:Api' :: Maybe ISO8601
createdDate = forall a. Maybe a
Prelude.Nothing,
        $sel:description:Api' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:disableExecuteApiEndpoint:Api' :: Maybe Bool
disableExecuteApiEndpoint = forall a. Maybe a
Prelude.Nothing,
        $sel:disableSchemaValidation:Api' :: Maybe Bool
disableSchemaValidation = forall a. Maybe a
Prelude.Nothing,
        $sel:importInfo:Api' :: Maybe [Text]
importInfo = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:Api' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:version:Api' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:warnings:Api' :: Maybe [Text]
warnings = forall a. Maybe a
Prelude.Nothing,
        $sel:routeSelectionExpression:Api' :: Text
routeSelectionExpression =
          Text
pRouteSelectionExpression_,
        $sel:name:Api' :: Text
name = Text
pName_,
        $sel:protocolType:Api' :: ProtocolType
protocolType = ProtocolType
pProtocolType_
      }

-- | The URI of the API, of the form
-- {api-id}.execute-api.{region}.amazonaws.com. The stage name is typically
-- appended to this URI to form a complete path to a deployed API stage.
api_apiEndpoint :: Lens.Lens' Api (Prelude.Maybe Prelude.Text)
api_apiEndpoint :: Lens' Api (Maybe Text)
api_apiEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Text
apiEndpoint :: Maybe Text
$sel:apiEndpoint:Api' :: Api -> Maybe Text
apiEndpoint} -> Maybe Text
apiEndpoint) (\s :: Api
s@Api' {} Maybe Text
a -> Api
s {$sel:apiEndpoint:Api' :: Maybe Text
apiEndpoint = Maybe Text
a} :: Api)

-- | Specifies whether an API is managed by API Gateway. You can\'t update or
-- delete a managed API by using API Gateway. A managed API can be deleted
-- only through the tooling or service that created it.
api_apiGatewayManaged :: Lens.Lens' Api (Prelude.Maybe Prelude.Bool)
api_apiGatewayManaged :: Lens' Api (Maybe Bool)
api_apiGatewayManaged = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Bool
apiGatewayManaged :: Maybe Bool
$sel:apiGatewayManaged:Api' :: Api -> Maybe Bool
apiGatewayManaged} -> Maybe Bool
apiGatewayManaged) (\s :: Api
s@Api' {} Maybe Bool
a -> Api
s {$sel:apiGatewayManaged:Api' :: Maybe Bool
apiGatewayManaged = Maybe Bool
a} :: Api)

-- | The API ID.
api_apiId :: Lens.Lens' Api (Prelude.Maybe Prelude.Text)
api_apiId :: Lens' Api (Maybe Text)
api_apiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Text
apiId :: Maybe Text
$sel:apiId:Api' :: Api -> Maybe Text
apiId} -> Maybe Text
apiId) (\s :: Api
s@Api' {} Maybe Text
a -> Api
s {$sel:apiId:Api' :: Maybe Text
apiId = Maybe Text
a} :: Api)

-- | An API key selection expression. Supported only for WebSocket APIs. See
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions API Key Selection Expressions>.
api_apiKeySelectionExpression :: Lens.Lens' Api (Prelude.Maybe Prelude.Text)
api_apiKeySelectionExpression :: Lens' Api (Maybe Text)
api_apiKeySelectionExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Text
apiKeySelectionExpression :: Maybe Text
$sel:apiKeySelectionExpression:Api' :: Api -> Maybe Text
apiKeySelectionExpression} -> Maybe Text
apiKeySelectionExpression) (\s :: Api
s@Api' {} Maybe Text
a -> Api
s {$sel:apiKeySelectionExpression:Api' :: Maybe Text
apiKeySelectionExpression = Maybe Text
a} :: Api)

-- | A CORS configuration. Supported only for HTTP APIs.
api_corsConfiguration :: Lens.Lens' Api (Prelude.Maybe Cors)
api_corsConfiguration :: Lens' Api (Maybe Cors)
api_corsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Cors
corsConfiguration :: Maybe Cors
$sel:corsConfiguration:Api' :: Api -> Maybe Cors
corsConfiguration} -> Maybe Cors
corsConfiguration) (\s :: Api
s@Api' {} Maybe Cors
a -> Api
s {$sel:corsConfiguration:Api' :: Maybe Cors
corsConfiguration = Maybe Cors
a} :: Api)

-- | The timestamp when the API was created.
api_createdDate :: Lens.Lens' Api (Prelude.Maybe Prelude.UTCTime)
api_createdDate :: Lens' Api (Maybe UTCTime)
api_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe ISO8601
createdDate :: Maybe ISO8601
$sel:createdDate:Api' :: Api -> Maybe ISO8601
createdDate} -> Maybe ISO8601
createdDate) (\s :: Api
s@Api' {} Maybe ISO8601
a -> Api
s {$sel:createdDate:Api' :: Maybe ISO8601
createdDate = Maybe ISO8601
a} :: Api) 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 description of the API.
api_description :: Lens.Lens' Api (Prelude.Maybe Prelude.Text)
api_description :: Lens' Api (Maybe Text)
api_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Text
description :: Maybe Text
$sel:description:Api' :: Api -> Maybe Text
description} -> Maybe Text
description) (\s :: Api
s@Api' {} Maybe Text
a -> Api
s {$sel:description:Api' :: Maybe Text
description = Maybe Text
a} :: Api)

-- | Specifies whether clients can invoke your API by using the default
-- execute-api endpoint. By default, clients can invoke your API with the
-- default https:\/\/{api_id}.execute-api.{region}.amazonaws.com endpoint.
-- To require that clients use a custom domain name to invoke your API,
-- disable the default endpoint.
api_disableExecuteApiEndpoint :: Lens.Lens' Api (Prelude.Maybe Prelude.Bool)
api_disableExecuteApiEndpoint :: Lens' Api (Maybe Bool)
api_disableExecuteApiEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Bool
disableExecuteApiEndpoint :: Maybe Bool
$sel:disableExecuteApiEndpoint:Api' :: Api -> Maybe Bool
disableExecuteApiEndpoint} -> Maybe Bool
disableExecuteApiEndpoint) (\s :: Api
s@Api' {} Maybe Bool
a -> Api
s {$sel:disableExecuteApiEndpoint:Api' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
a} :: Api)

-- | Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
api_disableSchemaValidation :: Lens.Lens' Api (Prelude.Maybe Prelude.Bool)
api_disableSchemaValidation :: Lens' Api (Maybe Bool)
api_disableSchemaValidation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Bool
disableSchemaValidation :: Maybe Bool
$sel:disableSchemaValidation:Api' :: Api -> Maybe Bool
disableSchemaValidation} -> Maybe Bool
disableSchemaValidation) (\s :: Api
s@Api' {} Maybe Bool
a -> Api
s {$sel:disableSchemaValidation:Api' :: Maybe Bool
disableSchemaValidation = Maybe Bool
a} :: Api)

-- | The validation information during API import. This may include
-- particular properties of your OpenAPI definition which are ignored
-- during import. Supported only for HTTP APIs.
api_importInfo :: Lens.Lens' Api (Prelude.Maybe [Prelude.Text])
api_importInfo :: Lens' Api (Maybe [Text])
api_importInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe [Text]
importInfo :: Maybe [Text]
$sel:importInfo:Api' :: Api -> Maybe [Text]
importInfo} -> Maybe [Text]
importInfo) (\s :: Api
s@Api' {} Maybe [Text]
a -> Api
s {$sel:importInfo:Api' :: Maybe [Text]
importInfo = Maybe [Text]
a} :: Api) 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 collection of tags associated with the API.
api_tags :: Lens.Lens' Api (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
api_tags :: Lens' Api (Maybe (HashMap Text Text))
api_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Api' :: Api -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Api
s@Api' {} Maybe (HashMap Text Text)
a -> Api
s {$sel:tags:Api' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Api) 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 version identifier for the API.
api_version :: Lens.Lens' Api (Prelude.Maybe Prelude.Text)
api_version :: Lens' Api (Maybe Text)
api_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe Text
version :: Maybe Text
$sel:version:Api' :: Api -> Maybe Text
version} -> Maybe Text
version) (\s :: Api
s@Api' {} Maybe Text
a -> Api
s {$sel:version:Api' :: Maybe Text
version = Maybe Text
a} :: Api)

-- | The warning messages reported when failonwarnings is turned on during
-- API import.
api_warnings :: Lens.Lens' Api (Prelude.Maybe [Prelude.Text])
api_warnings :: Lens' Api (Maybe [Text])
api_warnings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:Api' :: Api -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: Api
s@Api' {} Maybe [Text]
a -> Api
s {$sel:warnings:Api' :: Maybe [Text]
warnings = Maybe [Text]
a} :: Api) 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 route selection expression for the API. For HTTP APIs, the
-- routeSelectionExpression must be ${request.method} ${request.path}. If
-- not provided, this will be the default for HTTP APIs. This property is
-- required for WebSocket APIs.
api_routeSelectionExpression :: Lens.Lens' Api Prelude.Text
api_routeSelectionExpression :: Lens' Api Text
api_routeSelectionExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Text
routeSelectionExpression :: Text
$sel:routeSelectionExpression:Api' :: Api -> Text
routeSelectionExpression} -> Text
routeSelectionExpression) (\s :: Api
s@Api' {} Text
a -> Api
s {$sel:routeSelectionExpression:Api' :: Text
routeSelectionExpression = Text
a} :: Api)

-- | The name of the API.
api_name :: Lens.Lens' Api Prelude.Text
api_name :: Lens' Api Text
api_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {Text
name :: Text
$sel:name:Api' :: Api -> Text
name} -> Text
name) (\s :: Api
s@Api' {} Text
a -> Api
s {$sel:name:Api' :: Text
name = Text
a} :: Api)

-- | The API protocol.
api_protocolType :: Lens.Lens' Api ProtocolType
api_protocolType :: Lens' Api ProtocolType
api_protocolType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Api' {ProtocolType
protocolType :: ProtocolType
$sel:protocolType:Api' :: Api -> ProtocolType
protocolType} -> ProtocolType
protocolType) (\s :: Api
s@Api' {} ProtocolType
a -> Api
s {$sel:protocolType:Api' :: ProtocolType
protocolType = ProtocolType
a} :: Api)

instance Data.FromJSON Api where
  parseJSON :: Value -> Parser Api
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Api"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Cors
-> Maybe ISO8601
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe [Text]
-> Text
-> Text
-> ProtocolType
-> Api
Api'
            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
"apiEndpoint")
            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
"apiId")
            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
"apiKeySelectionExpression")
            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
"corsConfiguration")
            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
"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
"disableExecuteApiEndpoint")
            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
"disableSchemaValidation")
            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
"importInfo" 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 (Maybe a)
Data..:? Key
"version")
            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
"warnings" 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
"routeSelectionExpression")
            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
"name")
            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
"protocolType")
      )

instance Prelude.Hashable Api where
  hashWithSalt :: Int -> Api -> Int
hashWithSalt Int
_salt Api' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe Cors
Text
ProtocolType
protocolType :: ProtocolType
name :: Text
routeSelectionExpression :: Text
warnings :: Maybe [Text]
version :: Maybe Text
tags :: Maybe (HashMap Text Text)
importInfo :: Maybe [Text]
disableSchemaValidation :: Maybe Bool
disableExecuteApiEndpoint :: Maybe Bool
description :: Maybe Text
createdDate :: Maybe ISO8601
corsConfiguration :: Maybe Cors
apiKeySelectionExpression :: Maybe Text
apiId :: Maybe Text
apiGatewayManaged :: Maybe Bool
apiEndpoint :: Maybe Text
$sel:protocolType:Api' :: Api -> ProtocolType
$sel:name:Api' :: Api -> Text
$sel:routeSelectionExpression:Api' :: Api -> Text
$sel:warnings:Api' :: Api -> Maybe [Text]
$sel:version:Api' :: Api -> Maybe Text
$sel:tags:Api' :: Api -> Maybe (HashMap Text Text)
$sel:importInfo:Api' :: Api -> Maybe [Text]
$sel:disableSchemaValidation:Api' :: Api -> Maybe Bool
$sel:disableExecuteApiEndpoint:Api' :: Api -> Maybe Bool
$sel:description:Api' :: Api -> Maybe Text
$sel:createdDate:Api' :: Api -> Maybe ISO8601
$sel:corsConfiguration:Api' :: Api -> Maybe Cors
$sel:apiKeySelectionExpression:Api' :: Api -> Maybe Text
$sel:apiId:Api' :: Api -> Maybe Text
$sel:apiGatewayManaged:Api' :: Api -> Maybe Bool
$sel:apiEndpoint:Api' :: Api -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
apiGatewayManaged
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiKeySelectionExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Cors
corsConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableExecuteApiEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableSchemaValidation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
importInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
warnings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
routeSelectionExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProtocolType
protocolType

instance Prelude.NFData Api where
  rnf :: Api -> ()
rnf Api' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe Cors
Text
ProtocolType
protocolType :: ProtocolType
name :: Text
routeSelectionExpression :: Text
warnings :: Maybe [Text]
version :: Maybe Text
tags :: Maybe (HashMap Text Text)
importInfo :: Maybe [Text]
disableSchemaValidation :: Maybe Bool
disableExecuteApiEndpoint :: Maybe Bool
description :: Maybe Text
createdDate :: Maybe ISO8601
corsConfiguration :: Maybe Cors
apiKeySelectionExpression :: Maybe Text
apiId :: Maybe Text
apiGatewayManaged :: Maybe Bool
apiEndpoint :: Maybe Text
$sel:protocolType:Api' :: Api -> ProtocolType
$sel:name:Api' :: Api -> Text
$sel:routeSelectionExpression:Api' :: Api -> Text
$sel:warnings:Api' :: Api -> Maybe [Text]
$sel:version:Api' :: Api -> Maybe Text
$sel:tags:Api' :: Api -> Maybe (HashMap Text Text)
$sel:importInfo:Api' :: Api -> Maybe [Text]
$sel:disableSchemaValidation:Api' :: Api -> Maybe Bool
$sel:disableExecuteApiEndpoint:Api' :: Api -> Maybe Bool
$sel:description:Api' :: Api -> Maybe Text
$sel:createdDate:Api' :: Api -> Maybe ISO8601
$sel:corsConfiguration:Api' :: Api -> Maybe Cors
$sel:apiKeySelectionExpression:Api' :: Api -> Maybe Text
$sel:apiId:Api' :: Api -> Maybe Text
$sel:apiGatewayManaged:Api' :: Api -> Maybe Bool
$sel:apiEndpoint:Api' :: Api -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiEndpoint
      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 Text
apiId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiKeySelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Cors
corsConfiguration
      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 Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableExecuteApiEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableSchemaValidation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
importInfo
      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 Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
warnings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
routeSelectionExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProtocolType
protocolType