{-# 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.MigrationHubReFactorSpaces.Types.ApiGatewayProxyConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MigrationHubReFactorSpaces.Types.ApiGatewayProxyConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubReFactorSpaces.Types.ApiGatewayEndpointType
import qualified Amazonka.Prelude as Prelude

-- | A wrapper object holding the Amazon API Gateway proxy configuration.
--
-- /See:/ 'newApiGatewayProxyConfig' smart constructor.
data ApiGatewayProxyConfig = ApiGatewayProxyConfig'
  { -- | The resource ID of the API Gateway for the proxy.
    ApiGatewayProxyConfig -> Maybe Text
apiGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The type of API Gateway endpoint created.
    ApiGatewayProxyConfig -> Maybe ApiGatewayEndpointType
endpointType :: Prelude.Maybe ApiGatewayEndpointType,
    -- | The Amazon Resource Name (ARN) of the Network Load Balancer configured
    -- by the API Gateway proxy.
    ApiGatewayProxyConfig -> Maybe Text
nlbArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the Network Load Balancer that is configured by the API
    -- Gateway proxy.
    ApiGatewayProxyConfig -> Maybe Text
nlbName :: Prelude.Maybe Prelude.Text,
    -- | The endpoint URL of the API Gateway proxy.
    ApiGatewayProxyConfig -> Maybe Text
proxyUrl :: Prelude.Maybe Prelude.Text,
    -- | The name of the API Gateway stage. The name defaults to @prod@.
    ApiGatewayProxyConfig -> Maybe Text
stageName :: Prelude.Maybe Prelude.Text,
    -- | The @VpcLink@ ID of the API Gateway proxy.
    ApiGatewayProxyConfig -> Maybe Text
vpcLinkId :: Prelude.Maybe Prelude.Text
  }
  deriving (ApiGatewayProxyConfig -> ApiGatewayProxyConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiGatewayProxyConfig -> ApiGatewayProxyConfig -> Bool
$c/= :: ApiGatewayProxyConfig -> ApiGatewayProxyConfig -> Bool
== :: ApiGatewayProxyConfig -> ApiGatewayProxyConfig -> Bool
$c== :: ApiGatewayProxyConfig -> ApiGatewayProxyConfig -> Bool
Prelude.Eq, ReadPrec [ApiGatewayProxyConfig]
ReadPrec ApiGatewayProxyConfig
Int -> ReadS ApiGatewayProxyConfig
ReadS [ApiGatewayProxyConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiGatewayProxyConfig]
$creadListPrec :: ReadPrec [ApiGatewayProxyConfig]
readPrec :: ReadPrec ApiGatewayProxyConfig
$creadPrec :: ReadPrec ApiGatewayProxyConfig
readList :: ReadS [ApiGatewayProxyConfig]
$creadList :: ReadS [ApiGatewayProxyConfig]
readsPrec :: Int -> ReadS ApiGatewayProxyConfig
$creadsPrec :: Int -> ReadS ApiGatewayProxyConfig
Prelude.Read, Int -> ApiGatewayProxyConfig -> ShowS
[ApiGatewayProxyConfig] -> ShowS
ApiGatewayProxyConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiGatewayProxyConfig] -> ShowS
$cshowList :: [ApiGatewayProxyConfig] -> ShowS
show :: ApiGatewayProxyConfig -> String
$cshow :: ApiGatewayProxyConfig -> String
showsPrec :: Int -> ApiGatewayProxyConfig -> ShowS
$cshowsPrec :: Int -> ApiGatewayProxyConfig -> ShowS
Prelude.Show, forall x. Rep ApiGatewayProxyConfig x -> ApiGatewayProxyConfig
forall x. ApiGatewayProxyConfig -> Rep ApiGatewayProxyConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiGatewayProxyConfig x -> ApiGatewayProxyConfig
$cfrom :: forall x. ApiGatewayProxyConfig -> Rep ApiGatewayProxyConfig x
Prelude.Generic)

-- |
-- Create a value of 'ApiGatewayProxyConfig' 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:
--
-- 'apiGatewayId', 'apiGatewayProxyConfig_apiGatewayId' - The resource ID of the API Gateway for the proxy.
--
-- 'endpointType', 'apiGatewayProxyConfig_endpointType' - The type of API Gateway endpoint created.
--
-- 'nlbArn', 'apiGatewayProxyConfig_nlbArn' - The Amazon Resource Name (ARN) of the Network Load Balancer configured
-- by the API Gateway proxy.
--
-- 'nlbName', 'apiGatewayProxyConfig_nlbName' - The name of the Network Load Balancer that is configured by the API
-- Gateway proxy.
--
-- 'proxyUrl', 'apiGatewayProxyConfig_proxyUrl' - The endpoint URL of the API Gateway proxy.
--
-- 'stageName', 'apiGatewayProxyConfig_stageName' - The name of the API Gateway stage. The name defaults to @prod@.
--
-- 'vpcLinkId', 'apiGatewayProxyConfig_vpcLinkId' - The @VpcLink@ ID of the API Gateway proxy.
newApiGatewayProxyConfig ::
  ApiGatewayProxyConfig
newApiGatewayProxyConfig :: ApiGatewayProxyConfig
newApiGatewayProxyConfig =
  ApiGatewayProxyConfig'
    { $sel:apiGatewayId:ApiGatewayProxyConfig' :: Maybe Text
apiGatewayId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:ApiGatewayProxyConfig' :: Maybe ApiGatewayEndpointType
endpointType = forall a. Maybe a
Prelude.Nothing,
      $sel:nlbArn:ApiGatewayProxyConfig' :: Maybe Text
nlbArn = forall a. Maybe a
Prelude.Nothing,
      $sel:nlbName:ApiGatewayProxyConfig' :: Maybe Text
nlbName = forall a. Maybe a
Prelude.Nothing,
      $sel:proxyUrl:ApiGatewayProxyConfig' :: Maybe Text
proxyUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:stageName:ApiGatewayProxyConfig' :: Maybe Text
stageName = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcLinkId:ApiGatewayProxyConfig' :: Maybe Text
vpcLinkId = forall a. Maybe a
Prelude.Nothing
    }

-- | The resource ID of the API Gateway for the proxy.
apiGatewayProxyConfig_apiGatewayId :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_apiGatewayId :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_apiGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
apiGatewayId :: Maybe Text
$sel:apiGatewayId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
apiGatewayId} -> Maybe Text
apiGatewayId) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:apiGatewayId:ApiGatewayProxyConfig' :: Maybe Text
apiGatewayId = Maybe Text
a} :: ApiGatewayProxyConfig)

-- | The type of API Gateway endpoint created.
apiGatewayProxyConfig_endpointType :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe ApiGatewayEndpointType)
apiGatewayProxyConfig_endpointType :: Lens' ApiGatewayProxyConfig (Maybe ApiGatewayEndpointType)
apiGatewayProxyConfig_endpointType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe ApiGatewayEndpointType
endpointType :: Maybe ApiGatewayEndpointType
$sel:endpointType:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe ApiGatewayEndpointType
endpointType} -> Maybe ApiGatewayEndpointType
endpointType) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe ApiGatewayEndpointType
a -> ApiGatewayProxyConfig
s {$sel:endpointType:ApiGatewayProxyConfig' :: Maybe ApiGatewayEndpointType
endpointType = Maybe ApiGatewayEndpointType
a} :: ApiGatewayProxyConfig)

-- | The Amazon Resource Name (ARN) of the Network Load Balancer configured
-- by the API Gateway proxy.
apiGatewayProxyConfig_nlbArn :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_nlbArn :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_nlbArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
nlbArn :: Maybe Text
$sel:nlbArn:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
nlbArn} -> Maybe Text
nlbArn) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:nlbArn:ApiGatewayProxyConfig' :: Maybe Text
nlbArn = Maybe Text
a} :: ApiGatewayProxyConfig)

-- | The name of the Network Load Balancer that is configured by the API
-- Gateway proxy.
apiGatewayProxyConfig_nlbName :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_nlbName :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_nlbName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
nlbName :: Maybe Text
$sel:nlbName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
nlbName} -> Maybe Text
nlbName) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:nlbName:ApiGatewayProxyConfig' :: Maybe Text
nlbName = Maybe Text
a} :: ApiGatewayProxyConfig)

-- | The endpoint URL of the API Gateway proxy.
apiGatewayProxyConfig_proxyUrl :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_proxyUrl :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_proxyUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
proxyUrl :: Maybe Text
$sel:proxyUrl:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
proxyUrl} -> Maybe Text
proxyUrl) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:proxyUrl:ApiGatewayProxyConfig' :: Maybe Text
proxyUrl = Maybe Text
a} :: ApiGatewayProxyConfig)

-- | The name of the API Gateway stage. The name defaults to @prod@.
apiGatewayProxyConfig_stageName :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_stageName :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
stageName :: Maybe Text
$sel:stageName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
stageName} -> Maybe Text
stageName) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:stageName:ApiGatewayProxyConfig' :: Maybe Text
stageName = Maybe Text
a} :: ApiGatewayProxyConfig)

-- | The @VpcLink@ ID of the API Gateway proxy.
apiGatewayProxyConfig_vpcLinkId :: Lens.Lens' ApiGatewayProxyConfig (Prelude.Maybe Prelude.Text)
apiGatewayProxyConfig_vpcLinkId :: Lens' ApiGatewayProxyConfig (Maybe Text)
apiGatewayProxyConfig_vpcLinkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiGatewayProxyConfig' {Maybe Text
vpcLinkId :: Maybe Text
$sel:vpcLinkId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
vpcLinkId} -> Maybe Text
vpcLinkId) (\s :: ApiGatewayProxyConfig
s@ApiGatewayProxyConfig' {} Maybe Text
a -> ApiGatewayProxyConfig
s {$sel:vpcLinkId:ApiGatewayProxyConfig' :: Maybe Text
vpcLinkId = Maybe Text
a} :: ApiGatewayProxyConfig)

instance Data.FromJSON ApiGatewayProxyConfig where
  parseJSON :: Value -> Parser ApiGatewayProxyConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApiGatewayProxyConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe ApiGatewayEndpointType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ApiGatewayProxyConfig
ApiGatewayProxyConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ApiGatewayId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndpointType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NlbArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NlbName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProxyUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StageName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcLinkId")
      )

instance Prelude.Hashable ApiGatewayProxyConfig where
  hashWithSalt :: Int -> ApiGatewayProxyConfig -> Int
hashWithSalt Int
_salt ApiGatewayProxyConfig' {Maybe Text
Maybe ApiGatewayEndpointType
vpcLinkId :: Maybe Text
stageName :: Maybe Text
proxyUrl :: Maybe Text
nlbName :: Maybe Text
nlbArn :: Maybe Text
endpointType :: Maybe ApiGatewayEndpointType
apiGatewayId :: Maybe Text
$sel:vpcLinkId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:stageName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:proxyUrl:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:nlbName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:nlbArn:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:endpointType:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe ApiGatewayEndpointType
$sel:apiGatewayId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApiGatewayEndpointType
endpointType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nlbArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nlbName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
proxyUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stageName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcLinkId

instance Prelude.NFData ApiGatewayProxyConfig where
  rnf :: ApiGatewayProxyConfig -> ()
rnf ApiGatewayProxyConfig' {Maybe Text
Maybe ApiGatewayEndpointType
vpcLinkId :: Maybe Text
stageName :: Maybe Text
proxyUrl :: Maybe Text
nlbName :: Maybe Text
nlbArn :: Maybe Text
endpointType :: Maybe ApiGatewayEndpointType
apiGatewayId :: Maybe Text
$sel:vpcLinkId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:stageName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:proxyUrl:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:nlbName:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:nlbArn:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
$sel:endpointType:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe ApiGatewayEndpointType
$sel:apiGatewayId:ApiGatewayProxyConfig' :: ApiGatewayProxyConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiGatewayEndpointType
endpointType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nlbArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nlbName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
proxyUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stageName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcLinkId