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

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

-- |
-- Module      : Amazonka.ApiGatewayV2.CreateApi
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Api resource.
module Amazonka.ApiGatewayV2.CreateApi
  ( -- * Creating a Request
    CreateApi (..),
    newCreateApi,

    -- * Request Lenses
    createApi_credentialsArn,
    createApi_disableExecuteApiEndpoint,
    createApi_version,
    createApi_apiKeySelectionExpression,
    createApi_corsConfiguration,
    createApi_routeSelectionExpression,
    createApi_disableSchemaValidation,
    createApi_description,
    createApi_routeKey,
    createApi_tags,
    createApi_target,
    createApi_protocolType,
    createApi_name,

    -- * Destructuring the Response
    CreateApiResponse (..),
    newCreateApiResponse,

    -- * Response Lenses
    createApiResponse_apiId,
    createApiResponse_disableExecuteApiEndpoint,
    createApiResponse_apiEndpoint,
    createApiResponse_warnings,
    createApiResponse_createdDate,
    createApiResponse_name,
    createApiResponse_version,
    createApiResponse_apiGatewayManaged,
    createApiResponse_apiKeySelectionExpression,
    createApiResponse_corsConfiguration,
    createApiResponse_routeSelectionExpression,
    createApiResponse_importInfo,
    createApiResponse_disableSchemaValidation,
    createApiResponse_description,
    createApiResponse_protocolType,
    createApiResponse_tags,
    createApiResponse_httpStatus,
  )
where

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

-- | Creates a new Api resource to represent an API.
--
-- /See:/ 'newCreateApi' smart constructor.
data CreateApi = CreateApi'
  { -- | This property is part of quick create. It specifies the credentials
    -- required for the integration, if any. For a Lambda integration, three
    -- options are available. To specify an IAM Role for API Gateway to assume,
    -- use the role\'s Amazon Resource Name (ARN). To require that the
    -- caller\'s identity be passed through from the request, specify
    -- arn:aws:iam::*:user\/*. To use resource-based permissions on supported
    -- AWS services, specify null. Currently, this property is not used for
    -- HTTP integrations. Supported only for HTTP APIs.
    CreateApi -> Maybe Text
credentialsArn :: 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.
    CreateApi -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | A version identifier for the API.
    CreateApi -> Maybe Text
version :: 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>.
    CreateApi -> Maybe Text
apiKeySelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A CORS configuration. Supported only for HTTP APIs. See
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html Configuring CORS>
    -- for more information.
    CreateApi -> Maybe Cors
corsConfiguration :: Prelude.Maybe Cors,
    -- | 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.
    CreateApi -> Maybe Text
routeSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | Avoid validating models when creating a deployment. Supported only for
    -- WebSocket APIs.
    CreateApi -> Maybe Bool
disableSchemaValidation :: Prelude.Maybe Prelude.Bool,
    -- | The description of the API.
    CreateApi -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | This property is part of quick create. If you don\'t specify a routeKey,
    -- a default route of $default is created. The $default route acts as a
    -- catch-all for any request made to your API, for a particular stage. The
    -- \$default route key can\'t be modified. You can add routes after creating
    -- the API, and you can update the route keys of additional routes.
    -- Supported only for HTTP APIs.
    CreateApi -> Maybe Text
routeKey :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    CreateApi -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | This property is part of quick create. Quick create produces an API with
    -- an integration, a default catch-all route, and a default stage which is
    -- configured to automatically deploy changes. For HTTP integrations,
    -- specify a fully qualified URL. For Lambda integrations, specify a
    -- function ARN. The type of the integration will be HTTP_PROXY or
    -- AWS_PROXY, respectively. Supported only for HTTP APIs.
    CreateApi -> Maybe Text
target :: Prelude.Maybe Prelude.Text,
    -- | The API protocol.
    CreateApi -> ProtocolType
protocolType :: ProtocolType,
    -- | The name of the API.
    CreateApi -> Text
name :: Prelude.Text
  }
  deriving (CreateApi -> CreateApi -> Bool
(CreateApi -> CreateApi -> Bool)
-> (CreateApi -> CreateApi -> Bool) -> Eq CreateApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApi -> CreateApi -> Bool
$c/= :: CreateApi -> CreateApi -> Bool
== :: CreateApi -> CreateApi -> Bool
$c== :: CreateApi -> CreateApi -> Bool
Prelude.Eq, ReadPrec [CreateApi]
ReadPrec CreateApi
Int -> ReadS CreateApi
ReadS [CreateApi]
(Int -> ReadS CreateApi)
-> ReadS [CreateApi]
-> ReadPrec CreateApi
-> ReadPrec [CreateApi]
-> Read CreateApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApi]
$creadListPrec :: ReadPrec [CreateApi]
readPrec :: ReadPrec CreateApi
$creadPrec :: ReadPrec CreateApi
readList :: ReadS [CreateApi]
$creadList :: ReadS [CreateApi]
readsPrec :: Int -> ReadS CreateApi
$creadsPrec :: Int -> ReadS CreateApi
Prelude.Read, Int -> CreateApi -> ShowS
[CreateApi] -> ShowS
CreateApi -> String
(Int -> CreateApi -> ShowS)
-> (CreateApi -> String)
-> ([CreateApi] -> ShowS)
-> Show CreateApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApi] -> ShowS
$cshowList :: [CreateApi] -> ShowS
show :: CreateApi -> String
$cshow :: CreateApi -> String
showsPrec :: Int -> CreateApi -> ShowS
$cshowsPrec :: Int -> CreateApi -> ShowS
Prelude.Show, (forall x. CreateApi -> Rep CreateApi x)
-> (forall x. Rep CreateApi x -> CreateApi) -> Generic CreateApi
forall x. Rep CreateApi x -> CreateApi
forall x. CreateApi -> Rep CreateApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApi x -> CreateApi
$cfrom :: forall x. CreateApi -> Rep CreateApi x
Prelude.Generic)

-- |
-- Create a value of 'CreateApi' 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:
--
-- 'credentialsArn', 'createApi_credentialsArn' - This property is part of quick create. It specifies the credentials
-- required for the integration, if any. For a Lambda integration, three
-- options are available. To specify an IAM Role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To require that the
-- caller\'s identity be passed through from the request, specify
-- arn:aws:iam::*:user\/*. To use resource-based permissions on supported
-- AWS services, specify null. Currently, this property is not used for
-- HTTP integrations. Supported only for HTTP APIs.
--
-- 'disableExecuteApiEndpoint', 'createApi_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.
--
-- 'version', 'createApi_version' - A version identifier for the API.
--
-- 'apiKeySelectionExpression', 'createApi_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', 'createApi_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs. See
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html Configuring CORS>
-- for more information.
--
-- 'routeSelectionExpression', 'createApi_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.
--
-- 'disableSchemaValidation', 'createApi_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'createApi_description' - The description of the API.
--
-- 'routeKey', 'createApi_routeKey' - This property is part of quick create. If you don\'t specify a routeKey,
-- a default route of $default is created. The $default route acts as a
-- catch-all for any request made to your API, for a particular stage. The
-- \$default route key can\'t be modified. You can add routes after creating
-- the API, and you can update the route keys of additional routes.
-- Supported only for HTTP APIs.
--
-- 'tags', 'createApi_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'target', 'createApi_target' - This property is part of quick create. Quick create produces an API with
-- an integration, a default catch-all route, and a default stage which is
-- configured to automatically deploy changes. For HTTP integrations,
-- specify a fully qualified URL. For Lambda integrations, specify a
-- function ARN. The type of the integration will be HTTP_PROXY or
-- AWS_PROXY, respectively. Supported only for HTTP APIs.
--
-- 'protocolType', 'createApi_protocolType' - The API protocol.
--
-- 'name', 'createApi_name' - The name of the API.
newCreateApi ::
  -- | 'protocolType'
  ProtocolType ->
  -- | 'name'
  Prelude.Text ->
  CreateApi
newCreateApi :: ProtocolType -> Text -> CreateApi
newCreateApi ProtocolType
pProtocolType_ Text
pName_ =
  CreateApi' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Cors
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ProtocolType
-> Text
-> CreateApi
CreateApi'
    { $sel:credentialsArn:CreateApi' :: Maybe Text
credentialsArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:CreateApi' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:version:CreateApi' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:CreateApi' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:CreateApi' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:CreateApi' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:CreateApi' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateApi' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routeKey:CreateApi' :: Maybe Text
routeKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:target:CreateApi' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:CreateApi' :: ProtocolType
protocolType = ProtocolType
pProtocolType_,
      $sel:name:CreateApi' :: Text
name = Text
pName_
    }

-- | This property is part of quick create. It specifies the credentials
-- required for the integration, if any. For a Lambda integration, three
-- options are available. To specify an IAM Role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To require that the
-- caller\'s identity be passed through from the request, specify
-- arn:aws:iam::*:user\/*. To use resource-based permissions on supported
-- AWS services, specify null. Currently, this property is not used for
-- HTTP integrations. Supported only for HTTP APIs.
createApi_credentialsArn :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_credentialsArn :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_credentialsArn = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
credentialsArn :: Maybe Text
$sel:credentialsArn:CreateApi' :: CreateApi -> Maybe Text
credentialsArn} -> Maybe Text
credentialsArn) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:credentialsArn:CreateApi' :: Maybe Text
credentialsArn = Maybe Text
a} :: CreateApi)

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

-- | A version identifier for the API.
createApi_version :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_version :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_version = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
version :: Maybe Text
$sel:version:CreateApi' :: CreateApi -> Maybe Text
version} -> Maybe Text
version) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:version:CreateApi' :: Maybe Text
version = Maybe Text
a} :: CreateApi)

-- | 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>.
createApi_apiKeySelectionExpression :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_apiKeySelectionExpression :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_apiKeySelectionExpression = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
apiKeySelectionExpression :: Maybe Text
$sel:apiKeySelectionExpression:CreateApi' :: CreateApi -> Maybe Text
apiKeySelectionExpression} -> Maybe Text
apiKeySelectionExpression) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:apiKeySelectionExpression:CreateApi' :: Maybe Text
apiKeySelectionExpression = Maybe Text
a} :: CreateApi)

-- | A CORS configuration. Supported only for HTTP APIs. See
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html Configuring CORS>
-- for more information.
createApi_corsConfiguration :: Lens.Lens' CreateApi (Prelude.Maybe Cors)
createApi_corsConfiguration :: (Maybe Cors -> f (Maybe Cors)) -> CreateApi -> f CreateApi
createApi_corsConfiguration = (CreateApi -> Maybe Cors)
-> (CreateApi -> Maybe Cors -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Cors) (Maybe Cors)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Cors
corsConfiguration :: Maybe Cors
$sel:corsConfiguration:CreateApi' :: CreateApi -> Maybe Cors
corsConfiguration} -> Maybe Cors
corsConfiguration) (\s :: CreateApi
s@CreateApi' {} Maybe Cors
a -> CreateApi
s {$sel:corsConfiguration:CreateApi' :: Maybe Cors
corsConfiguration = Maybe Cors
a} :: CreateApi)

-- | 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.
createApi_routeSelectionExpression :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_routeSelectionExpression :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_routeSelectionExpression = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
routeSelectionExpression :: Maybe Text
$sel:routeSelectionExpression:CreateApi' :: CreateApi -> Maybe Text
routeSelectionExpression} -> Maybe Text
routeSelectionExpression) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:routeSelectionExpression:CreateApi' :: Maybe Text
routeSelectionExpression = Maybe Text
a} :: CreateApi)

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

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

-- | This property is part of quick create. If you don\'t specify a routeKey,
-- a default route of $default is created. The $default route acts as a
-- catch-all for any request made to your API, for a particular stage. The
-- \$default route key can\'t be modified. You can add routes after creating
-- the API, and you can update the route keys of additional routes.
-- Supported only for HTTP APIs.
createApi_routeKey :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_routeKey :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_routeKey = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
routeKey :: Maybe Text
$sel:routeKey:CreateApi' :: CreateApi -> Maybe Text
routeKey} -> Maybe Text
routeKey) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:routeKey:CreateApi' :: Maybe Text
routeKey = Maybe Text
a} :: CreateApi)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
createApi_tags :: Lens.Lens' CreateApi (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApi_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApi -> f CreateApi
createApi_tags = (CreateApi -> Maybe (HashMap Text Text))
-> (CreateApi -> Maybe (HashMap Text Text) -> CreateApi)
-> Lens
     CreateApi
     CreateApi
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateApi' :: CreateApi -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateApi
s@CreateApi' {} Maybe (HashMap Text Text)
a -> CreateApi
s {$sel:tags:CreateApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateApi) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateApi -> f CreateApi)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApi
-> f CreateApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This property is part of quick create. Quick create produces an API with
-- an integration, a default catch-all route, and a default stage which is
-- configured to automatically deploy changes. For HTTP integrations,
-- specify a fully qualified URL. For Lambda integrations, specify a
-- function ARN. The type of the integration will be HTTP_PROXY or
-- AWS_PROXY, respectively. Supported only for HTTP APIs.
createApi_target :: Lens.Lens' CreateApi (Prelude.Maybe Prelude.Text)
createApi_target :: (Maybe Text -> f (Maybe Text)) -> CreateApi -> f CreateApi
createApi_target = (CreateApi -> Maybe Text)
-> (CreateApi -> Maybe Text -> CreateApi)
-> Lens CreateApi CreateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApi' {Maybe Text
target :: Maybe Text
$sel:target:CreateApi' :: CreateApi -> Maybe Text
target} -> Maybe Text
target) (\s :: CreateApi
s@CreateApi' {} Maybe Text
a -> CreateApi
s {$sel:target:CreateApi' :: Maybe Text
target = Maybe Text
a} :: CreateApi)

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

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

instance Core.AWSRequest CreateApi where
  type AWSResponse CreateApi = CreateApiResponse
  request :: CreateApi -> Request CreateApi
request = Service -> CreateApi -> Request CreateApi
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApi)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateApi))
-> Logger
-> Service
-> Proxy CreateApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApi)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Cors
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe ProtocolType
-> Maybe (HashMap Text Text)
-> Int
-> CreateApiResponse
CreateApiResponse'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Cors
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Bool
 -> Maybe Text
 -> Maybe ProtocolType
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiId")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"disableExecuteApiEndpoint")
            Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiEndpoint")
            Either
  String
  (Maybe [Text]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"warnings" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"version")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiGatewayManaged")
            Either
  String
  (Maybe Text
   -> Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiKeySelectionExpression")
            Either
  String
  (Maybe Cors
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Cors)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Cors)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"corsConfiguration")
            Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"routeSelectionExpression")
            Either
  String
  (Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"importInfo" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"disableSchemaValidation")
            Either
  String
  (Maybe Text
   -> Maybe ProtocolType
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ProtocolType
      -> Maybe (HashMap Text Text) -> Int -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"description")
            Either
  String
  (Maybe ProtocolType
   -> Maybe (HashMap Text Text) -> Int -> CreateApiResponse)
-> Either String (Maybe ProtocolType)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ProtocolType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"protocolType")
            Either
  String (Maybe (HashMap Text Text) -> Int -> CreateApiResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateApiResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateApiResponse)
-> Either String Int -> Either String CreateApiResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateApi

instance Prelude.NFData CreateApi

instance Core.ToHeaders CreateApi where
  toHeaders :: CreateApi -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateApi -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateApi where
  toJSON :: CreateApi -> Value
toJSON CreateApi' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe Cors
Text
ProtocolType
name :: Text
protocolType :: ProtocolType
target :: Maybe Text
tags :: Maybe (HashMap Text Text)
routeKey :: Maybe Text
description :: Maybe Text
disableSchemaValidation :: Maybe Bool
routeSelectionExpression :: Maybe Text
corsConfiguration :: Maybe Cors
apiKeySelectionExpression :: Maybe Text
version :: Maybe Text
disableExecuteApiEndpoint :: Maybe Bool
credentialsArn :: Maybe Text
$sel:name:CreateApi' :: CreateApi -> Text
$sel:protocolType:CreateApi' :: CreateApi -> ProtocolType
$sel:target:CreateApi' :: CreateApi -> Maybe Text
$sel:tags:CreateApi' :: CreateApi -> Maybe (HashMap Text Text)
$sel:routeKey:CreateApi' :: CreateApi -> Maybe Text
$sel:description:CreateApi' :: CreateApi -> Maybe Text
$sel:disableSchemaValidation:CreateApi' :: CreateApi -> Maybe Bool
$sel:routeSelectionExpression:CreateApi' :: CreateApi -> Maybe Text
$sel:corsConfiguration:CreateApi' :: CreateApi -> Maybe Cors
$sel:apiKeySelectionExpression:CreateApi' :: CreateApi -> Maybe Text
$sel:version:CreateApi' :: CreateApi -> Maybe Text
$sel:disableExecuteApiEndpoint:CreateApi' :: CreateApi -> Maybe Bool
$sel:credentialsArn:CreateApi' :: CreateApi -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"credentialsArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
credentialsArn,
            (Text
"disableExecuteApiEndpoint" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableExecuteApiEndpoint,
            (Text
"version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version,
            (Text
"apiKeySelectionExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiKeySelectionExpression,
            (Text
"corsConfiguration" Text -> Cors -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Cors -> Pair) -> Maybe Cors -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Cors
corsConfiguration,
            (Text
"routeSelectionExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
routeSelectionExpression,
            (Text
"disableSchemaValidation" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableSchemaValidation,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"routeKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
routeKey,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Text
"target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
target,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"protocolType" Text -> ProtocolType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ProtocolType
protocolType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath CreateApi where
  toPath :: CreateApi -> ByteString
toPath = ByteString -> CreateApi -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/apis"

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

-- | /See:/ 'newCreateApiResponse' smart constructor.
data CreateApiResponse = CreateApiResponse'
  { -- | The API ID.
    CreateApiResponse -> Maybe Text
apiId :: 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.
    CreateApiResponse -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | 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.
    CreateApiResponse -> Maybe Text
apiEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The warning messages reported when failonwarnings is turned on during
    -- API import.
    CreateApiResponse -> Maybe [Text]
warnings :: Prelude.Maybe [Prelude.Text],
    -- | The timestamp when the API was created.
    CreateApiResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the API.
    CreateApiResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A version identifier for the API.
    CreateApiResponse -> Maybe Text
version :: 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.
    CreateApiResponse -> Maybe Bool
apiGatewayManaged :: Prelude.Maybe Prelude.Bool,
    -- | 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>.
    CreateApiResponse -> Maybe Text
apiKeySelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A CORS configuration. Supported only for HTTP APIs.
    CreateApiResponse -> Maybe Cors
corsConfiguration :: Prelude.Maybe Cors,
    -- | 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.
    CreateApiResponse -> Maybe Text
routeSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | 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.
    CreateApiResponse -> Maybe [Text]
importInfo :: Prelude.Maybe [Prelude.Text],
    -- | Avoid validating models when creating a deployment. Supported only for
    -- WebSocket APIs.
    CreateApiResponse -> Maybe Bool
disableSchemaValidation :: Prelude.Maybe Prelude.Bool,
    -- | The description of the API.
    CreateApiResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The API protocol.
    CreateApiResponse -> Maybe ProtocolType
protocolType :: Prelude.Maybe ProtocolType,
    -- | A collection of tags associated with the API.
    CreateApiResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateApiResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateApiResponse -> CreateApiResponse -> Bool
(CreateApiResponse -> CreateApiResponse -> Bool)
-> (CreateApiResponse -> CreateApiResponse -> Bool)
-> Eq CreateApiResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApiResponse -> CreateApiResponse -> Bool
$c/= :: CreateApiResponse -> CreateApiResponse -> Bool
== :: CreateApiResponse -> CreateApiResponse -> Bool
$c== :: CreateApiResponse -> CreateApiResponse -> Bool
Prelude.Eq, ReadPrec [CreateApiResponse]
ReadPrec CreateApiResponse
Int -> ReadS CreateApiResponse
ReadS [CreateApiResponse]
(Int -> ReadS CreateApiResponse)
-> ReadS [CreateApiResponse]
-> ReadPrec CreateApiResponse
-> ReadPrec [CreateApiResponse]
-> Read CreateApiResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApiResponse]
$creadListPrec :: ReadPrec [CreateApiResponse]
readPrec :: ReadPrec CreateApiResponse
$creadPrec :: ReadPrec CreateApiResponse
readList :: ReadS [CreateApiResponse]
$creadList :: ReadS [CreateApiResponse]
readsPrec :: Int -> ReadS CreateApiResponse
$creadsPrec :: Int -> ReadS CreateApiResponse
Prelude.Read, Int -> CreateApiResponse -> ShowS
[CreateApiResponse] -> ShowS
CreateApiResponse -> String
(Int -> CreateApiResponse -> ShowS)
-> (CreateApiResponse -> String)
-> ([CreateApiResponse] -> ShowS)
-> Show CreateApiResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApiResponse] -> ShowS
$cshowList :: [CreateApiResponse] -> ShowS
show :: CreateApiResponse -> String
$cshow :: CreateApiResponse -> String
showsPrec :: Int -> CreateApiResponse -> ShowS
$cshowsPrec :: Int -> CreateApiResponse -> ShowS
Prelude.Show, (forall x. CreateApiResponse -> Rep CreateApiResponse x)
-> (forall x. Rep CreateApiResponse x -> CreateApiResponse)
-> Generic CreateApiResponse
forall x. Rep CreateApiResponse x -> CreateApiResponse
forall x. CreateApiResponse -> Rep CreateApiResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApiResponse x -> CreateApiResponse
$cfrom :: forall x. CreateApiResponse -> Rep CreateApiResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateApiResponse' 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:
--
-- 'apiId', 'createApiResponse_apiId' - The API ID.
--
-- 'disableExecuteApiEndpoint', 'createApiResponse_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.
--
-- 'apiEndpoint', 'createApiResponse_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.
--
-- 'warnings', 'createApiResponse_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'createdDate', 'createApiResponse_createdDate' - The timestamp when the API was created.
--
-- 'name', 'createApiResponse_name' - The name of the API.
--
-- 'version', 'createApiResponse_version' - A version identifier for the API.
--
-- 'apiGatewayManaged', 'createApiResponse_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.
--
-- 'apiKeySelectionExpression', 'createApiResponse_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', 'createApiResponse_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'routeSelectionExpression', 'createApiResponse_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.
--
-- 'importInfo', 'createApiResponse_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.
--
-- 'disableSchemaValidation', 'createApiResponse_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'createApiResponse_description' - The description of the API.
--
-- 'protocolType', 'createApiResponse_protocolType' - The API protocol.
--
-- 'tags', 'createApiResponse_tags' - A collection of tags associated with the API.
--
-- 'httpStatus', 'createApiResponse_httpStatus' - The response's http status code.
newCreateApiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateApiResponse
newCreateApiResponse :: Int -> CreateApiResponse
newCreateApiResponse Int
pHttpStatus_ =
  CreateApiResponse' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Cors
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe ProtocolType
-> Maybe (HashMap Text Text)
-> Int
-> CreateApiResponse
CreateApiResponse'
    { $sel:apiId:CreateApiResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:CreateApiResponse' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiEndpoint:CreateApiResponse' :: Maybe Text
apiEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:CreateApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:CreateApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateApiResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:CreateApiResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:CreateApiResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:CreateApiResponse' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:CreateApiResponse' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:CreateApiResponse' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importInfo:CreateApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:CreateApiResponse' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateApiResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:CreateApiResponse' :: Maybe ProtocolType
protocolType = Maybe ProtocolType
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateApiResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | 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.
createApiResponse_apiEndpoint :: Lens.Lens' CreateApiResponse (Prelude.Maybe Prelude.Text)
createApiResponse_apiEndpoint :: (Maybe Text -> f (Maybe Text))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_apiEndpoint = (CreateApiResponse -> Maybe Text)
-> (CreateApiResponse -> Maybe Text -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe Text
apiEndpoint :: Maybe Text
$sel:apiEndpoint:CreateApiResponse' :: CreateApiResponse -> Maybe Text
apiEndpoint} -> Maybe Text
apiEndpoint) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe Text
a -> CreateApiResponse
s {$sel:apiEndpoint:CreateApiResponse' :: Maybe Text
apiEndpoint = Maybe Text
a} :: CreateApiResponse)

-- | The warning messages reported when failonwarnings is turned on during
-- API import.
createApiResponse_warnings :: Lens.Lens' CreateApiResponse (Prelude.Maybe [Prelude.Text])
createApiResponse_warnings :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_warnings = (CreateApiResponse -> Maybe [Text])
-> (CreateApiResponse -> Maybe [Text] -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:CreateApiResponse' :: CreateApiResponse -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe [Text]
a -> CreateApiResponse
s {$sel:warnings:CreateApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
a} :: CreateApiResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateApiResponse -> f CreateApiResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateApiResponse
-> f CreateApiResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp when the API was created.
createApiResponse_createdDate :: Lens.Lens' CreateApiResponse (Prelude.Maybe Prelude.UTCTime)
createApiResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_createdDate = (CreateApiResponse -> Maybe POSIX)
-> (CreateApiResponse -> Maybe POSIX -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:CreateApiResponse' :: CreateApiResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe POSIX
a -> CreateApiResponse
s {$sel:createdDate:CreateApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: CreateApiResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateApiResponse -> f CreateApiResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateApiResponse
-> f CreateApiResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | A version identifier for the API.
createApiResponse_version :: Lens.Lens' CreateApiResponse (Prelude.Maybe Prelude.Text)
createApiResponse_version :: (Maybe Text -> f (Maybe Text))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_version = (CreateApiResponse -> Maybe Text)
-> (CreateApiResponse -> Maybe Text -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe Text
version :: Maybe Text
$sel:version:CreateApiResponse' :: CreateApiResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe Text
a -> CreateApiResponse
s {$sel:version:CreateApiResponse' :: Maybe Text
version = Maybe Text
a} :: CreateApiResponse)

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

-- | 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>.
createApiResponse_apiKeySelectionExpression :: Lens.Lens' CreateApiResponse (Prelude.Maybe Prelude.Text)
createApiResponse_apiKeySelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_apiKeySelectionExpression = (CreateApiResponse -> Maybe Text)
-> (CreateApiResponse -> Maybe Text -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe Text
apiKeySelectionExpression :: Maybe Text
$sel:apiKeySelectionExpression:CreateApiResponse' :: CreateApiResponse -> Maybe Text
apiKeySelectionExpression} -> Maybe Text
apiKeySelectionExpression) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe Text
a -> CreateApiResponse
s {$sel:apiKeySelectionExpression:CreateApiResponse' :: Maybe Text
apiKeySelectionExpression = Maybe Text
a} :: CreateApiResponse)

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

-- | 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.
createApiResponse_routeSelectionExpression :: Lens.Lens' CreateApiResponse (Prelude.Maybe Prelude.Text)
createApiResponse_routeSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_routeSelectionExpression = (CreateApiResponse -> Maybe Text)
-> (CreateApiResponse -> Maybe Text -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe Text
routeSelectionExpression :: Maybe Text
$sel:routeSelectionExpression:CreateApiResponse' :: CreateApiResponse -> Maybe Text
routeSelectionExpression} -> Maybe Text
routeSelectionExpression) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe Text
a -> CreateApiResponse
s {$sel:routeSelectionExpression:CreateApiResponse' :: Maybe Text
routeSelectionExpression = Maybe Text
a} :: CreateApiResponse)

-- | 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.
createApiResponse_importInfo :: Lens.Lens' CreateApiResponse (Prelude.Maybe [Prelude.Text])
createApiResponse_importInfo :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_importInfo = (CreateApiResponse -> Maybe [Text])
-> (CreateApiResponse -> Maybe [Text] -> CreateApiResponse)
-> Lens
     CreateApiResponse CreateApiResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe [Text]
importInfo :: Maybe [Text]
$sel:importInfo:CreateApiResponse' :: CreateApiResponse -> Maybe [Text]
importInfo} -> Maybe [Text]
importInfo) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe [Text]
a -> CreateApiResponse
s {$sel:importInfo:CreateApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
a} :: CreateApiResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateApiResponse -> f CreateApiResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateApiResponse
-> f CreateApiResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

-- | The API protocol.
createApiResponse_protocolType :: Lens.Lens' CreateApiResponse (Prelude.Maybe ProtocolType)
createApiResponse_protocolType :: (Maybe ProtocolType -> f (Maybe ProtocolType))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_protocolType = (CreateApiResponse -> Maybe ProtocolType)
-> (CreateApiResponse -> Maybe ProtocolType -> CreateApiResponse)
-> Lens
     CreateApiResponse
     CreateApiResponse
     (Maybe ProtocolType)
     (Maybe ProtocolType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe ProtocolType
protocolType :: Maybe ProtocolType
$sel:protocolType:CreateApiResponse' :: CreateApiResponse -> Maybe ProtocolType
protocolType} -> Maybe ProtocolType
protocolType) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe ProtocolType
a -> CreateApiResponse
s {$sel:protocolType:CreateApiResponse' :: Maybe ProtocolType
protocolType = Maybe ProtocolType
a} :: CreateApiResponse)

-- | A collection of tags associated with the API.
createApiResponse_tags :: Lens.Lens' CreateApiResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApiResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApiResponse -> f CreateApiResponse
createApiResponse_tags = (CreateApiResponse -> Maybe (HashMap Text Text))
-> (CreateApiResponse
    -> Maybe (HashMap Text Text) -> CreateApiResponse)
-> Lens
     CreateApiResponse
     CreateApiResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateApiResponse' :: CreateApiResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateApiResponse
s@CreateApiResponse' {} Maybe (HashMap Text Text)
a -> CreateApiResponse
s {$sel:tags:CreateApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateApiResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateApiResponse -> f CreateApiResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateApiResponse
-> f CreateApiResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateApiResponse