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

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

-- | A complex type for an endpoint for a custom routing accelerator. Each
-- endpoint group can include one or more endpoints, which are virtual
-- private cloud (VPC) subnets.
--
-- /See:/ 'newCustomRoutingEndpointDescription' smart constructor.
data CustomRoutingEndpointDescription = CustomRoutingEndpointDescription'
  { -- | An ID for the endpoint. For custom routing accelerators, this is the
    -- virtual private cloud (VPC) subnet ID.
    CustomRoutingEndpointDescription -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomRoutingEndpointDescription
-> CustomRoutingEndpointDescription -> Bool
(CustomRoutingEndpointDescription
 -> CustomRoutingEndpointDescription -> Bool)
-> (CustomRoutingEndpointDescription
    -> CustomRoutingEndpointDescription -> Bool)
-> Eq CustomRoutingEndpointDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomRoutingEndpointDescription
-> CustomRoutingEndpointDescription -> Bool
$c/= :: CustomRoutingEndpointDescription
-> CustomRoutingEndpointDescription -> Bool
== :: CustomRoutingEndpointDescription
-> CustomRoutingEndpointDescription -> Bool
$c== :: CustomRoutingEndpointDescription
-> CustomRoutingEndpointDescription -> Bool
Prelude.Eq, ReadPrec [CustomRoutingEndpointDescription]
ReadPrec CustomRoutingEndpointDescription
Int -> ReadS CustomRoutingEndpointDescription
ReadS [CustomRoutingEndpointDescription]
(Int -> ReadS CustomRoutingEndpointDescription)
-> ReadS [CustomRoutingEndpointDescription]
-> ReadPrec CustomRoutingEndpointDescription
-> ReadPrec [CustomRoutingEndpointDescription]
-> Read CustomRoutingEndpointDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomRoutingEndpointDescription]
$creadListPrec :: ReadPrec [CustomRoutingEndpointDescription]
readPrec :: ReadPrec CustomRoutingEndpointDescription
$creadPrec :: ReadPrec CustomRoutingEndpointDescription
readList :: ReadS [CustomRoutingEndpointDescription]
$creadList :: ReadS [CustomRoutingEndpointDescription]
readsPrec :: Int -> ReadS CustomRoutingEndpointDescription
$creadsPrec :: Int -> ReadS CustomRoutingEndpointDescription
Prelude.Read, Int -> CustomRoutingEndpointDescription -> ShowS
[CustomRoutingEndpointDescription] -> ShowS
CustomRoutingEndpointDescription -> String
(Int -> CustomRoutingEndpointDescription -> ShowS)
-> (CustomRoutingEndpointDescription -> String)
-> ([CustomRoutingEndpointDescription] -> ShowS)
-> Show CustomRoutingEndpointDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomRoutingEndpointDescription] -> ShowS
$cshowList :: [CustomRoutingEndpointDescription] -> ShowS
show :: CustomRoutingEndpointDescription -> String
$cshow :: CustomRoutingEndpointDescription -> String
showsPrec :: Int -> CustomRoutingEndpointDescription -> ShowS
$cshowsPrec :: Int -> CustomRoutingEndpointDescription -> ShowS
Prelude.Show, (forall x.
 CustomRoutingEndpointDescription
 -> Rep CustomRoutingEndpointDescription x)
-> (forall x.
    Rep CustomRoutingEndpointDescription x
    -> CustomRoutingEndpointDescription)
-> Generic CustomRoutingEndpointDescription
forall x.
Rep CustomRoutingEndpointDescription x
-> CustomRoutingEndpointDescription
forall x.
CustomRoutingEndpointDescription
-> Rep CustomRoutingEndpointDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomRoutingEndpointDescription x
-> CustomRoutingEndpointDescription
$cfrom :: forall x.
CustomRoutingEndpointDescription
-> Rep CustomRoutingEndpointDescription x
Prelude.Generic)

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

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

instance
  Core.FromJSON
    CustomRoutingEndpointDescription
  where
  parseJSON :: Value -> Parser CustomRoutingEndpointDescription
parseJSON =
    String
-> (Object -> Parser CustomRoutingEndpointDescription)
-> Value
-> Parser CustomRoutingEndpointDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomRoutingEndpointDescription"
      ( \Object
x ->
          Maybe Text -> CustomRoutingEndpointDescription
CustomRoutingEndpointDescription'
            (Maybe Text -> CustomRoutingEndpointDescription)
-> Parser (Maybe Text) -> Parser CustomRoutingEndpointDescription
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
"EndpointId")
      )

instance
  Prelude.Hashable
    CustomRoutingEndpointDescription

instance
  Prelude.NFData
    CustomRoutingEndpointDescription