{-# 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.GetApi
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets an Api resource.
module Amazonka.ApiGatewayV2.GetApi
  ( -- * Creating a Request
    GetApi (..),
    newGetApi,

    -- * Request Lenses
    getApi_apiId,

    -- * Destructuring the Response
    GetApiResponse (..),
    newGetApiResponse,

    -- * Response Lenses
    getApiResponse_apiEndpoint,
    getApiResponse_apiGatewayManaged,
    getApiResponse_apiId,
    getApiResponse_apiKeySelectionExpression,
    getApiResponse_corsConfiguration,
    getApiResponse_createdDate,
    getApiResponse_description,
    getApiResponse_disableExecuteApiEndpoint,
    getApiResponse_disableSchemaValidation,
    getApiResponse_importInfo,
    getApiResponse_name,
    getApiResponse_protocolType,
    getApiResponse_routeSelectionExpression,
    getApiResponse_tags,
    getApiResponse_version,
    getApiResponse_warnings,
    getApiResponse_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetApi' smart constructor.
data GetApi = GetApi'
  { -- | The API identifier.
    GetApi -> Text
apiId :: Prelude.Text
  }
  deriving (GetApi -> GetApi -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApi -> GetApi -> Bool
$c/= :: GetApi -> GetApi -> Bool
== :: GetApi -> GetApi -> Bool
$c== :: GetApi -> GetApi -> Bool
Prelude.Eq, ReadPrec [GetApi]
ReadPrec GetApi
Int -> ReadS GetApi
ReadS [GetApi]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApi]
$creadListPrec :: ReadPrec [GetApi]
readPrec :: ReadPrec GetApi
$creadPrec :: ReadPrec GetApi
readList :: ReadS [GetApi]
$creadList :: ReadS [GetApi]
readsPrec :: Int -> ReadS GetApi
$creadsPrec :: Int -> ReadS GetApi
Prelude.Read, Int -> GetApi -> ShowS
[GetApi] -> ShowS
GetApi -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApi] -> ShowS
$cshowList :: [GetApi] -> ShowS
show :: GetApi -> String
$cshow :: GetApi -> String
showsPrec :: Int -> GetApi -> ShowS
$cshowsPrec :: Int -> GetApi -> ShowS
Prelude.Show, forall x. Rep GetApi x -> GetApi
forall x. GetApi -> Rep GetApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApi x -> GetApi
$cfrom :: forall x. GetApi -> Rep GetApi x
Prelude.Generic)

-- |
-- Create a value of 'GetApi' 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', 'getApi_apiId' - The API identifier.
newGetApi ::
  -- | 'apiId'
  Prelude.Text ->
  GetApi
newGetApi :: Text -> GetApi
newGetApi Text
pApiId_ = GetApi' {$sel:apiId:GetApi' :: Text
apiId = Text
pApiId_}

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

instance Core.AWSRequest GetApi where
  type AWSResponse GetApi = GetApiResponse
  request :: (Service -> Service) -> GetApi -> Request GetApi
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetApi)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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 Cors
-> Maybe ISO8601
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe ProtocolType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe [Text]
-> Int
-> GetApiResponse
GetApiResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"importInfo" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ 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 -> Either String (Maybe 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 -> Either String (Maybe a)
Data..?> Key
"protocolType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe 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 -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ 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 -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"warnings" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetApi where
  hashWithSalt :: Int -> GetApi -> Int
hashWithSalt Int
_salt GetApi' {Text
apiId :: Text
$sel:apiId:GetApi' :: GetApi -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
apiId

instance Prelude.NFData GetApi where
  rnf :: GetApi -> ()
rnf GetApi' {Text
apiId :: Text
$sel:apiId:GetApi' :: GetApi -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
apiId

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

instance Data.ToPath GetApi where
  toPath :: GetApi -> ByteString
toPath GetApi' {Text
apiId :: Text
$sel:apiId:GetApi' :: GetApi -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/v2/apis/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
apiId]

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

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

-- |
-- Create a value of 'GetApiResponse' 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', 'getApiResponse_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', 'getApiResponse_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', 'getApiResponse_apiId' - The API ID.
--
-- 'apiKeySelectionExpression', 'getApiResponse_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', 'getApiResponse_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'createdDate', 'getApiResponse_createdDate' - The timestamp when the API was created.
--
-- 'description', 'getApiResponse_description' - The description of the API.
--
-- 'disableExecuteApiEndpoint', 'getApiResponse_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', 'getApiResponse_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'importInfo', 'getApiResponse_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.
--
-- 'name', 'getApiResponse_name' - The name of the API.
--
-- 'protocolType', 'getApiResponse_protocolType' - The API protocol.
--
-- 'routeSelectionExpression', 'getApiResponse_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.
--
-- 'tags', 'getApiResponse_tags' - A collection of tags associated with the API.
--
-- 'version', 'getApiResponse_version' - A version identifier for the API.
--
-- 'warnings', 'getApiResponse_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'httpStatus', 'getApiResponse_httpStatus' - The response's http status code.
newGetApiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetApiResponse
newGetApiResponse :: Int -> GetApiResponse
newGetApiResponse Int
pHttpStatus_ =
  GetApiResponse'
    { $sel:apiEndpoint:GetApiResponse' :: Maybe Text
apiEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:GetApiResponse' :: Maybe Bool
apiGatewayManaged = forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:GetApiResponse' :: Maybe Text
apiId = forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:GetApiResponse' :: Maybe Text
apiKeySelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:GetApiResponse' :: Maybe Cors
corsConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetApiResponse' :: Maybe ISO8601
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetApiResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:GetApiResponse' :: Maybe Bool
disableExecuteApiEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:GetApiResponse' :: Maybe Bool
disableSchemaValidation = forall a. Maybe a
Prelude.Nothing,
      $sel:importInfo:GetApiResponse' :: Maybe [Text]
importInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetApiResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:GetApiResponse' :: Maybe ProtocolType
protocolType = forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:GetApiResponse' :: Maybe Text
routeSelectionExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetApiResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:version:GetApiResponse' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:GetApiResponse' :: Maybe [Text]
warnings = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetApiResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

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

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

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

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

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

-- | A collection of tags associated with the API.
getApiResponse_tags :: Lens.Lens' GetApiResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getApiResponse_tags :: Lens' GetApiResponse (Maybe (HashMap Text Text))
getApiResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetApiResponse' :: GetApiResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetApiResponse
s@GetApiResponse' {} Maybe (HashMap Text Text)
a -> GetApiResponse
s {$sel:tags:GetApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetApiResponse) 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.
getApiResponse_version :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Text)
getApiResponse_version :: Lens' GetApiResponse (Maybe Text)
getApiResponse_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiResponse' {Maybe Text
version :: Maybe Text
$sel:version:GetApiResponse' :: GetApiResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: GetApiResponse
s@GetApiResponse' {} Maybe Text
a -> GetApiResponse
s {$sel:version:GetApiResponse' :: Maybe Text
version = Maybe Text
a} :: GetApiResponse)

-- | The warning messages reported when failonwarnings is turned on during
-- API import.
getApiResponse_warnings :: Lens.Lens' GetApiResponse (Prelude.Maybe [Prelude.Text])
getApiResponse_warnings :: Lens' GetApiResponse (Maybe [Text])
getApiResponse_warnings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiResponse' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:GetApiResponse' :: GetApiResponse -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: GetApiResponse
s@GetApiResponse' {} Maybe [Text]
a -> GetApiResponse
s {$sel:warnings:GetApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
a} :: GetApiResponse) 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 response's http status code.
getApiResponse_httpStatus :: Lens.Lens' GetApiResponse Prelude.Int
getApiResponse_httpStatus :: Lens' GetApiResponse Int
getApiResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetApiResponse' :: GetApiResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetApiResponse
s@GetApiResponse' {} Int
a -> GetApiResponse
s {$sel:httpStatus:GetApiResponse' :: Int
httpStatus = Int
a} :: GetApiResponse)

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