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

    -- * Request Lenses
    updateApi_credentialsArn,
    updateApi_disableExecuteApiEndpoint,
    updateApi_name,
    updateApi_version,
    updateApi_apiKeySelectionExpression,
    updateApi_corsConfiguration,
    updateApi_routeSelectionExpression,
    updateApi_disableSchemaValidation,
    updateApi_description,
    updateApi_routeKey,
    updateApi_target,
    updateApi_apiId,

    -- * Destructuring the Response
    UpdateApiResponse (..),
    newUpdateApiResponse,

    -- * Response Lenses
    updateApiResponse_apiId,
    updateApiResponse_disableExecuteApiEndpoint,
    updateApiResponse_apiEndpoint,
    updateApiResponse_warnings,
    updateApiResponse_createdDate,
    updateApiResponse_name,
    updateApiResponse_version,
    updateApiResponse_apiGatewayManaged,
    updateApiResponse_apiKeySelectionExpression,
    updateApiResponse_corsConfiguration,
    updateApiResponse_routeSelectionExpression,
    updateApiResponse_importInfo,
    updateApiResponse_disableSchemaValidation,
    updateApiResponse_description,
    updateApiResponse_protocolType,
    updateApiResponse_tags,
    updateApiResponse_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

-- | Updates an Api.
--
-- /See:/ 'newUpdateApi' smart constructor.
data UpdateApi = UpdateApi'
  { -- | This property is part of quick create. It specifies the credentials
    -- required for the integration, if any. For a Lambda integration, three
    -- options are available. To specify an IAM Role for API Gateway to assume,
    -- use the role\'s Amazon Resource Name (ARN). To require that the
    -- caller\'s identity be passed through from the request, specify
    -- arn:aws:iam::*:user\/*. To use resource-based permissions on supported
    -- AWS services, don\'t specify this parameter. Currently, this property is
    -- not used for HTTP integrations. If provided, this value replaces the
    -- credentials associated with the quick create integration. Supported only
    -- for HTTP APIs.
    UpdateApi -> Maybe Text
credentialsArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether clients can invoke your API by using the default
    -- execute-api endpoint. By default, clients can invoke your API with the
    -- default https:\/\/{api_id}.execute-api.{region}.amazonaws.com endpoint.
    -- To require that clients use a custom domain name to invoke your API,
    -- disable the default endpoint.
    UpdateApi -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | The name of the API.
    UpdateApi -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A version identifier for the API.
    UpdateApi -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | An API key selection expression. Supported only for WebSocket APIs. See
    -- <https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions API Key Selection Expressions>.
    UpdateApi -> Maybe Text
apiKeySelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A CORS configuration. Supported only for HTTP APIs.
    UpdateApi -> 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.
    UpdateApi -> Maybe Text
routeSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | Avoid validating models when creating a deployment. Supported only for
    -- WebSocket APIs.
    UpdateApi -> Maybe Bool
disableSchemaValidation :: Prelude.Maybe Prelude.Bool,
    -- | The description of the API.
    UpdateApi -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | This property is part of quick create. If not specified, the route
    -- created using quick create is kept. Otherwise, this value replaces the
    -- route key of the quick create route. Additional routes may still be
    -- added after the API is updated. Supported only for HTTP APIs.
    UpdateApi -> Maybe Text
routeKey :: Prelude.Maybe Prelude.Text,
    -- | This property is part of quick create. For HTTP integrations, specify a
    -- fully qualified URL. For Lambda integrations, specify a function ARN.
    -- The type of the integration will be HTTP_PROXY or AWS_PROXY,
    -- respectively. The value provided updates the integration URI and
    -- integration type. You can update a quick-created target, but you can\'t
    -- remove it from an API. Supported only for HTTP APIs.
    UpdateApi -> Maybe Text
target :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    UpdateApi -> Text
apiId :: Prelude.Text
  }
  deriving (UpdateApi -> UpdateApi -> Bool
(UpdateApi -> UpdateApi -> Bool)
-> (UpdateApi -> UpdateApi -> Bool) -> Eq UpdateApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApi -> UpdateApi -> Bool
$c/= :: UpdateApi -> UpdateApi -> Bool
== :: UpdateApi -> UpdateApi -> Bool
$c== :: UpdateApi -> UpdateApi -> Bool
Prelude.Eq, ReadPrec [UpdateApi]
ReadPrec UpdateApi
Int -> ReadS UpdateApi
ReadS [UpdateApi]
(Int -> ReadS UpdateApi)
-> ReadS [UpdateApi]
-> ReadPrec UpdateApi
-> ReadPrec [UpdateApi]
-> Read UpdateApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApi]
$creadListPrec :: ReadPrec [UpdateApi]
readPrec :: ReadPrec UpdateApi
$creadPrec :: ReadPrec UpdateApi
readList :: ReadS [UpdateApi]
$creadList :: ReadS [UpdateApi]
readsPrec :: Int -> ReadS UpdateApi
$creadsPrec :: Int -> ReadS UpdateApi
Prelude.Read, Int -> UpdateApi -> ShowS
[UpdateApi] -> ShowS
UpdateApi -> String
(Int -> UpdateApi -> ShowS)
-> (UpdateApi -> String)
-> ([UpdateApi] -> ShowS)
-> Show UpdateApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApi] -> ShowS
$cshowList :: [UpdateApi] -> ShowS
show :: UpdateApi -> String
$cshow :: UpdateApi -> String
showsPrec :: Int -> UpdateApi -> ShowS
$cshowsPrec :: Int -> UpdateApi -> ShowS
Prelude.Show, (forall x. UpdateApi -> Rep UpdateApi x)
-> (forall x. Rep UpdateApi x -> UpdateApi) -> Generic UpdateApi
forall x. Rep UpdateApi x -> UpdateApi
forall x. UpdateApi -> Rep UpdateApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApi x -> UpdateApi
$cfrom :: forall x. UpdateApi -> Rep UpdateApi x
Prelude.Generic)

-- |
-- Create a value of 'UpdateApi' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'credentialsArn', 'updateApi_credentialsArn' - This property is part of quick create. It specifies the credentials
-- required for the integration, if any. For a Lambda integration, three
-- options are available. To specify an IAM Role for API Gateway to assume,
-- use the role\'s Amazon Resource Name (ARN). To require that the
-- caller\'s identity be passed through from the request, specify
-- arn:aws:iam::*:user\/*. To use resource-based permissions on supported
-- AWS services, don\'t specify this parameter. Currently, this property is
-- not used for HTTP integrations. If provided, this value replaces the
-- credentials associated with the quick create integration. Supported only
-- for HTTP APIs.
--
-- 'disableExecuteApiEndpoint', 'updateApi_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.
--
-- 'name', 'updateApi_name' - The name of the API.
--
-- 'version', 'updateApi_version' - A version identifier for the API.
--
-- 'apiKeySelectionExpression', 'updateApi_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', 'updateApi_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'routeSelectionExpression', 'updateApi_routeSelectionExpression' - The route selection expression for the API. For HTTP APIs, the
-- routeSelectionExpression must be ${request.method} ${request.path}. If
-- not provided, this will be the default for HTTP APIs. This property is
-- required for WebSocket APIs.
--
-- 'disableSchemaValidation', 'updateApi_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'updateApi_description' - The description of the API.
--
-- 'routeKey', 'updateApi_routeKey' - This property is part of quick create. If not specified, the route
-- created using quick create is kept. Otherwise, this value replaces the
-- route key of the quick create route. Additional routes may still be
-- added after the API is updated. Supported only for HTTP APIs.
--
-- 'target', 'updateApi_target' - This property is part of quick create. For HTTP integrations, specify a
-- fully qualified URL. For Lambda integrations, specify a function ARN.
-- The type of the integration will be HTTP_PROXY or AWS_PROXY,
-- respectively. The value provided updates the integration URI and
-- integration type. You can update a quick-created target, but you can\'t
-- remove it from an API. Supported only for HTTP APIs.
--
-- 'apiId', 'updateApi_apiId' - The API identifier.
newUpdateApi ::
  -- | 'apiId'
  Prelude.Text ->
  UpdateApi
newUpdateApi :: Text -> UpdateApi
newUpdateApi Text
pApiId_ =
  UpdateApi' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Cors
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateApi
UpdateApi'
    { $sel:credentialsArn:UpdateApi' :: Maybe Text
credentialsArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:UpdateApi' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApi' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:UpdateApi' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:UpdateApi' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:UpdateApi' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:UpdateApi' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:UpdateApi' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApi' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routeKey:UpdateApi' :: Maybe Text
routeKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:target:UpdateApi' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:UpdateApi' :: Text
apiId = Text
pApiId_
    }

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

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

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

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

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

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

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

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

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

-- | This property is part of quick create. If not specified, the route
-- created using quick create is kept. Otherwise, this value replaces the
-- route key of the quick create route. Additional routes may still be
-- added after the API is updated. Supported only for HTTP APIs.
updateApi_routeKey :: Lens.Lens' UpdateApi (Prelude.Maybe Prelude.Text)
updateApi_routeKey :: (Maybe Text -> f (Maybe Text)) -> UpdateApi -> f UpdateApi
updateApi_routeKey = (UpdateApi -> Maybe Text)
-> (UpdateApi -> Maybe Text -> UpdateApi)
-> Lens UpdateApi UpdateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApi' {Maybe Text
routeKey :: Maybe Text
$sel:routeKey:UpdateApi' :: UpdateApi -> Maybe Text
routeKey} -> Maybe Text
routeKey) (\s :: UpdateApi
s@UpdateApi' {} Maybe Text
a -> UpdateApi
s {$sel:routeKey:UpdateApi' :: Maybe Text
routeKey = Maybe Text
a} :: UpdateApi)

-- | This property is part of quick create. For HTTP integrations, specify a
-- fully qualified URL. For Lambda integrations, specify a function ARN.
-- The type of the integration will be HTTP_PROXY or AWS_PROXY,
-- respectively. The value provided updates the integration URI and
-- integration type. You can update a quick-created target, but you can\'t
-- remove it from an API. Supported only for HTTP APIs.
updateApi_target :: Lens.Lens' UpdateApi (Prelude.Maybe Prelude.Text)
updateApi_target :: (Maybe Text -> f (Maybe Text)) -> UpdateApi -> f UpdateApi
updateApi_target = (UpdateApi -> Maybe Text)
-> (UpdateApi -> Maybe Text -> UpdateApi)
-> Lens UpdateApi UpdateApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApi' {Maybe Text
target :: Maybe Text
$sel:target:UpdateApi' :: UpdateApi -> Maybe Text
target} -> Maybe Text
target) (\s :: UpdateApi
s@UpdateApi' {} Maybe Text
a -> UpdateApi
s {$sel:target:UpdateApi' :: Maybe Text
target = Maybe Text
a} :: UpdateApi)

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

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

instance Prelude.NFData UpdateApi

instance Core.ToHeaders UpdateApi where
  toHeaders :: UpdateApi -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateApi -> 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 UpdateApi where
  toJSON :: UpdateApi -> Value
toJSON UpdateApi' {Maybe Bool
Maybe Text
Maybe Cors
Text
apiId :: Text
target :: Maybe Text
routeKey :: Maybe Text
description :: Maybe Text
disableSchemaValidation :: Maybe Bool
routeSelectionExpression :: Maybe Text
corsConfiguration :: Maybe Cors
apiKeySelectionExpression :: Maybe Text
version :: Maybe Text
name :: Maybe Text
disableExecuteApiEndpoint :: Maybe Bool
credentialsArn :: Maybe Text
$sel:apiId:UpdateApi' :: UpdateApi -> Text
$sel:target:UpdateApi' :: UpdateApi -> Maybe Text
$sel:routeKey:UpdateApi' :: UpdateApi -> Maybe Text
$sel:description:UpdateApi' :: UpdateApi -> Maybe Text
$sel:disableSchemaValidation:UpdateApi' :: UpdateApi -> Maybe Bool
$sel:routeSelectionExpression:UpdateApi' :: UpdateApi -> Maybe Text
$sel:corsConfiguration:UpdateApi' :: UpdateApi -> Maybe Cors
$sel:apiKeySelectionExpression:UpdateApi' :: UpdateApi -> Maybe Text
$sel:version:UpdateApi' :: UpdateApi -> Maybe Text
$sel:name:UpdateApi' :: UpdateApi -> Maybe Text
$sel:disableExecuteApiEndpoint:UpdateApi' :: UpdateApi -> Maybe Bool
$sel:credentialsArn:UpdateApi' :: UpdateApi -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"credentialsArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
credentialsArn,
            (Text
"disableExecuteApiEndpoint" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableExecuteApiEndpoint,
            (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version,
            (Text
"apiKeySelectionExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiKeySelectionExpression,
            (Text
"corsConfiguration" Text -> Cors -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Cors -> Pair) -> Maybe Cors -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Cors
corsConfiguration,
            (Text
"routeSelectionExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
routeSelectionExpression,
            (Text
"disableSchemaValidation" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableSchemaValidation,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"routeKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
routeKey,
            (Text
"target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
target
          ]
      )

instance Core.ToPath UpdateApi where
  toPath :: UpdateApi -> ByteString
toPath UpdateApi' {Maybe Bool
Maybe Text
Maybe Cors
Text
apiId :: Text
target :: Maybe Text
routeKey :: Maybe Text
description :: Maybe Text
disableSchemaValidation :: Maybe Bool
routeSelectionExpression :: Maybe Text
corsConfiguration :: Maybe Cors
apiKeySelectionExpression :: Maybe Text
version :: Maybe Text
name :: Maybe Text
disableExecuteApiEndpoint :: Maybe Bool
credentialsArn :: Maybe Text
$sel:apiId:UpdateApi' :: UpdateApi -> Text
$sel:target:UpdateApi' :: UpdateApi -> Maybe Text
$sel:routeKey:UpdateApi' :: UpdateApi -> Maybe Text
$sel:description:UpdateApi' :: UpdateApi -> Maybe Text
$sel:disableSchemaValidation:UpdateApi' :: UpdateApi -> Maybe Bool
$sel:routeSelectionExpression:UpdateApi' :: UpdateApi -> Maybe Text
$sel:corsConfiguration:UpdateApi' :: UpdateApi -> Maybe Cors
$sel:apiKeySelectionExpression:UpdateApi' :: UpdateApi -> Maybe Text
$sel:version:UpdateApi' :: UpdateApi -> Maybe Text
$sel:name:UpdateApi' :: UpdateApi -> Maybe Text
$sel:disableExecuteApiEndpoint:UpdateApi' :: UpdateApi -> Maybe Bool
$sel:credentialsArn:UpdateApi' :: UpdateApi -> 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 UpdateApi where
  toQuery :: UpdateApi -> QueryString
toQuery = QueryString -> UpdateApi -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'UpdateApiResponse' 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', 'updateApiResponse_apiId' - The API ID.
--
-- 'disableExecuteApiEndpoint', 'updateApiResponse_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', 'updateApiResponse_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', 'updateApiResponse_warnings' - The warning messages reported when failonwarnings is turned on during
-- API import.
--
-- 'createdDate', 'updateApiResponse_createdDate' - The timestamp when the API was created.
--
-- 'name', 'updateApiResponse_name' - The name of the API.
--
-- 'version', 'updateApiResponse_version' - A version identifier for the API.
--
-- 'apiGatewayManaged', 'updateApiResponse_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', 'updateApiResponse_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', 'updateApiResponse_corsConfiguration' - A CORS configuration. Supported only for HTTP APIs.
--
-- 'routeSelectionExpression', 'updateApiResponse_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', 'updateApiResponse_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', 'updateApiResponse_disableSchemaValidation' - Avoid validating models when creating a deployment. Supported only for
-- WebSocket APIs.
--
-- 'description', 'updateApiResponse_description' - The description of the API.
--
-- 'protocolType', 'updateApiResponse_protocolType' - The API protocol.
--
-- 'tags', 'updateApiResponse_tags' - A collection of tags associated with the API.
--
-- 'httpStatus', 'updateApiResponse_httpStatus' - The response's http status code.
newUpdateApiResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateApiResponse
newUpdateApiResponse :: Int -> UpdateApiResponse
newUpdateApiResponse Int
pHttpStatus_ =
  UpdateApiResponse' :: 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
-> UpdateApiResponse
UpdateApiResponse'
    { $sel:apiId:UpdateApiResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:UpdateApiResponse' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiEndpoint:UpdateApiResponse' :: Maybe Text
apiEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:UpdateApiResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:UpdateApiResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApiResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:UpdateApiResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiGatewayManaged:UpdateApiResponse' :: Maybe Bool
apiGatewayManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:UpdateApiResponse' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:UpdateApiResponse' :: Maybe Cors
corsConfiguration = Maybe Cors
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:UpdateApiResponse' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:importInfo:UpdateApiResponse' :: Maybe [Text]
importInfo = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:disableSchemaValidation:UpdateApiResponse' :: Maybe Bool
disableSchemaValidation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApiResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:UpdateApiResponse' :: Maybe ProtocolType
protocolType = Maybe ProtocolType
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:UpdateApiResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateApiResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

instance Prelude.NFData UpdateApiResponse