{-# 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.GlobalAccelerator.Types.CustomRoutingEndpointConfiguration
-- 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.GlobalAccelerator.Types.CustomRoutingEndpointConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The list of endpoint objects. For custom routing, this is a list of
-- virtual private cloud (VPC) subnet IDs.
--
-- /See:/ 'newCustomRoutingEndpointConfiguration' smart constructor.
data CustomRoutingEndpointConfiguration = CustomRoutingEndpointConfiguration'
  { -- | An ID for the endpoint. For custom routing accelerators, this is the
    -- virtual private cloud (VPC) subnet ID.
    CustomRoutingEndpointConfiguration -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomRoutingEndpointConfiguration
-> CustomRoutingEndpointConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomRoutingEndpointConfiguration
-> CustomRoutingEndpointConfiguration -> Bool
$c/= :: CustomRoutingEndpointConfiguration
-> CustomRoutingEndpointConfiguration -> Bool
== :: CustomRoutingEndpointConfiguration
-> CustomRoutingEndpointConfiguration -> Bool
$c== :: CustomRoutingEndpointConfiguration
-> CustomRoutingEndpointConfiguration -> Bool
Prelude.Eq, ReadPrec [CustomRoutingEndpointConfiguration]
ReadPrec CustomRoutingEndpointConfiguration
Int -> ReadS CustomRoutingEndpointConfiguration
ReadS [CustomRoutingEndpointConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomRoutingEndpointConfiguration]
$creadListPrec :: ReadPrec [CustomRoutingEndpointConfiguration]
readPrec :: ReadPrec CustomRoutingEndpointConfiguration
$creadPrec :: ReadPrec CustomRoutingEndpointConfiguration
readList :: ReadS [CustomRoutingEndpointConfiguration]
$creadList :: ReadS [CustomRoutingEndpointConfiguration]
readsPrec :: Int -> ReadS CustomRoutingEndpointConfiguration
$creadsPrec :: Int -> ReadS CustomRoutingEndpointConfiguration
Prelude.Read, Int -> CustomRoutingEndpointConfiguration -> ShowS
[CustomRoutingEndpointConfiguration] -> ShowS
CustomRoutingEndpointConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomRoutingEndpointConfiguration] -> ShowS
$cshowList :: [CustomRoutingEndpointConfiguration] -> ShowS
show :: CustomRoutingEndpointConfiguration -> String
$cshow :: CustomRoutingEndpointConfiguration -> String
showsPrec :: Int -> CustomRoutingEndpointConfiguration -> ShowS
$cshowsPrec :: Int -> CustomRoutingEndpointConfiguration -> ShowS
Prelude.Show, forall x.
Rep CustomRoutingEndpointConfiguration x
-> CustomRoutingEndpointConfiguration
forall x.
CustomRoutingEndpointConfiguration
-> Rep CustomRoutingEndpointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomRoutingEndpointConfiguration x
-> CustomRoutingEndpointConfiguration
$cfrom :: forall x.
CustomRoutingEndpointConfiguration
-> Rep CustomRoutingEndpointConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CustomRoutingEndpointConfiguration' 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:
--
-- 'endpointId', 'customRoutingEndpointConfiguration_endpointId' - An ID for the endpoint. For custom routing accelerators, this is the
-- virtual private cloud (VPC) subnet ID.
newCustomRoutingEndpointConfiguration ::
  CustomRoutingEndpointConfiguration
newCustomRoutingEndpointConfiguration :: CustomRoutingEndpointConfiguration
newCustomRoutingEndpointConfiguration =
  CustomRoutingEndpointConfiguration'
    { $sel:endpointId:CustomRoutingEndpointConfiguration' :: Maybe Text
endpointId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | An ID for the endpoint. For custom routing accelerators, this is the
-- virtual private cloud (VPC) subnet ID.
customRoutingEndpointConfiguration_endpointId :: Lens.Lens' CustomRoutingEndpointConfiguration (Prelude.Maybe Prelude.Text)
customRoutingEndpointConfiguration_endpointId :: Lens' CustomRoutingEndpointConfiguration (Maybe Text)
customRoutingEndpointConfiguration_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomRoutingEndpointConfiguration' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:CustomRoutingEndpointConfiguration' :: CustomRoutingEndpointConfiguration -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: CustomRoutingEndpointConfiguration
s@CustomRoutingEndpointConfiguration' {} Maybe Text
a -> CustomRoutingEndpointConfiguration
s {$sel:endpointId:CustomRoutingEndpointConfiguration' :: Maybe Text
endpointId = Maybe Text
a} :: CustomRoutingEndpointConfiguration)

instance
  Prelude.Hashable
    CustomRoutingEndpointConfiguration
  where
  hashWithSalt :: Int -> CustomRoutingEndpointConfiguration -> Int
hashWithSalt
    Int
_salt
    CustomRoutingEndpointConfiguration' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:CustomRoutingEndpointConfiguration' :: CustomRoutingEndpointConfiguration -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointId

instance
  Prelude.NFData
    CustomRoutingEndpointConfiguration
  where
  rnf :: CustomRoutingEndpointConfiguration -> ()
rnf CustomRoutingEndpointConfiguration' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:CustomRoutingEndpointConfiguration' :: CustomRoutingEndpointConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointId

instance
  Data.ToJSON
    CustomRoutingEndpointConfiguration
  where
  toJSON :: CustomRoutingEndpointConfiguration -> Value
toJSON CustomRoutingEndpointConfiguration' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:CustomRoutingEndpointConfiguration' :: CustomRoutingEndpointConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"EndpointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
endpointId]
      )