{-# 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.GlobalAccelerator.AddCustomRoutingEndpoints
-- 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)
--
-- Associate a virtual private cloud (VPC) subnet endpoint with your custom
-- routing accelerator.
--
-- The listener port range must be large enough to support the number of IP
-- addresses that can be specified in your subnet. The number of ports
-- required is: subnet size times the number of ports per destination EC2
-- instances. For example, a subnet defined as \/24 requires a listener
-- port range of at least 255 ports.
--
-- Note: You must have enough remaining listener ports available to map to
-- the subnet ports, or the call will fail with a LimitExceededException.
--
-- By default, all destinations in a subnet in a custom routing accelerator
-- cannot receive traffic. To enable all destinations to receive traffic,
-- or to specify individual port mappings that can receive traffic, see the
-- <https://docs.aws.amazon.com/global-accelerator/latest/api/API_AllowCustomRoutingTraffic.html AllowCustomRoutingTraffic>
-- operation.
module Amazonka.GlobalAccelerator.AddCustomRoutingEndpoints
  ( -- * Creating a Request
    AddCustomRoutingEndpoints (..),
    newAddCustomRoutingEndpoints,

    -- * Request Lenses
    addCustomRoutingEndpoints_endpointConfigurations,
    addCustomRoutingEndpoints_endpointGroupArn,

    -- * Destructuring the Response
    AddCustomRoutingEndpointsResponse (..),
    newAddCustomRoutingEndpointsResponse,

    -- * Response Lenses
    addCustomRoutingEndpointsResponse_endpointGroupArn,
    addCustomRoutingEndpointsResponse_endpointDescriptions,
    addCustomRoutingEndpointsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newAddCustomRoutingEndpoints' smart constructor.
data AddCustomRoutingEndpoints = AddCustomRoutingEndpoints'
  { -- | The list of endpoint objects to add to a custom routing accelerator.
    AddCustomRoutingEndpoints
-> NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations :: Prelude.NonEmpty CustomRoutingEndpointConfiguration,
    -- | The Amazon Resource Name (ARN) of the endpoint group for the custom
    -- routing endpoint.
    AddCustomRoutingEndpoints -> Text
endpointGroupArn :: Prelude.Text
  }
  deriving (AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool
(AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool)
-> (AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool)
-> Eq AddCustomRoutingEndpoints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool
$c/= :: AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool
== :: AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool
$c== :: AddCustomRoutingEndpoints -> AddCustomRoutingEndpoints -> Bool
Prelude.Eq, ReadPrec [AddCustomRoutingEndpoints]
ReadPrec AddCustomRoutingEndpoints
Int -> ReadS AddCustomRoutingEndpoints
ReadS [AddCustomRoutingEndpoints]
(Int -> ReadS AddCustomRoutingEndpoints)
-> ReadS [AddCustomRoutingEndpoints]
-> ReadPrec AddCustomRoutingEndpoints
-> ReadPrec [AddCustomRoutingEndpoints]
-> Read AddCustomRoutingEndpoints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddCustomRoutingEndpoints]
$creadListPrec :: ReadPrec [AddCustomRoutingEndpoints]
readPrec :: ReadPrec AddCustomRoutingEndpoints
$creadPrec :: ReadPrec AddCustomRoutingEndpoints
readList :: ReadS [AddCustomRoutingEndpoints]
$creadList :: ReadS [AddCustomRoutingEndpoints]
readsPrec :: Int -> ReadS AddCustomRoutingEndpoints
$creadsPrec :: Int -> ReadS AddCustomRoutingEndpoints
Prelude.Read, Int -> AddCustomRoutingEndpoints -> ShowS
[AddCustomRoutingEndpoints] -> ShowS
AddCustomRoutingEndpoints -> String
(Int -> AddCustomRoutingEndpoints -> ShowS)
-> (AddCustomRoutingEndpoints -> String)
-> ([AddCustomRoutingEndpoints] -> ShowS)
-> Show AddCustomRoutingEndpoints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddCustomRoutingEndpoints] -> ShowS
$cshowList :: [AddCustomRoutingEndpoints] -> ShowS
show :: AddCustomRoutingEndpoints -> String
$cshow :: AddCustomRoutingEndpoints -> String
showsPrec :: Int -> AddCustomRoutingEndpoints -> ShowS
$cshowsPrec :: Int -> AddCustomRoutingEndpoints -> ShowS
Prelude.Show, (forall x.
 AddCustomRoutingEndpoints -> Rep AddCustomRoutingEndpoints x)
-> (forall x.
    Rep AddCustomRoutingEndpoints x -> AddCustomRoutingEndpoints)
-> Generic AddCustomRoutingEndpoints
forall x.
Rep AddCustomRoutingEndpoints x -> AddCustomRoutingEndpoints
forall x.
AddCustomRoutingEndpoints -> Rep AddCustomRoutingEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddCustomRoutingEndpoints x -> AddCustomRoutingEndpoints
$cfrom :: forall x.
AddCustomRoutingEndpoints -> Rep AddCustomRoutingEndpoints x
Prelude.Generic)

-- |
-- Create a value of 'AddCustomRoutingEndpoints' 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:
--
-- 'endpointConfigurations', 'addCustomRoutingEndpoints_endpointConfigurations' - The list of endpoint objects to add to a custom routing accelerator.
--
-- 'endpointGroupArn', 'addCustomRoutingEndpoints_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group for the custom
-- routing endpoint.
newAddCustomRoutingEndpoints ::
  -- | 'endpointConfigurations'
  Prelude.NonEmpty CustomRoutingEndpointConfiguration ->
  -- | 'endpointGroupArn'
  Prelude.Text ->
  AddCustomRoutingEndpoints
newAddCustomRoutingEndpoints :: NonEmpty CustomRoutingEndpointConfiguration
-> Text -> AddCustomRoutingEndpoints
newAddCustomRoutingEndpoints
  NonEmpty CustomRoutingEndpointConfiguration
pEndpointConfigurations_
  Text
pEndpointGroupArn_ =
    AddCustomRoutingEndpoints' :: NonEmpty CustomRoutingEndpointConfiguration
-> Text -> AddCustomRoutingEndpoints
AddCustomRoutingEndpoints'
      { $sel:endpointConfigurations:AddCustomRoutingEndpoints' :: NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations =
          Tagged
  (NonEmpty CustomRoutingEndpointConfiguration)
  (Identity (NonEmpty CustomRoutingEndpointConfiguration))
-> Tagged
     (NonEmpty CustomRoutingEndpointConfiguration)
     (Identity (NonEmpty CustomRoutingEndpointConfiguration))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty CustomRoutingEndpointConfiguration)
   (Identity (NonEmpty CustomRoutingEndpointConfiguration))
 -> Tagged
      (NonEmpty CustomRoutingEndpointConfiguration)
      (Identity (NonEmpty CustomRoutingEndpointConfiguration)))
-> NonEmpty CustomRoutingEndpointConfiguration
-> NonEmpty CustomRoutingEndpointConfiguration
forall t b. AReview t b -> b -> t
Lens.# NonEmpty CustomRoutingEndpointConfiguration
pEndpointConfigurations_,
        $sel:endpointGroupArn:AddCustomRoutingEndpoints' :: Text
endpointGroupArn = Text
pEndpointGroupArn_
      }

-- | The list of endpoint objects to add to a custom routing accelerator.
addCustomRoutingEndpoints_endpointConfigurations :: Lens.Lens' AddCustomRoutingEndpoints (Prelude.NonEmpty CustomRoutingEndpointConfiguration)
addCustomRoutingEndpoints_endpointConfigurations :: (NonEmpty CustomRoutingEndpointConfiguration
 -> f (NonEmpty CustomRoutingEndpointConfiguration))
-> AddCustomRoutingEndpoints -> f AddCustomRoutingEndpoints
addCustomRoutingEndpoints_endpointConfigurations = (AddCustomRoutingEndpoints
 -> NonEmpty CustomRoutingEndpointConfiguration)
-> (AddCustomRoutingEndpoints
    -> NonEmpty CustomRoutingEndpointConfiguration
    -> AddCustomRoutingEndpoints)
-> Lens
     AddCustomRoutingEndpoints
     AddCustomRoutingEndpoints
     (NonEmpty CustomRoutingEndpointConfiguration)
     (NonEmpty CustomRoutingEndpointConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCustomRoutingEndpoints' {NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations :: NonEmpty CustomRoutingEndpointConfiguration
$sel:endpointConfigurations:AddCustomRoutingEndpoints' :: AddCustomRoutingEndpoints
-> NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations} -> NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations) (\s :: AddCustomRoutingEndpoints
s@AddCustomRoutingEndpoints' {} NonEmpty CustomRoutingEndpointConfiguration
a -> AddCustomRoutingEndpoints
s {$sel:endpointConfigurations:AddCustomRoutingEndpoints' :: NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations = NonEmpty CustomRoutingEndpointConfiguration
a} :: AddCustomRoutingEndpoints) ((NonEmpty CustomRoutingEndpointConfiguration
  -> f (NonEmpty CustomRoutingEndpointConfiguration))
 -> AddCustomRoutingEndpoints -> f AddCustomRoutingEndpoints)
-> ((NonEmpty CustomRoutingEndpointConfiguration
     -> f (NonEmpty CustomRoutingEndpointConfiguration))
    -> NonEmpty CustomRoutingEndpointConfiguration
    -> f (NonEmpty CustomRoutingEndpointConfiguration))
-> (NonEmpty CustomRoutingEndpointConfiguration
    -> f (NonEmpty CustomRoutingEndpointConfiguration))
-> AddCustomRoutingEndpoints
-> f AddCustomRoutingEndpoints
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty CustomRoutingEndpointConfiguration
 -> f (NonEmpty CustomRoutingEndpointConfiguration))
-> NonEmpty CustomRoutingEndpointConfiguration
-> f (NonEmpty CustomRoutingEndpointConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the endpoint group for the custom
-- routing endpoint.
addCustomRoutingEndpoints_endpointGroupArn :: Lens.Lens' AddCustomRoutingEndpoints Prelude.Text
addCustomRoutingEndpoints_endpointGroupArn :: (Text -> f Text)
-> AddCustomRoutingEndpoints -> f AddCustomRoutingEndpoints
addCustomRoutingEndpoints_endpointGroupArn = (AddCustomRoutingEndpoints -> Text)
-> (AddCustomRoutingEndpoints -> Text -> AddCustomRoutingEndpoints)
-> Lens
     AddCustomRoutingEndpoints AddCustomRoutingEndpoints Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCustomRoutingEndpoints' {Text
endpointGroupArn :: Text
$sel:endpointGroupArn:AddCustomRoutingEndpoints' :: AddCustomRoutingEndpoints -> Text
endpointGroupArn} -> Text
endpointGroupArn) (\s :: AddCustomRoutingEndpoints
s@AddCustomRoutingEndpoints' {} Text
a -> AddCustomRoutingEndpoints
s {$sel:endpointGroupArn:AddCustomRoutingEndpoints' :: Text
endpointGroupArn = Text
a} :: AddCustomRoutingEndpoints)

instance Core.AWSRequest AddCustomRoutingEndpoints where
  type
    AWSResponse AddCustomRoutingEndpoints =
      AddCustomRoutingEndpointsResponse
  request :: AddCustomRoutingEndpoints -> Request AddCustomRoutingEndpoints
request = Service
-> AddCustomRoutingEndpoints -> Request AddCustomRoutingEndpoints
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AddCustomRoutingEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddCustomRoutingEndpoints)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AddCustomRoutingEndpoints))
-> Logger
-> Service
-> Proxy AddCustomRoutingEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AddCustomRoutingEndpoints)))
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 [CustomRoutingEndpointDescription]
-> Int
-> AddCustomRoutingEndpointsResponse
AddCustomRoutingEndpointsResponse'
            (Maybe Text
 -> Maybe [CustomRoutingEndpointDescription]
 -> Int
 -> AddCustomRoutingEndpointsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [CustomRoutingEndpointDescription]
      -> Int -> AddCustomRoutingEndpointsResponse)
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
"EndpointGroupArn")
            Either
  String
  (Maybe [CustomRoutingEndpointDescription]
   -> Int -> AddCustomRoutingEndpointsResponse)
-> Either String (Maybe [CustomRoutingEndpointDescription])
-> Either String (Int -> AddCustomRoutingEndpointsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [CustomRoutingEndpointDescription]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EndpointDescriptions"
                            Either String (Maybe (Maybe [CustomRoutingEndpointDescription]))
-> Maybe [CustomRoutingEndpointDescription]
-> Either String (Maybe [CustomRoutingEndpointDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CustomRoutingEndpointDescription]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> AddCustomRoutingEndpointsResponse)
-> Either String Int
-> Either String AddCustomRoutingEndpointsResponse
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 AddCustomRoutingEndpoints

instance Prelude.NFData AddCustomRoutingEndpoints

instance Core.ToHeaders AddCustomRoutingEndpoints where
  toHeaders :: AddCustomRoutingEndpoints -> ResponseHeaders
toHeaders =
    ResponseHeaders -> AddCustomRoutingEndpoints -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GlobalAccelerator_V20180706.AddCustomRoutingEndpoints" ::
                          Prelude.ByteString
                      ),
            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 AddCustomRoutingEndpoints where
  toJSON :: AddCustomRoutingEndpoints -> Value
toJSON AddCustomRoutingEndpoints' {NonEmpty CustomRoutingEndpointConfiguration
Text
endpointGroupArn :: Text
endpointConfigurations :: NonEmpty CustomRoutingEndpointConfiguration
$sel:endpointGroupArn:AddCustomRoutingEndpoints' :: AddCustomRoutingEndpoints -> Text
$sel:endpointConfigurations:AddCustomRoutingEndpoints' :: AddCustomRoutingEndpoints
-> NonEmpty CustomRoutingEndpointConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"EndpointConfigurations"
                  Text -> NonEmpty CustomRoutingEndpointConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty CustomRoutingEndpointConfiguration
endpointConfigurations
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EndpointGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointGroupArn)
          ]
      )

instance Core.ToPath AddCustomRoutingEndpoints where
  toPath :: AddCustomRoutingEndpoints -> ByteString
toPath = ByteString -> AddCustomRoutingEndpoints -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery AddCustomRoutingEndpoints where
  toQuery :: AddCustomRoutingEndpoints -> QueryString
toQuery = QueryString -> AddCustomRoutingEndpoints -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newAddCustomRoutingEndpointsResponse' smart constructor.
data AddCustomRoutingEndpointsResponse = AddCustomRoutingEndpointsResponse'
  { -- | The Amazon Resource Name (ARN) of the endpoint group for the custom
    -- routing endpoint.
    AddCustomRoutingEndpointsResponse -> Maybe Text
endpointGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The endpoint objects added to the custom routing accelerator.
    AddCustomRoutingEndpointsResponse
-> Maybe [CustomRoutingEndpointDescription]
endpointDescriptions :: Prelude.Maybe [CustomRoutingEndpointDescription],
    -- | The response's http status code.
    AddCustomRoutingEndpointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddCustomRoutingEndpointsResponse
-> AddCustomRoutingEndpointsResponse -> Bool
(AddCustomRoutingEndpointsResponse
 -> AddCustomRoutingEndpointsResponse -> Bool)
-> (AddCustomRoutingEndpointsResponse
    -> AddCustomRoutingEndpointsResponse -> Bool)
-> Eq AddCustomRoutingEndpointsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddCustomRoutingEndpointsResponse
-> AddCustomRoutingEndpointsResponse -> Bool
$c/= :: AddCustomRoutingEndpointsResponse
-> AddCustomRoutingEndpointsResponse -> Bool
== :: AddCustomRoutingEndpointsResponse
-> AddCustomRoutingEndpointsResponse -> Bool
$c== :: AddCustomRoutingEndpointsResponse
-> AddCustomRoutingEndpointsResponse -> Bool
Prelude.Eq, ReadPrec [AddCustomRoutingEndpointsResponse]
ReadPrec AddCustomRoutingEndpointsResponse
Int -> ReadS AddCustomRoutingEndpointsResponse
ReadS [AddCustomRoutingEndpointsResponse]
(Int -> ReadS AddCustomRoutingEndpointsResponse)
-> ReadS [AddCustomRoutingEndpointsResponse]
-> ReadPrec AddCustomRoutingEndpointsResponse
-> ReadPrec [AddCustomRoutingEndpointsResponse]
-> Read AddCustomRoutingEndpointsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddCustomRoutingEndpointsResponse]
$creadListPrec :: ReadPrec [AddCustomRoutingEndpointsResponse]
readPrec :: ReadPrec AddCustomRoutingEndpointsResponse
$creadPrec :: ReadPrec AddCustomRoutingEndpointsResponse
readList :: ReadS [AddCustomRoutingEndpointsResponse]
$creadList :: ReadS [AddCustomRoutingEndpointsResponse]
readsPrec :: Int -> ReadS AddCustomRoutingEndpointsResponse
$creadsPrec :: Int -> ReadS AddCustomRoutingEndpointsResponse
Prelude.Read, Int -> AddCustomRoutingEndpointsResponse -> ShowS
[AddCustomRoutingEndpointsResponse] -> ShowS
AddCustomRoutingEndpointsResponse -> String
(Int -> AddCustomRoutingEndpointsResponse -> ShowS)
-> (AddCustomRoutingEndpointsResponse -> String)
-> ([AddCustomRoutingEndpointsResponse] -> ShowS)
-> Show AddCustomRoutingEndpointsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddCustomRoutingEndpointsResponse] -> ShowS
$cshowList :: [AddCustomRoutingEndpointsResponse] -> ShowS
show :: AddCustomRoutingEndpointsResponse -> String
$cshow :: AddCustomRoutingEndpointsResponse -> String
showsPrec :: Int -> AddCustomRoutingEndpointsResponse -> ShowS
$cshowsPrec :: Int -> AddCustomRoutingEndpointsResponse -> ShowS
Prelude.Show, (forall x.
 AddCustomRoutingEndpointsResponse
 -> Rep AddCustomRoutingEndpointsResponse x)
-> (forall x.
    Rep AddCustomRoutingEndpointsResponse x
    -> AddCustomRoutingEndpointsResponse)
-> Generic AddCustomRoutingEndpointsResponse
forall x.
Rep AddCustomRoutingEndpointsResponse x
-> AddCustomRoutingEndpointsResponse
forall x.
AddCustomRoutingEndpointsResponse
-> Rep AddCustomRoutingEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddCustomRoutingEndpointsResponse x
-> AddCustomRoutingEndpointsResponse
$cfrom :: forall x.
AddCustomRoutingEndpointsResponse
-> Rep AddCustomRoutingEndpointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddCustomRoutingEndpointsResponse' 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:
--
-- 'endpointGroupArn', 'addCustomRoutingEndpointsResponse_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group for the custom
-- routing endpoint.
--
-- 'endpointDescriptions', 'addCustomRoutingEndpointsResponse_endpointDescriptions' - The endpoint objects added to the custom routing accelerator.
--
-- 'httpStatus', 'addCustomRoutingEndpointsResponse_httpStatus' - The response's http status code.
newAddCustomRoutingEndpointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddCustomRoutingEndpointsResponse
newAddCustomRoutingEndpointsResponse :: Int -> AddCustomRoutingEndpointsResponse
newAddCustomRoutingEndpointsResponse Int
pHttpStatus_ =
  AddCustomRoutingEndpointsResponse' :: Maybe Text
-> Maybe [CustomRoutingEndpointDescription]
-> Int
-> AddCustomRoutingEndpointsResponse
AddCustomRoutingEndpointsResponse'
    { $sel:endpointGroupArn:AddCustomRoutingEndpointsResponse' :: Maybe Text
endpointGroupArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointDescriptions:AddCustomRoutingEndpointsResponse' :: Maybe [CustomRoutingEndpointDescription]
endpointDescriptions = Maybe [CustomRoutingEndpointDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AddCustomRoutingEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the endpoint group for the custom
-- routing endpoint.
addCustomRoutingEndpointsResponse_endpointGroupArn :: Lens.Lens' AddCustomRoutingEndpointsResponse (Prelude.Maybe Prelude.Text)
addCustomRoutingEndpointsResponse_endpointGroupArn :: (Maybe Text -> f (Maybe Text))
-> AddCustomRoutingEndpointsResponse
-> f AddCustomRoutingEndpointsResponse
addCustomRoutingEndpointsResponse_endpointGroupArn = (AddCustomRoutingEndpointsResponse -> Maybe Text)
-> (AddCustomRoutingEndpointsResponse
    -> Maybe Text -> AddCustomRoutingEndpointsResponse)
-> Lens
     AddCustomRoutingEndpointsResponse
     AddCustomRoutingEndpointsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCustomRoutingEndpointsResponse' {Maybe Text
endpointGroupArn :: Maybe Text
$sel:endpointGroupArn:AddCustomRoutingEndpointsResponse' :: AddCustomRoutingEndpointsResponse -> Maybe Text
endpointGroupArn} -> Maybe Text
endpointGroupArn) (\s :: AddCustomRoutingEndpointsResponse
s@AddCustomRoutingEndpointsResponse' {} Maybe Text
a -> AddCustomRoutingEndpointsResponse
s {$sel:endpointGroupArn:AddCustomRoutingEndpointsResponse' :: Maybe Text
endpointGroupArn = Maybe Text
a} :: AddCustomRoutingEndpointsResponse)

-- | The endpoint objects added to the custom routing accelerator.
addCustomRoutingEndpointsResponse_endpointDescriptions :: Lens.Lens' AddCustomRoutingEndpointsResponse (Prelude.Maybe [CustomRoutingEndpointDescription])
addCustomRoutingEndpointsResponse_endpointDescriptions :: (Maybe [CustomRoutingEndpointDescription]
 -> f (Maybe [CustomRoutingEndpointDescription]))
-> AddCustomRoutingEndpointsResponse
-> f AddCustomRoutingEndpointsResponse
addCustomRoutingEndpointsResponse_endpointDescriptions = (AddCustomRoutingEndpointsResponse
 -> Maybe [CustomRoutingEndpointDescription])
-> (AddCustomRoutingEndpointsResponse
    -> Maybe [CustomRoutingEndpointDescription]
    -> AddCustomRoutingEndpointsResponse)
-> Lens
     AddCustomRoutingEndpointsResponse
     AddCustomRoutingEndpointsResponse
     (Maybe [CustomRoutingEndpointDescription])
     (Maybe [CustomRoutingEndpointDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCustomRoutingEndpointsResponse' {Maybe [CustomRoutingEndpointDescription]
endpointDescriptions :: Maybe [CustomRoutingEndpointDescription]
$sel:endpointDescriptions:AddCustomRoutingEndpointsResponse' :: AddCustomRoutingEndpointsResponse
-> Maybe [CustomRoutingEndpointDescription]
endpointDescriptions} -> Maybe [CustomRoutingEndpointDescription]
endpointDescriptions) (\s :: AddCustomRoutingEndpointsResponse
s@AddCustomRoutingEndpointsResponse' {} Maybe [CustomRoutingEndpointDescription]
a -> AddCustomRoutingEndpointsResponse
s {$sel:endpointDescriptions:AddCustomRoutingEndpointsResponse' :: Maybe [CustomRoutingEndpointDescription]
endpointDescriptions = Maybe [CustomRoutingEndpointDescription]
a} :: AddCustomRoutingEndpointsResponse) ((Maybe [CustomRoutingEndpointDescription]
  -> f (Maybe [CustomRoutingEndpointDescription]))
 -> AddCustomRoutingEndpointsResponse
 -> f AddCustomRoutingEndpointsResponse)
-> ((Maybe [CustomRoutingEndpointDescription]
     -> f (Maybe [CustomRoutingEndpointDescription]))
    -> Maybe [CustomRoutingEndpointDescription]
    -> f (Maybe [CustomRoutingEndpointDescription]))
-> (Maybe [CustomRoutingEndpointDescription]
    -> f (Maybe [CustomRoutingEndpointDescription]))
-> AddCustomRoutingEndpointsResponse
-> f AddCustomRoutingEndpointsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
-> Iso
     (Maybe [CustomRoutingEndpointDescription])
     (Maybe [CustomRoutingEndpointDescription])
     (Maybe [CustomRoutingEndpointDescription])
     (Maybe [CustomRoutingEndpointDescription])
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
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
  [CustomRoutingEndpointDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
addCustomRoutingEndpointsResponse_httpStatus :: Lens.Lens' AddCustomRoutingEndpointsResponse Prelude.Int
addCustomRoutingEndpointsResponse_httpStatus :: (Int -> f Int)
-> AddCustomRoutingEndpointsResponse
-> f AddCustomRoutingEndpointsResponse
addCustomRoutingEndpointsResponse_httpStatus = (AddCustomRoutingEndpointsResponse -> Int)
-> (AddCustomRoutingEndpointsResponse
    -> Int -> AddCustomRoutingEndpointsResponse)
-> Lens
     AddCustomRoutingEndpointsResponse
     AddCustomRoutingEndpointsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddCustomRoutingEndpointsResponse' {Int
httpStatus :: Int
$sel:httpStatus:AddCustomRoutingEndpointsResponse' :: AddCustomRoutingEndpointsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AddCustomRoutingEndpointsResponse
s@AddCustomRoutingEndpointsResponse' {} Int
a -> AddCustomRoutingEndpointsResponse
s {$sel:httpStatus:AddCustomRoutingEndpointsResponse' :: Int
httpStatus = Int
a} :: AddCustomRoutingEndpointsResponse)

instance
  Prelude.NFData
    AddCustomRoutingEndpointsResponse