{-# 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.ReimportApi
-- 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)
--
-- Puts an Api resource.
module Amazonka.ApiGatewayV2.ReimportApi
  ( -- * Creating a Request
    ReimportApi (..),
    newReimportApi,

    -- * Request Lenses
    reimportApi_basepath,
    reimportApi_failOnWarnings,
    reimportApi_apiId,
    reimportApi_body,

    -- * Destructuring the Response
    ReimportApiResponse (..),
    newReimportApiResponse,

    -- * Response Lenses
    reimportApiResponse_apiId,
    reimportApiResponse_disableExecuteApiEndpoint,
    reimportApiResponse_apiEndpoint,
    reimportApiResponse_warnings,
    reimportApiResponse_createdDate,
    reimportApiResponse_name,
    reimportApiResponse_version,
    reimportApiResponse_apiGatewayManaged,
    reimportApiResponse_apiKeySelectionExpression,
    reimportApiResponse_corsConfiguration,
    reimportApiResponse_routeSelectionExpression,
    reimportApiResponse_importInfo,
    reimportApiResponse_disableSchemaValidation,
    reimportApiResponse_description,
    reimportApiResponse_protocolType,
    reimportApiResponse_tags,
    reimportApiResponse_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:/ 'newReimportApi' smart constructor.
data ReimportApi = ReimportApi'
  { -- | 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.
    ReimportApi -> 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.
    ReimportApi -> Maybe Bool
failOnWarnings :: Prelude.Maybe Prelude.Bool,
    -- | The API identifier.
    ReimportApi -> Text
apiId :: Prelude.Text,
    -- | The OpenAPI definition. Supported only for HTTP APIs.
    ReimportApi -> Text
body :: Prelude.Text
  }
  deriving (ReimportApi -> ReimportApi -> Bool
(ReimportApi -> ReimportApi -> Bool)
-> (ReimportApi -> ReimportApi -> Bool) -> Eq ReimportApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReimportApi -> ReimportApi -> Bool
$c/= :: ReimportApi -> ReimportApi -> Bool
== :: ReimportApi -> ReimportApi -> Bool
$c== :: ReimportApi -> ReimportApi -> Bool
Prelude.Eq, ReadPrec [ReimportApi]
ReadPrec ReimportApi
Int -> ReadS ReimportApi
ReadS [ReimportApi]
(Int -> ReadS ReimportApi)
-> ReadS [ReimportApi]
-> ReadPrec ReimportApi
-> ReadPrec [ReimportApi]
-> Read ReimportApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReimportApi]
$creadListPrec :: ReadPrec [ReimportApi]
readPrec :: ReadPrec ReimportApi
$creadPrec :: ReadPrec ReimportApi
readList :: ReadS [ReimportApi]
$creadList :: ReadS [ReimportApi]
readsPrec :: Int -> ReadS ReimportApi
$creadsPrec :: Int -> ReadS ReimportApi
Prelude.Read, Int -> ReimportApi -> ShowS
[ReimportApi] -> ShowS
ReimportApi -> String
(Int -> ReimportApi -> ShowS)
-> (ReimportApi -> String)
-> ([ReimportApi] -> ShowS)
-> Show ReimportApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReimportApi] -> ShowS
$cshowList :: [ReimportApi] -> ShowS
show :: ReimportApi -> String
$cshow :: ReimportApi -> String
showsPrec :: Int -> ReimportApi -> ShowS
$cshowsPrec :: Int -> ReimportApi -> ShowS
Prelude.Show, (forall x. ReimportApi -> Rep ReimportApi x)
-> (forall x. Rep ReimportApi x -> ReimportApi)
-> Generic ReimportApi
forall x. Rep ReimportApi x -> ReimportApi
forall x. ReimportApi -> Rep ReimportApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReimportApi x -> ReimportApi
$cfrom :: forall x. ReimportApi -> Rep ReimportApi x
Prelude.Generic)

-- |
-- Create a value of 'ReimportApi' 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', 'reimportApi_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', 'reimportApi_failOnWarnings' - Specifies whether to rollback the API creation when a warning is
-- encountered. By default, API creation continues if a warning is
-- encountered.
--
-- 'apiId', 'reimportApi_apiId' - The API identifier.
--
-- 'body', 'reimportApi_body' - The OpenAPI definition. Supported only for HTTP APIs.
newReimportApi ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'body'
  Prelude.Text ->
  ReimportApi
newReimportApi :: Text -> Text -> ReimportApi
newReimportApi Text
pApiId_ Text
pBody_ =
  ReimportApi' :: Maybe Text -> Maybe Bool -> Text -> Text -> ReimportApi
ReimportApi'
    { $sel:basepath:ReimportApi' :: Maybe Text
basepath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failOnWarnings:ReimportApi' :: Maybe Bool
failOnWarnings = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:ReimportApi' :: Text
apiId = Text
pApiId_,
      $sel:body:ReimportApi' :: 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.
reimportApi_basepath :: Lens.Lens' ReimportApi (Prelude.Maybe Prelude.Text)
reimportApi_basepath :: (Maybe Text -> f (Maybe Text)) -> ReimportApi -> f ReimportApi
reimportApi_basepath = (ReimportApi -> Maybe Text)
-> (ReimportApi -> Maybe Text -> ReimportApi)
-> Lens ReimportApi ReimportApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReimportApi' {Maybe Text
basepath :: Maybe Text
$sel:basepath:ReimportApi' :: ReimportApi -> Maybe Text
basepath} -> Maybe Text
basepath) (\s :: ReimportApi
s@ReimportApi' {} Maybe Text
a -> ReimportApi
s {$sel:basepath:ReimportApi' :: Maybe Text
basepath = Maybe Text
a} :: ReimportApi)

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

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

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

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

instance Prelude.NFData ReimportApi

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

-- |
-- Create a value of 'ReimportApiResponse' 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', 'reimportApiResponse_apiId' - The API ID.
--
-- 'disableExecuteApiEndpoint', 'reimportApiResponse_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', 'reimportApiResponse_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', 'reimportApiResponse_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'createdDate', 'reimportApiResponse_createdDate' - The timestamp when the API was created.
--
-- 'name', 'reimportApiResponse_name' - The name of the API.
--
-- 'version', 'reimportApiResponse_version' - A version identifier for the API.
--
-- 'apiGatewayManaged', 'reimportApiResponse_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', 'reimportApiResponse_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', 'reimportApiResponse_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'routeSelectionExpression', 'reimportApiResponse_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', 'reimportApiResponse_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', 'reimportApiResponse_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'reimportApiResponse_description' - The description of the API.
--
-- 'protocolType', 'reimportApiResponse_protocolType' - The API protocol.
--
-- 'tags', 'reimportApiResponse_tags' - A collection of tags associated with the API.
--
-- 'httpStatus', 'reimportApiResponse_httpStatus' - The response's http status code.
newReimportApiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ReimportApiResponse
newReimportApiResponse :: Int -> ReimportApiResponse
newReimportApiResponse Int
pHttpStatus_ =
  ReimportApiResponse' :: 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
-> ReimportApiResponse
ReimportApiResponse'
    { $sel:apiId:ReimportApiResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:ReimportApiResponse' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiEndpoint:ReimportApiResponse' :: Maybe Text
apiEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:ReimportApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:ReimportApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ReimportApiResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:ReimportApiResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:ReimportApiResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:ReimportApiResponse' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:ReimportApiResponse' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:ReimportApiResponse' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importInfo:ReimportApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:ReimportApiResponse' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ReimportApiResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:ReimportApiResponse' :: Maybe ProtocolType
protocolType = Maybe ProtocolType
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ReimportApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ReimportApiResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

instance Prelude.NFData ReimportApiResponse