{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityHub.Types.AwsApiGatewayV2ApiDetails
-- 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)
module Amazonka.SecurityHub.Types.AwsApiGatewayV2ApiDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsCorsConfiguration

-- | Contains information about a version 2 API in Amazon API Gateway.
--
-- /See:/ 'newAwsApiGatewayV2ApiDetails' smart constructor.
data AwsApiGatewayV2ApiDetails = AwsApiGatewayV2ApiDetails'
  { -- | The identifier of the API.
    AwsApiGatewayV2ApiDetails -> Maybe Text
apiId :: Prelude.Maybe Prelude.Text,
    -- | The URI of the API.
    --
    -- Uses the format @ \<api-id>.execute-api.\<region>.amazonaws.com@
    --
    -- The stage name is typically appended to the URI to form a complete path
    -- to a deployed API stage.
    AwsApiGatewayV2ApiDetails -> Maybe Text
apiEndpoint :: Prelude.Maybe Prelude.Text,
    -- | Indicates when the API was created.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsApiGatewayV2ApiDetails -> Maybe Text
createdDate :: Prelude.Maybe Prelude.Text,
    -- | The name of the API.
    AwsApiGatewayV2ApiDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version identifier for the API.
    AwsApiGatewayV2ApiDetails -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | An API key selection expression. Supported only for WebSocket APIs.
    AwsApiGatewayV2ApiDetails -> Maybe Text
apiKeySelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A cross-origin resource sharing (CORS) configuration. Supported only for
    -- HTTP APIs.
    AwsApiGatewayV2ApiDetails -> Maybe AwsCorsConfiguration
corsConfiguration :: Prelude.Maybe AwsCorsConfiguration,
    -- | The route selection expression for the API.
    --
    -- For HTTP APIs, must be @${request.method} ${request.path}@. This is the
    -- default value for HTTP APIs.
    --
    -- For WebSocket APIs, there is no default value.
    AwsApiGatewayV2ApiDetails -> Maybe Text
routeSelectionExpression :: Prelude.Maybe Prelude.Text,
    -- | A description of the API.
    AwsApiGatewayV2ApiDetails -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The API protocol for the API.
    --
    -- Valid values: @WEBSOCKET@ | @HTTP@
    AwsApiGatewayV2ApiDetails -> Maybe Text
protocolType :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool
(AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool)
-> (AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool)
-> Eq AwsApiGatewayV2ApiDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool
$c/= :: AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool
== :: AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool
$c== :: AwsApiGatewayV2ApiDetails -> AwsApiGatewayV2ApiDetails -> Bool
Prelude.Eq, ReadPrec [AwsApiGatewayV2ApiDetails]
ReadPrec AwsApiGatewayV2ApiDetails
Int -> ReadS AwsApiGatewayV2ApiDetails
ReadS [AwsApiGatewayV2ApiDetails]
(Int -> ReadS AwsApiGatewayV2ApiDetails)
-> ReadS [AwsApiGatewayV2ApiDetails]
-> ReadPrec AwsApiGatewayV2ApiDetails
-> ReadPrec [AwsApiGatewayV2ApiDetails]
-> Read AwsApiGatewayV2ApiDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsApiGatewayV2ApiDetails]
$creadListPrec :: ReadPrec [AwsApiGatewayV2ApiDetails]
readPrec :: ReadPrec AwsApiGatewayV2ApiDetails
$creadPrec :: ReadPrec AwsApiGatewayV2ApiDetails
readList :: ReadS [AwsApiGatewayV2ApiDetails]
$creadList :: ReadS [AwsApiGatewayV2ApiDetails]
readsPrec :: Int -> ReadS AwsApiGatewayV2ApiDetails
$creadsPrec :: Int -> ReadS AwsApiGatewayV2ApiDetails
Prelude.Read, Int -> AwsApiGatewayV2ApiDetails -> ShowS
[AwsApiGatewayV2ApiDetails] -> ShowS
AwsApiGatewayV2ApiDetails -> String
(Int -> AwsApiGatewayV2ApiDetails -> ShowS)
-> (AwsApiGatewayV2ApiDetails -> String)
-> ([AwsApiGatewayV2ApiDetails] -> ShowS)
-> Show AwsApiGatewayV2ApiDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsApiGatewayV2ApiDetails] -> ShowS
$cshowList :: [AwsApiGatewayV2ApiDetails] -> ShowS
show :: AwsApiGatewayV2ApiDetails -> String
$cshow :: AwsApiGatewayV2ApiDetails -> String
showsPrec :: Int -> AwsApiGatewayV2ApiDetails -> ShowS
$cshowsPrec :: Int -> AwsApiGatewayV2ApiDetails -> ShowS
Prelude.Show, (forall x.
 AwsApiGatewayV2ApiDetails -> Rep AwsApiGatewayV2ApiDetails x)
-> (forall x.
    Rep AwsApiGatewayV2ApiDetails x -> AwsApiGatewayV2ApiDetails)
-> Generic AwsApiGatewayV2ApiDetails
forall x.
Rep AwsApiGatewayV2ApiDetails x -> AwsApiGatewayV2ApiDetails
forall x.
AwsApiGatewayV2ApiDetails -> Rep AwsApiGatewayV2ApiDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsApiGatewayV2ApiDetails x -> AwsApiGatewayV2ApiDetails
$cfrom :: forall x.
AwsApiGatewayV2ApiDetails -> Rep AwsApiGatewayV2ApiDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsApiGatewayV2ApiDetails' 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', 'awsApiGatewayV2ApiDetails_apiId' - The identifier of the API.
--
-- 'apiEndpoint', 'awsApiGatewayV2ApiDetails_apiEndpoint' - The URI of the API.
--
-- Uses the format @ \<api-id>.execute-api.\<region>.amazonaws.com@
--
-- The stage name is typically appended to the URI to form a complete path
-- to a deployed API stage.
--
-- 'createdDate', 'awsApiGatewayV2ApiDetails_createdDate' - Indicates when the API was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'name', 'awsApiGatewayV2ApiDetails_name' - The name of the API.
--
-- 'version', 'awsApiGatewayV2ApiDetails_version' - The version identifier for the API.
--
-- 'apiKeySelectionExpression', 'awsApiGatewayV2ApiDetails_apiKeySelectionExpression' - An API key selection expression. Supported only for WebSocket APIs.
--
-- 'corsConfiguration', 'awsApiGatewayV2ApiDetails_corsConfiguration' - A cross-origin resource sharing (CORS) configuration. Supported only for
-- HTTP APIs.
--
-- 'routeSelectionExpression', 'awsApiGatewayV2ApiDetails_routeSelectionExpression' - The route selection expression for the API.
--
-- For HTTP APIs, must be @${request.method} ${request.path}@. This is the
-- default value for HTTP APIs.
--
-- For WebSocket APIs, there is no default value.
--
-- 'description', 'awsApiGatewayV2ApiDetails_description' - A description of the API.
--
-- 'protocolType', 'awsApiGatewayV2ApiDetails_protocolType' - The API protocol for the API.
--
-- Valid values: @WEBSOCKET@ | @HTTP@
newAwsApiGatewayV2ApiDetails ::
  AwsApiGatewayV2ApiDetails
newAwsApiGatewayV2ApiDetails :: AwsApiGatewayV2ApiDetails
newAwsApiGatewayV2ApiDetails =
  AwsApiGatewayV2ApiDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsCorsConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsApiGatewayV2ApiDetails
AwsApiGatewayV2ApiDetails'
    { $sel:apiId:AwsApiGatewayV2ApiDetails' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiEndpoint:AwsApiGatewayV2ApiDetails' :: Maybe Text
apiEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:AwsApiGatewayV2ApiDetails' :: Maybe Text
createdDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsApiGatewayV2ApiDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:AwsApiGatewayV2ApiDetails' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySelectionExpression:AwsApiGatewayV2ApiDetails' :: Maybe Text
apiKeySelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:corsConfiguration:AwsApiGatewayV2ApiDetails' :: Maybe AwsCorsConfiguration
corsConfiguration = Maybe AwsCorsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:routeSelectionExpression:AwsApiGatewayV2ApiDetails' :: Maybe Text
routeSelectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AwsApiGatewayV2ApiDetails' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:protocolType:AwsApiGatewayV2ApiDetails' :: Maybe Text
protocolType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The URI of the API.
--
-- Uses the format @ \<api-id>.execute-api.\<region>.amazonaws.com@
--
-- The stage name is typically appended to the URI to form a complete path
-- to a deployed API stage.
awsApiGatewayV2ApiDetails_apiEndpoint :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayV2ApiDetails_apiEndpoint :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_apiEndpoint = (AwsApiGatewayV2ApiDetails -> Maybe Text)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe Text
apiEndpoint :: Maybe Text
$sel:apiEndpoint:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
apiEndpoint} -> Maybe Text
apiEndpoint) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe Text
a -> AwsApiGatewayV2ApiDetails
s {$sel:apiEndpoint:AwsApiGatewayV2ApiDetails' :: Maybe Text
apiEndpoint = Maybe Text
a} :: AwsApiGatewayV2ApiDetails)

-- | Indicates when the API was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsApiGatewayV2ApiDetails_createdDate :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayV2ApiDetails_createdDate :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_createdDate = (AwsApiGatewayV2ApiDetails -> Maybe Text)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe Text
createdDate :: Maybe Text
$sel:createdDate:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
createdDate} -> Maybe Text
createdDate) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe Text
a -> AwsApiGatewayV2ApiDetails
s {$sel:createdDate:AwsApiGatewayV2ApiDetails' :: Maybe Text
createdDate = Maybe Text
a} :: AwsApiGatewayV2ApiDetails)

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

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

-- | An API key selection expression. Supported only for WebSocket APIs.
awsApiGatewayV2ApiDetails_apiKeySelectionExpression :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayV2ApiDetails_apiKeySelectionExpression :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_apiKeySelectionExpression = (AwsApiGatewayV2ApiDetails -> Maybe Text)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe Text
apiKeySelectionExpression :: Maybe Text
$sel:apiKeySelectionExpression:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
apiKeySelectionExpression} -> Maybe Text
apiKeySelectionExpression) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe Text
a -> AwsApiGatewayV2ApiDetails
s {$sel:apiKeySelectionExpression:AwsApiGatewayV2ApiDetails' :: Maybe Text
apiKeySelectionExpression = Maybe Text
a} :: AwsApiGatewayV2ApiDetails)

-- | A cross-origin resource sharing (CORS) configuration. Supported only for
-- HTTP APIs.
awsApiGatewayV2ApiDetails_corsConfiguration :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe AwsCorsConfiguration)
awsApiGatewayV2ApiDetails_corsConfiguration :: (Maybe AwsCorsConfiguration -> f (Maybe AwsCorsConfiguration))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_corsConfiguration = (AwsApiGatewayV2ApiDetails -> Maybe AwsCorsConfiguration)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe AwsCorsConfiguration -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe AwsCorsConfiguration)
     (Maybe AwsCorsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe AwsCorsConfiguration
corsConfiguration :: Maybe AwsCorsConfiguration
$sel:corsConfiguration:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe AwsCorsConfiguration
corsConfiguration} -> Maybe AwsCorsConfiguration
corsConfiguration) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe AwsCorsConfiguration
a -> AwsApiGatewayV2ApiDetails
s {$sel:corsConfiguration:AwsApiGatewayV2ApiDetails' :: Maybe AwsCorsConfiguration
corsConfiguration = Maybe AwsCorsConfiguration
a} :: AwsApiGatewayV2ApiDetails)

-- | The route selection expression for the API.
--
-- For HTTP APIs, must be @${request.method} ${request.path}@. This is the
-- default value for HTTP APIs.
--
-- For WebSocket APIs, there is no default value.
awsApiGatewayV2ApiDetails_routeSelectionExpression :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayV2ApiDetails_routeSelectionExpression :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_routeSelectionExpression = (AwsApiGatewayV2ApiDetails -> Maybe Text)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe Text
routeSelectionExpression :: Maybe Text
$sel:routeSelectionExpression:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
routeSelectionExpression} -> Maybe Text
routeSelectionExpression) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe Text
a -> AwsApiGatewayV2ApiDetails
s {$sel:routeSelectionExpression:AwsApiGatewayV2ApiDetails' :: Maybe Text
routeSelectionExpression = Maybe Text
a} :: AwsApiGatewayV2ApiDetails)

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

-- | The API protocol for the API.
--
-- Valid values: @WEBSOCKET@ | @HTTP@
awsApiGatewayV2ApiDetails_protocolType :: Lens.Lens' AwsApiGatewayV2ApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayV2ApiDetails_protocolType :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayV2ApiDetails -> f AwsApiGatewayV2ApiDetails
awsApiGatewayV2ApiDetails_protocolType = (AwsApiGatewayV2ApiDetails -> Maybe Text)
-> (AwsApiGatewayV2ApiDetails
    -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Lens
     AwsApiGatewayV2ApiDetails
     AwsApiGatewayV2ApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayV2ApiDetails' {Maybe Text
protocolType :: Maybe Text
$sel:protocolType:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
protocolType} -> Maybe Text
protocolType) (\s :: AwsApiGatewayV2ApiDetails
s@AwsApiGatewayV2ApiDetails' {} Maybe Text
a -> AwsApiGatewayV2ApiDetails
s {$sel:protocolType:AwsApiGatewayV2ApiDetails' :: Maybe Text
protocolType = Maybe Text
a} :: AwsApiGatewayV2ApiDetails)

instance Core.FromJSON AwsApiGatewayV2ApiDetails where
  parseJSON :: Value -> Parser AwsApiGatewayV2ApiDetails
parseJSON =
    String
-> (Object -> Parser AwsApiGatewayV2ApiDetails)
-> Value
-> Parser AwsApiGatewayV2ApiDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsApiGatewayV2ApiDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsCorsConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsApiGatewayV2ApiDetails
AwsApiGatewayV2ApiDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AwsCorsConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiEndpoint")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser
  (Maybe Text
   -> Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsCorsConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiKeySelectionExpression")
            Parser
  (Maybe AwsCorsConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe AwsCorsConfiguration)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsCorsConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CorsConfiguration")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RouteSelectionExpression")
            Parser (Maybe Text -> Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsApiGatewayV2ApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Text -> AwsApiGatewayV2ApiDetails)
-> Parser (Maybe Text) -> Parser AwsApiGatewayV2ApiDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProtocolType")
      )

instance Prelude.Hashable AwsApiGatewayV2ApiDetails

instance Prelude.NFData AwsApiGatewayV2ApiDetails

instance Core.ToJSON AwsApiGatewayV2ApiDetails where
  toJSON :: AwsApiGatewayV2ApiDetails -> Value
toJSON AwsApiGatewayV2ApiDetails' {Maybe Text
Maybe AwsCorsConfiguration
protocolType :: Maybe Text
description :: Maybe Text
routeSelectionExpression :: Maybe Text
corsConfiguration :: Maybe AwsCorsConfiguration
apiKeySelectionExpression :: Maybe Text
version :: Maybe Text
name :: Maybe Text
createdDate :: Maybe Text
apiEndpoint :: Maybe Text
apiId :: Maybe Text
$sel:protocolType:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:description:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:routeSelectionExpression:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:corsConfiguration:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe AwsCorsConfiguration
$sel:apiKeySelectionExpression:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:version:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:name:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:createdDate:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:apiEndpoint:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
$sel:apiId:AwsApiGatewayV2ApiDetails' :: AwsApiGatewayV2ApiDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ApiId" 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
apiId,
            (Text
"ApiEndpoint" 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
apiEndpoint,
            (Text
"CreatedDate" 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
createdDate,
            (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 -> AwsCorsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsCorsConfiguration -> Pair)
-> Maybe AwsCorsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsCorsConfiguration
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
"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
"ProtocolType" 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
protocolType
          ]
      )