{-# 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.ImportApi
-- 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)
--
-- Imports an API.
module Amazonka.ApiGatewayV2.ImportApi
  ( -- * Creating a Request
    ImportApi (..),
    newImportApi,

    -- * Request Lenses
    importApi_basepath,
    importApi_failOnWarnings,
    importApi_body,

    -- * Destructuring the Response
    ImportApiResponse (..),
    newImportApiResponse,

    -- * Response Lenses
    importApiResponse_apiId,
    importApiResponse_disableExecuteApiEndpoint,
    importApiResponse_apiEndpoint,
    importApiResponse_warnings,
    importApiResponse_createdDate,
    importApiResponse_name,
    importApiResponse_version,
    importApiResponse_apiGatewayManaged,
    importApiResponse_apiKeySelectionExpression,
    importApiResponse_corsConfiguration,
    importApiResponse_routeSelectionExpression,
    importApiResponse_importInfo,
    importApiResponse_disableSchemaValidation,
    importApiResponse_description,
    importApiResponse_protocolType,
    importApiResponse_tags,
    importApiResponse_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:/ 'newImportApi' smart constructor.
data ImportApi = ImportApi'
  { -- | Specifies how to interpret the base path of the API during import. Valid
    -- values are ignore, prepend, and split. The default value is ignore. To
    -- learn more, see
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html Set the OpenAPI basePath Property>.
    -- Supported only for HTTP APIs.
    ImportApi -> Maybe Text
basepath :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to rollback the API creation when a warning is
    -- encountered. By default, API creation continues if a warning is
    -- encountered.
    ImportApi -> Maybe Bool
failOnWarnings :: Prelude.Maybe Prelude.Bool,
    -- | The OpenAPI definition. Supported only for HTTP APIs.
    ImportApi -> Text
body :: Prelude.Text
  }
  deriving (ImportApi -> ImportApi -> Bool
(ImportApi -> ImportApi -> Bool)
-> (ImportApi -> ImportApi -> Bool) -> Eq ImportApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportApi -> ImportApi -> Bool
$c/= :: ImportApi -> ImportApi -> Bool
== :: ImportApi -> ImportApi -> Bool
$c== :: ImportApi -> ImportApi -> Bool
Prelude.Eq, ReadPrec [ImportApi]
ReadPrec ImportApi
Int -> ReadS ImportApi
ReadS [ImportApi]
(Int -> ReadS ImportApi)
-> ReadS [ImportApi]
-> ReadPrec ImportApi
-> ReadPrec [ImportApi]
-> Read ImportApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportApi]
$creadListPrec :: ReadPrec [ImportApi]
readPrec :: ReadPrec ImportApi
$creadPrec :: ReadPrec ImportApi
readList :: ReadS [ImportApi]
$creadList :: ReadS [ImportApi]
readsPrec :: Int -> ReadS ImportApi
$creadsPrec :: Int -> ReadS ImportApi
Prelude.Read, Int -> ImportApi -> ShowS
[ImportApi] -> ShowS
ImportApi -> String
(Int -> ImportApi -> ShowS)
-> (ImportApi -> String)
-> ([ImportApi] -> ShowS)
-> Show ImportApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportApi] -> ShowS
$cshowList :: [ImportApi] -> ShowS
show :: ImportApi -> String
$cshow :: ImportApi -> String
showsPrec :: Int -> ImportApi -> ShowS
$cshowsPrec :: Int -> ImportApi -> ShowS
Prelude.Show, (forall x. ImportApi -> Rep ImportApi x)
-> (forall x. Rep ImportApi x -> ImportApi) -> Generic ImportApi
forall x. Rep ImportApi x -> ImportApi
forall x. ImportApi -> Rep ImportApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportApi x -> ImportApi
$cfrom :: forall x. ImportApi -> Rep ImportApi x
Prelude.Generic)

-- |
-- Create a value of 'ImportApi' 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:
--
-- 'basepath', 'importApi_basepath' - Specifies how to interpret the base path of the API during import. Valid
-- values are ignore, prepend, and split. The default value is ignore. To
-- learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html Set the OpenAPI basePath Property>.
-- Supported only for HTTP APIs.
--
-- 'failOnWarnings', 'importApi_failOnWarnings' - Specifies whether to rollback the API creation when a warning is
-- encountered. By default, API creation continues if a warning is
-- encountered.
--
-- 'body', 'importApi_body' - The OpenAPI definition. Supported only for HTTP APIs.
newImportApi ::
  -- | 'body'
  Prelude.Text ->
  ImportApi
newImportApi :: Text -> ImportApi
newImportApi Text
pBody_ =
  ImportApi' :: Maybe Text -> Maybe Bool -> Text -> ImportApi
ImportApi'
    { $sel:basepath:ImportApi' :: Maybe Text
basepath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failOnWarnings:ImportApi' :: Maybe Bool
failOnWarnings = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:body:ImportApi' :: Text
body = Text
pBody_
    }

-- | Specifies how to interpret the base path of the API during import. Valid
-- values are ignore, prepend, and split. The default value is ignore. To
-- learn more, see
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api-basePath.html Set the OpenAPI basePath Property>.
-- Supported only for HTTP APIs.
importApi_basepath :: Lens.Lens' ImportApi (Prelude.Maybe Prelude.Text)
importApi_basepath :: (Maybe Text -> f (Maybe Text)) -> ImportApi -> f ImportApi
importApi_basepath = (ImportApi -> Maybe Text)
-> (ImportApi -> Maybe Text -> ImportApi)
-> Lens ImportApi ImportApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApi' {Maybe Text
basepath :: Maybe Text
$sel:basepath:ImportApi' :: ImportApi -> Maybe Text
basepath} -> Maybe Text
basepath) (\s :: ImportApi
s@ImportApi' {} Maybe Text
a -> ImportApi
s {$sel:basepath:ImportApi' :: Maybe Text
basepath = Maybe Text
a} :: ImportApi)

-- | Specifies whether to rollback the API creation when a warning is
-- encountered. By default, API creation continues if a warning is
-- encountered.
importApi_failOnWarnings :: Lens.Lens' ImportApi (Prelude.Maybe Prelude.Bool)
importApi_failOnWarnings :: (Maybe Bool -> f (Maybe Bool)) -> ImportApi -> f ImportApi
importApi_failOnWarnings = (ImportApi -> Maybe Bool)
-> (ImportApi -> Maybe Bool -> ImportApi)
-> Lens ImportApi ImportApi (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApi' {Maybe Bool
failOnWarnings :: Maybe Bool
$sel:failOnWarnings:ImportApi' :: ImportApi -> Maybe Bool
failOnWarnings} -> Maybe Bool
failOnWarnings) (\s :: ImportApi
s@ImportApi' {} Maybe Bool
a -> ImportApi
s {$sel:failOnWarnings:ImportApi' :: Maybe Bool
failOnWarnings = Maybe Bool
a} :: ImportApi)

-- | The OpenAPI definition. Supported only for HTTP APIs.
importApi_body :: Lens.Lens' ImportApi Prelude.Text
importApi_body :: (Text -> f Text) -> ImportApi -> f ImportApi
importApi_body = (ImportApi -> Text)
-> (ImportApi -> Text -> ImportApi)
-> Lens ImportApi ImportApi Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApi' {Text
body :: Text
$sel:body:ImportApi' :: ImportApi -> Text
body} -> Text
body) (\s :: ImportApi
s@ImportApi' {} Text
a -> ImportApi
s {$sel:body:ImportApi' :: Text
body = Text
a} :: ImportApi)

instance Core.AWSRequest ImportApi where
  type AWSResponse ImportApi = ImportApiResponse
  request :: ImportApi -> Request ImportApi
request = Service -> ImportApi -> Request ImportApi
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ImportApi)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ImportApi))
-> Logger
-> Service
-> Proxy ImportApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ImportApi)))
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
-> ImportApiResponse
ImportApiResponse'
            (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
 -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> 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
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Cors
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe Cors)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe ProtocolType
      -> Maybe (HashMap Text Text)
      -> Int
      -> ImportApiResponse)
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
   -> ImportApiResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ProtocolType
      -> Maybe (HashMap Text Text) -> Int -> ImportApiResponse)
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 -> ImportApiResponse)
-> Either String (Maybe ProtocolType)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> ImportApiResponse)
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 -> ImportApiResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> ImportApiResponse)
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 -> ImportApiResponse)
-> Either String Int -> Either String ImportApiResponse
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 ImportApi

instance Prelude.NFData ImportApi

instance Core.ToHeaders ImportApi where
  toHeaders :: ImportApi -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportApi -> 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 ImportApi where
  toJSON :: ImportApi -> Value
toJSON ImportApi' {Maybe Bool
Maybe Text
Text
body :: Text
failOnWarnings :: Maybe Bool
basepath :: Maybe Text
$sel:body:ImportApi' :: ImportApi -> Text
$sel:failOnWarnings:ImportApi' :: ImportApi -> Maybe Bool
$sel:basepath:ImportApi' :: ImportApi -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"body" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
body)]
      )

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

instance Core.ToQuery ImportApi where
  toQuery :: ImportApi -> QueryString
toQuery ImportApi' {Maybe Bool
Maybe Text
Text
body :: Text
failOnWarnings :: Maybe Bool
basepath :: Maybe Text
$sel:body:ImportApi' :: ImportApi -> Text
$sel:failOnWarnings:ImportApi' :: ImportApi -> Maybe Bool
$sel:basepath:ImportApi' :: ImportApi -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"basepath" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
basepath,
        ByteString
"failOnWarnings" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
failOnWarnings
      ]

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

-- |
-- Create a value of 'ImportApiResponse' 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', 'importApiResponse_apiId' - The API ID.
--
-- 'disableExecuteApiEndpoint', 'importApiResponse_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', 'importApiResponse_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', 'importApiResponse_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'createdDate', 'importApiResponse_createdDate' - The timestamp when the API was created.
--
-- 'name', 'importApiResponse_name' - The name of the API.
--
-- 'version', 'importApiResponse_version' - A version identifier for the API.
--
-- 'apiGatewayManaged', 'importApiResponse_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', 'importApiResponse_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', 'importApiResponse_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'routeSelectionExpression', 'importApiResponse_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', 'importApiResponse_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', 'importApiResponse_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'importApiResponse_description' - The description of the API.
--
-- 'protocolType', 'importApiResponse_protocolType' - The API protocol.
--
-- 'tags', 'importApiResponse_tags' - A collection of tags associated with the API.
--
-- 'httpStatus', 'importApiResponse_httpStatus' - The response's http status code.
newImportApiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ImportApiResponse
newImportApiResponse :: Int -> ImportApiResponse
newImportApiResponse Int
pHttpStatus_ =
  ImportApiResponse' :: 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
-> ImportApiResponse
ImportApiResponse'
    { $sel:apiId:ImportApiResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:ImportApiResponse' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiEndpoint:ImportApiResponse' :: Maybe Text
apiEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:ImportApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:ImportApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ImportApiResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:ImportApiResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:ImportApiResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:ImportApiResponse' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:ImportApiResponse' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:ImportApiResponse' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importInfo:ImportApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:ImportApiResponse' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ImportApiResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:ImportApiResponse' :: Maybe ProtocolType
protocolType = Maybe ProtocolType
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ImportApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ImportApiResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

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

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

-- | 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.
importApiResponse_importInfo :: Lens.Lens' ImportApiResponse (Prelude.Maybe [Prelude.Text])
importApiResponse_importInfo :: (Maybe [Text] -> f (Maybe [Text]))
-> ImportApiResponse -> f ImportApiResponse
importApiResponse_importInfo = (ImportApiResponse -> Maybe [Text])
-> (ImportApiResponse -> Maybe [Text] -> ImportApiResponse)
-> Lens
     ImportApiResponse ImportApiResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApiResponse' {Maybe [Text]
importInfo :: Maybe [Text]
$sel:importInfo:ImportApiResponse' :: ImportApiResponse -> Maybe [Text]
importInfo} -> Maybe [Text]
importInfo) (\s :: ImportApiResponse
s@ImportApiResponse' {} Maybe [Text]
a -> ImportApiResponse
s {$sel:importInfo:ImportApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
a} :: ImportApiResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ImportApiResponse -> f ImportApiResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ImportApiResponse
-> f ImportApiResponse
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.
importApiResponse_disableSchemaValidation :: Lens.Lens' ImportApiResponse (Prelude.Maybe Prelude.Bool)
importApiResponse_disableSchemaValidation :: (Maybe Bool -> f (Maybe Bool))
-> ImportApiResponse -> f ImportApiResponse
importApiResponse_disableSchemaValidation = (ImportApiResponse -> Maybe Bool)
-> (ImportApiResponse -> Maybe Bool -> ImportApiResponse)
-> Lens
     ImportApiResponse ImportApiResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApiResponse' {Maybe Bool
disableSchemaValidation :: Maybe Bool
$sel:disableSchemaValidation:ImportApiResponse' :: ImportApiResponse -> Maybe Bool
disableSchemaValidation} -> Maybe Bool
disableSchemaValidation) (\s :: ImportApiResponse
s@ImportApiResponse' {} Maybe Bool
a -> ImportApiResponse
s {$sel:disableSchemaValidation:ImportApiResponse' :: Maybe Bool
disableSchemaValidation = Maybe Bool
a} :: ImportApiResponse)

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

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

-- | A collection of tags associated with the API.
importApiResponse_tags :: Lens.Lens' ImportApiResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
importApiResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ImportApiResponse -> f ImportApiResponse
importApiResponse_tags = (ImportApiResponse -> Maybe (HashMap Text Text))
-> (ImportApiResponse
    -> Maybe (HashMap Text Text) -> ImportApiResponse)
-> Lens
     ImportApiResponse
     ImportApiResponse
     (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 (\ImportApiResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ImportApiResponse' :: ImportApiResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ImportApiResponse
s@ImportApiResponse' {} Maybe (HashMap Text Text)
a -> ImportApiResponse
s {$sel:tags:ImportApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ImportApiResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ImportApiResponse -> f ImportApiResponse)
-> ((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)))
-> ImportApiResponse
-> f ImportApiResponse
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.
importApiResponse_httpStatus :: Lens.Lens' ImportApiResponse Prelude.Int
importApiResponse_httpStatus :: (Int -> f Int) -> ImportApiResponse -> f ImportApiResponse
importApiResponse_httpStatus = (ImportApiResponse -> Int)
-> (ImportApiResponse -> Int -> ImportApiResponse)
-> Lens ImportApiResponse ImportApiResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportApiResponse' {Int
httpStatus :: Int
$sel:httpStatus:ImportApiResponse' :: ImportApiResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ImportApiResponse
s@ImportApiResponse' {} Int
a -> ImportApiResponse
s {$sel:httpStatus:ImportApiResponse' :: Int
httpStatus = Int
a} :: ImportApiResponse)

instance Prelude.NFData ImportApiResponse