{-# 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-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)
--
-- 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_apiId,
    getApiResponse_disableExecuteApiEndpoint,
    getApiResponse_apiEndpoint,
    getApiResponse_warnings,
    getApiResponse_createdDate,
    getApiResponse_name,
    getApiResponse_version,
    getApiResponse_apiGatewayManaged,
    getApiResponse_apiKeySelectionExpression,
    getApiResponse_corsConfiguration,
    getApiResponse_routeSelectionExpression,
    getApiResponse_importInfo,
    getApiResponse_disableSchemaValidation,
    getApiResponse_description,
    getApiResponse_protocolType,
    getApiResponse_tags,
    getApiResponse_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

-- | /See:/ 'newGetApi' smart constructor.
data GetApi = GetApi'
  { -- | The API identifier.
    GetApi -> Text
apiId :: Prelude.Text
  }
  deriving (GetApi -> GetApi -> Bool
(GetApi -> GetApi -> Bool)
-> (GetApi -> GetApi -> Bool) -> Eq GetApi
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]
(Int -> ReadS GetApi)
-> ReadS [GetApi]
-> ReadPrec GetApi
-> ReadPrec [GetApi]
-> Read 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
(Int -> GetApi -> ShowS)
-> (GetApi -> String) -> ([GetApi] -> ShowS) -> Show GetApi
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. GetApi -> Rep GetApi x)
-> (forall x. Rep GetApi x -> GetApi) -> Generic GetApi
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' :: Text -> GetApi
GetApi' {$sel:apiId:GetApi' :: Text
apiId = Text
pApiId_}

-- | The API identifier.
getApi_apiId :: Lens.Lens' GetApi Prelude.Text
getApi_apiId :: (Text -> f Text) -> GetApi -> f GetApi
getApi_apiId = (GetApi -> Text)
-> (GetApi -> Text -> GetApi) -> Lens GetApi GetApi Text Text
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 :: GetApi -> Request GetApi
request = Service -> GetApi -> Request GetApi
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetApi)))
response =
    (Int
 -> ResponseHeaders -> Object -> Either String (AWSResponse GetApi))
-> Logger
-> Service
-> Proxy GetApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetApi)))
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
-> GetApiResponse
GetApiResponse'
            (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
 -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> 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
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe Cors)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetApiResponse)
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
   -> GetApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ProtocolType
      -> Maybe (HashMap Text Text) -> Int -> GetApiResponse)
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 -> GetApiResponse)
-> Either String (Maybe ProtocolType)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> GetApiResponse)
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 -> GetApiResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetApiResponse)
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 -> GetApiResponse)
-> Either String Int -> Either String GetApiResponse
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 GetApi

instance Prelude.NFData GetApi

instance Core.ToHeaders GetApi where
  toHeaders :: GetApi -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetApi -> 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.ToPath GetApi where
  toPath :: GetApi -> ByteString
toPath GetApi' {Text
apiId :: Text
$sel:apiId:GetApi' :: GetApi -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId]

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

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

-- | The API ID.
getApiResponse_apiId :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Text)
getApiResponse_apiId :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_apiId = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> GetApiResponse -> f GetApiResponse
getApiResponse_disableExecuteApiEndpoint = (GetApiResponse -> Maybe Bool)
-> (GetApiResponse -> Maybe Bool -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_apiEndpoint = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | The warning messages reported when failonwarnings is turned on during
-- API import.
getApiResponse_warnings :: Lens.Lens' GetApiResponse (Prelude.Maybe [Prelude.Text])
getApiResponse_warnings :: (Maybe [Text] -> f (Maybe [Text]))
-> GetApiResponse -> f GetApiResponse
getApiResponse_warnings = (GetApiResponse -> Maybe [Text])
-> (GetApiResponse -> Maybe [Text] -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetApiResponse -> f GetApiResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetApiResponse
-> f GetApiResponse
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.
getApiResponse_createdDate :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.UTCTime)
getApiResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetApiResponse -> f GetApiResponse
getApiResponse_createdDate = (GetApiResponse -> Maybe POSIX)
-> (GetApiResponse -> Maybe POSIX -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApiResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetApiResponse' :: GetApiResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetApiResponse
s@GetApiResponse' {} Maybe POSIX
a -> GetApiResponse
s {$sel:createdDate:GetApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetApiResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetApiResponse -> f GetApiResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetApiResponse
-> f GetApiResponse
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.
getApiResponse_name :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Text)
getApiResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_name = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | A version identifier for the API.
getApiResponse_version :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Text)
getApiResponse_version :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_version = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> GetApiResponse -> f GetApiResponse
getApiResponse_apiGatewayManaged = (GetApiResponse -> Maybe Bool)
-> (GetApiResponse -> Maybe Bool -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_apiKeySelectionExpression = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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 :: (Maybe Cors -> f (Maybe Cors))
-> GetApiResponse -> f GetApiResponse
getApiResponse_corsConfiguration = (GetApiResponse -> Maybe Cors)
-> (GetApiResponse -> Maybe Cors -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Cors) (Maybe Cors)
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 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 :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_routeSelectionExpression = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe [Text] -> f (Maybe [Text]))
-> GetApiResponse -> f GetApiResponse
getApiResponse_importInfo = (GetApiResponse -> Maybe [Text])
-> (GetApiResponse -> Maybe [Text] -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetApiResponse -> f GetApiResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetApiResponse
-> f GetApiResponse
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.
getApiResponse_disableSchemaValidation :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Bool)
getApiResponse_disableSchemaValidation :: (Maybe Bool -> f (Maybe Bool))
-> GetApiResponse -> f GetApiResponse
getApiResponse_disableSchemaValidation = (GetApiResponse -> Maybe Bool)
-> (GetApiResponse -> Maybe Bool -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Bool) (Maybe Bool)
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 description of the API.
getApiResponse_description :: Lens.Lens' GetApiResponse (Prelude.Maybe Prelude.Text)
getApiResponse_description :: (Maybe Text -> f (Maybe Text))
-> GetApiResponse -> f GetApiResponse
getApiResponse_description = (GetApiResponse -> Maybe Text)
-> (GetApiResponse -> Maybe Text -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse (Maybe Text) (Maybe Text)
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)

-- | The API protocol.
getApiResponse_protocolType :: Lens.Lens' GetApiResponse (Prelude.Maybe ProtocolType)
getApiResponse_protocolType :: (Maybe ProtocolType -> f (Maybe ProtocolType))
-> GetApiResponse -> f GetApiResponse
getApiResponse_protocolType = (GetApiResponse -> Maybe ProtocolType)
-> (GetApiResponse -> Maybe ProtocolType -> GetApiResponse)
-> Lens
     GetApiResponse
     GetApiResponse
     (Maybe ProtocolType)
     (Maybe 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)

-- | A collection of tags associated with the API.
getApiResponse_tags :: Lens.Lens' GetApiResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getApiResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetApiResponse -> f GetApiResponse
getApiResponse_tags = (GetApiResponse -> Maybe (HashMap Text Text))
-> (GetApiResponse -> Maybe (HashMap Text Text) -> GetApiResponse)
-> Lens
     GetApiResponse
     GetApiResponse
     (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 (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetApiResponse -> f GetApiResponse)
-> ((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)))
-> GetApiResponse
-> f GetApiResponse
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.
getApiResponse_httpStatus :: Lens.Lens' GetApiResponse Prelude.Int
getApiResponse_httpStatus :: (Int -> f Int) -> GetApiResponse -> f GetApiResponse
getApiResponse_httpStatus = (GetApiResponse -> Int)
-> (GetApiResponse -> Int -> GetApiResponse)
-> Lens GetApiResponse GetApiResponse Int Int
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