{-# 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.CreateCustomRoutingEndpointGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create an endpoint group for the specified listener for a custom routing
-- accelerator. An endpoint group is a collection of endpoints in one
-- Amazon Web Services Region.
module Amazonka.GlobalAccelerator.CreateCustomRoutingEndpointGroup
  ( -- * Creating a Request
    CreateCustomRoutingEndpointGroup (..),
    newCreateCustomRoutingEndpointGroup,

    -- * Request Lenses
    createCustomRoutingEndpointGroup_listenerArn,
    createCustomRoutingEndpointGroup_endpointGroupRegion,
    createCustomRoutingEndpointGroup_destinationConfigurations,
    createCustomRoutingEndpointGroup_idempotencyToken,

    -- * Destructuring the Response
    CreateCustomRoutingEndpointGroupResponse (..),
    newCreateCustomRoutingEndpointGroupResponse,

    -- * Response Lenses
    createCustomRoutingEndpointGroupResponse_endpointGroup,
    createCustomRoutingEndpointGroupResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateCustomRoutingEndpointGroup' smart constructor.
data CreateCustomRoutingEndpointGroup = CreateCustomRoutingEndpointGroup'
  { -- | The Amazon Resource Name (ARN) of the listener for a custom routing
    -- endpoint.
    CreateCustomRoutingEndpointGroup -> Text
listenerArn :: Prelude.Text,
    -- | The Amazon Web Services Region where the endpoint group is located. A
    -- listener can have only one endpoint group in a specific Region.
    CreateCustomRoutingEndpointGroup -> Text
endpointGroupRegion :: Prelude.Text,
    -- | Sets the port range and protocol for all endpoints (virtual private
    -- cloud subnets) in a custom routing endpoint group to accept client
    -- traffic on.
    CreateCustomRoutingEndpointGroup
-> NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations :: Prelude.NonEmpty CustomRoutingDestinationConfiguration,
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency—that is, the uniqueness—of the request.
    CreateCustomRoutingEndpointGroup -> Text
idempotencyToken :: Prelude.Text
  }
  deriving (CreateCustomRoutingEndpointGroup
-> CreateCustomRoutingEndpointGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomRoutingEndpointGroup
-> CreateCustomRoutingEndpointGroup -> Bool
$c/= :: CreateCustomRoutingEndpointGroup
-> CreateCustomRoutingEndpointGroup -> Bool
== :: CreateCustomRoutingEndpointGroup
-> CreateCustomRoutingEndpointGroup -> Bool
$c== :: CreateCustomRoutingEndpointGroup
-> CreateCustomRoutingEndpointGroup -> Bool
Prelude.Eq, ReadPrec [CreateCustomRoutingEndpointGroup]
ReadPrec CreateCustomRoutingEndpointGroup
Int -> ReadS CreateCustomRoutingEndpointGroup
ReadS [CreateCustomRoutingEndpointGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomRoutingEndpointGroup]
$creadListPrec :: ReadPrec [CreateCustomRoutingEndpointGroup]
readPrec :: ReadPrec CreateCustomRoutingEndpointGroup
$creadPrec :: ReadPrec CreateCustomRoutingEndpointGroup
readList :: ReadS [CreateCustomRoutingEndpointGroup]
$creadList :: ReadS [CreateCustomRoutingEndpointGroup]
readsPrec :: Int -> ReadS CreateCustomRoutingEndpointGroup
$creadsPrec :: Int -> ReadS CreateCustomRoutingEndpointGroup
Prelude.Read, Int -> CreateCustomRoutingEndpointGroup -> ShowS
[CreateCustomRoutingEndpointGroup] -> ShowS
CreateCustomRoutingEndpointGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomRoutingEndpointGroup] -> ShowS
$cshowList :: [CreateCustomRoutingEndpointGroup] -> ShowS
show :: CreateCustomRoutingEndpointGroup -> String
$cshow :: CreateCustomRoutingEndpointGroup -> String
showsPrec :: Int -> CreateCustomRoutingEndpointGroup -> ShowS
$cshowsPrec :: Int -> CreateCustomRoutingEndpointGroup -> ShowS
Prelude.Show, forall x.
Rep CreateCustomRoutingEndpointGroup x
-> CreateCustomRoutingEndpointGroup
forall x.
CreateCustomRoutingEndpointGroup
-> Rep CreateCustomRoutingEndpointGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomRoutingEndpointGroup x
-> CreateCustomRoutingEndpointGroup
$cfrom :: forall x.
CreateCustomRoutingEndpointGroup
-> Rep CreateCustomRoutingEndpointGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomRoutingEndpointGroup' 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:
--
-- 'listenerArn', 'createCustomRoutingEndpointGroup_listenerArn' - The Amazon Resource Name (ARN) of the listener for a custom routing
-- endpoint.
--
-- 'endpointGroupRegion', 'createCustomRoutingEndpointGroup_endpointGroupRegion' - The Amazon Web Services Region where the endpoint group is located. A
-- listener can have only one endpoint group in a specific Region.
--
-- 'destinationConfigurations', 'createCustomRoutingEndpointGroup_destinationConfigurations' - Sets the port range and protocol for all endpoints (virtual private
-- cloud subnets) in a custom routing endpoint group to accept client
-- traffic on.
--
-- 'idempotencyToken', 'createCustomRoutingEndpointGroup_idempotencyToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency—that is, the uniqueness—of the request.
newCreateCustomRoutingEndpointGroup ::
  -- | 'listenerArn'
  Prelude.Text ->
  -- | 'endpointGroupRegion'
  Prelude.Text ->
  -- | 'destinationConfigurations'
  Prelude.NonEmpty CustomRoutingDestinationConfiguration ->
  -- | 'idempotencyToken'
  Prelude.Text ->
  CreateCustomRoutingEndpointGroup
newCreateCustomRoutingEndpointGroup :: Text
-> Text
-> NonEmpty CustomRoutingDestinationConfiguration
-> Text
-> CreateCustomRoutingEndpointGroup
newCreateCustomRoutingEndpointGroup
  Text
pListenerArn_
  Text
pEndpointGroupRegion_
  NonEmpty CustomRoutingDestinationConfiguration
pDestinationConfigurations_
  Text
pIdempotencyToken_ =
    CreateCustomRoutingEndpointGroup'
      { $sel:listenerArn:CreateCustomRoutingEndpointGroup' :: Text
listenerArn =
          Text
pListenerArn_,
        $sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: Text
endpointGroupRegion =
          Text
pEndpointGroupRegion_,
        $sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            forall t b. AReview t b -> b -> t
Lens.# NonEmpty CustomRoutingDestinationConfiguration
pDestinationConfigurations_,
        $sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: Text
idempotencyToken = Text
pIdempotencyToken_
      }

-- | The Amazon Resource Name (ARN) of the listener for a custom routing
-- endpoint.
createCustomRoutingEndpointGroup_listenerArn :: Lens.Lens' CreateCustomRoutingEndpointGroup Prelude.Text
createCustomRoutingEndpointGroup_listenerArn :: Lens' CreateCustomRoutingEndpointGroup Text
createCustomRoutingEndpointGroup_listenerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomRoutingEndpointGroup' {Text
listenerArn :: Text
$sel:listenerArn:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
listenerArn} -> Text
listenerArn) (\s :: CreateCustomRoutingEndpointGroup
s@CreateCustomRoutingEndpointGroup' {} Text
a -> CreateCustomRoutingEndpointGroup
s {$sel:listenerArn:CreateCustomRoutingEndpointGroup' :: Text
listenerArn = Text
a} :: CreateCustomRoutingEndpointGroup)

-- | The Amazon Web Services Region where the endpoint group is located. A
-- listener can have only one endpoint group in a specific Region.
createCustomRoutingEndpointGroup_endpointGroupRegion :: Lens.Lens' CreateCustomRoutingEndpointGroup Prelude.Text
createCustomRoutingEndpointGroup_endpointGroupRegion :: Lens' CreateCustomRoutingEndpointGroup Text
createCustomRoutingEndpointGroup_endpointGroupRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomRoutingEndpointGroup' {Text
endpointGroupRegion :: Text
$sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
endpointGroupRegion} -> Text
endpointGroupRegion) (\s :: CreateCustomRoutingEndpointGroup
s@CreateCustomRoutingEndpointGroup' {} Text
a -> CreateCustomRoutingEndpointGroup
s {$sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: Text
endpointGroupRegion = Text
a} :: CreateCustomRoutingEndpointGroup)

-- | Sets the port range and protocol for all endpoints (virtual private
-- cloud subnets) in a custom routing endpoint group to accept client
-- traffic on.
createCustomRoutingEndpointGroup_destinationConfigurations :: Lens.Lens' CreateCustomRoutingEndpointGroup (Prelude.NonEmpty CustomRoutingDestinationConfiguration)
createCustomRoutingEndpointGroup_destinationConfigurations :: Lens'
  CreateCustomRoutingEndpointGroup
  (NonEmpty CustomRoutingDestinationConfiguration)
createCustomRoutingEndpointGroup_destinationConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomRoutingEndpointGroup' {NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations :: NonEmpty CustomRoutingDestinationConfiguration
$sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup
-> NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations} -> NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations) (\s :: CreateCustomRoutingEndpointGroup
s@CreateCustomRoutingEndpointGroup' {} NonEmpty CustomRoutingDestinationConfiguration
a -> CreateCustomRoutingEndpointGroup
s {$sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations = NonEmpty CustomRoutingDestinationConfiguration
a} :: CreateCustomRoutingEndpointGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency—that is, the uniqueness—of the request.
createCustomRoutingEndpointGroup_idempotencyToken :: Lens.Lens' CreateCustomRoutingEndpointGroup Prelude.Text
createCustomRoutingEndpointGroup_idempotencyToken :: Lens' CreateCustomRoutingEndpointGroup Text
createCustomRoutingEndpointGroup_idempotencyToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomRoutingEndpointGroup' {Text
idempotencyToken :: Text
$sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
idempotencyToken} -> Text
idempotencyToken) (\s :: CreateCustomRoutingEndpointGroup
s@CreateCustomRoutingEndpointGroup' {} Text
a -> CreateCustomRoutingEndpointGroup
s {$sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: Text
idempotencyToken = Text
a} :: CreateCustomRoutingEndpointGroup)

instance
  Core.AWSRequest
    CreateCustomRoutingEndpointGroup
  where
  type
    AWSResponse CreateCustomRoutingEndpointGroup =
      CreateCustomRoutingEndpointGroupResponse
  request :: (Service -> Service)
-> CreateCustomRoutingEndpointGroup
-> Request CreateCustomRoutingEndpointGroup
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateCustomRoutingEndpointGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateCustomRoutingEndpointGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CustomRoutingEndpointGroup
-> Int -> CreateCustomRoutingEndpointGroupResponse
CreateCustomRoutingEndpointGroupResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EndpointGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    CreateCustomRoutingEndpointGroup
  where
  hashWithSalt :: Int -> CreateCustomRoutingEndpointGroup -> Int
hashWithSalt
    Int
_salt
    CreateCustomRoutingEndpointGroup' {NonEmpty CustomRoutingDestinationConfiguration
Text
idempotencyToken :: Text
destinationConfigurations :: NonEmpty CustomRoutingDestinationConfiguration
endpointGroupRegion :: Text
listenerArn :: Text
$sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup
-> NonEmpty CustomRoutingDestinationConfiguration
$sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:listenerArn:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
listenerArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointGroupRegion
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
idempotencyToken

instance
  Prelude.NFData
    CreateCustomRoutingEndpointGroup
  where
  rnf :: CreateCustomRoutingEndpointGroup -> ()
rnf CreateCustomRoutingEndpointGroup' {NonEmpty CustomRoutingDestinationConfiguration
Text
idempotencyToken :: Text
destinationConfigurations :: NonEmpty CustomRoutingDestinationConfiguration
endpointGroupRegion :: Text
listenerArn :: Text
$sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup
-> NonEmpty CustomRoutingDestinationConfiguration
$sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:listenerArn:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
listenerArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpointGroupRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
idempotencyToken

instance
  Data.ToHeaders
    CreateCustomRoutingEndpointGroup
  where
  toHeaders :: CreateCustomRoutingEndpointGroup -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"GlobalAccelerator_V20180706.CreateCustomRoutingEndpointGroup" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateCustomRoutingEndpointGroup where
  toJSON :: CreateCustomRoutingEndpointGroup -> Value
toJSON CreateCustomRoutingEndpointGroup' {NonEmpty CustomRoutingDestinationConfiguration
Text
idempotencyToken :: Text
destinationConfigurations :: NonEmpty CustomRoutingDestinationConfiguration
endpointGroupRegion :: Text
listenerArn :: Text
$sel:idempotencyToken:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:destinationConfigurations:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup
-> NonEmpty CustomRoutingDestinationConfiguration
$sel:endpointGroupRegion:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
$sel:listenerArn:CreateCustomRoutingEndpointGroup' :: CreateCustomRoutingEndpointGroup -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"ListenerArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
listenerArn),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"EndpointGroupRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointGroupRegion),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"DestinationConfigurations"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty CustomRoutingDestinationConfiguration
destinationConfigurations
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"IdempotencyToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
idempotencyToken)
          ]
      )

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

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

-- | /See:/ 'newCreateCustomRoutingEndpointGroupResponse' smart constructor.
data CreateCustomRoutingEndpointGroupResponse = CreateCustomRoutingEndpointGroupResponse'
  { -- | The information about the endpoint group created for a custom routing
    -- accelerator.
    CreateCustomRoutingEndpointGroupResponse
-> Maybe CustomRoutingEndpointGroup
endpointGroup :: Prelude.Maybe CustomRoutingEndpointGroup,
    -- | The response's http status code.
    CreateCustomRoutingEndpointGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCustomRoutingEndpointGroupResponse
-> CreateCustomRoutingEndpointGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomRoutingEndpointGroupResponse
-> CreateCustomRoutingEndpointGroupResponse -> Bool
$c/= :: CreateCustomRoutingEndpointGroupResponse
-> CreateCustomRoutingEndpointGroupResponse -> Bool
== :: CreateCustomRoutingEndpointGroupResponse
-> CreateCustomRoutingEndpointGroupResponse -> Bool
$c== :: CreateCustomRoutingEndpointGroupResponse
-> CreateCustomRoutingEndpointGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateCustomRoutingEndpointGroupResponse]
ReadPrec CreateCustomRoutingEndpointGroupResponse
Int -> ReadS CreateCustomRoutingEndpointGroupResponse
ReadS [CreateCustomRoutingEndpointGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomRoutingEndpointGroupResponse]
$creadListPrec :: ReadPrec [CreateCustomRoutingEndpointGroupResponse]
readPrec :: ReadPrec CreateCustomRoutingEndpointGroupResponse
$creadPrec :: ReadPrec CreateCustomRoutingEndpointGroupResponse
readList :: ReadS [CreateCustomRoutingEndpointGroupResponse]
$creadList :: ReadS [CreateCustomRoutingEndpointGroupResponse]
readsPrec :: Int -> ReadS CreateCustomRoutingEndpointGroupResponse
$creadsPrec :: Int -> ReadS CreateCustomRoutingEndpointGroupResponse
Prelude.Read, Int -> CreateCustomRoutingEndpointGroupResponse -> ShowS
[CreateCustomRoutingEndpointGroupResponse] -> ShowS
CreateCustomRoutingEndpointGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomRoutingEndpointGroupResponse] -> ShowS
$cshowList :: [CreateCustomRoutingEndpointGroupResponse] -> ShowS
show :: CreateCustomRoutingEndpointGroupResponse -> String
$cshow :: CreateCustomRoutingEndpointGroupResponse -> String
showsPrec :: Int -> CreateCustomRoutingEndpointGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateCustomRoutingEndpointGroupResponse -> ShowS
Prelude.Show, forall x.
Rep CreateCustomRoutingEndpointGroupResponse x
-> CreateCustomRoutingEndpointGroupResponse
forall x.
CreateCustomRoutingEndpointGroupResponse
-> Rep CreateCustomRoutingEndpointGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomRoutingEndpointGroupResponse x
-> CreateCustomRoutingEndpointGroupResponse
$cfrom :: forall x.
CreateCustomRoutingEndpointGroupResponse
-> Rep CreateCustomRoutingEndpointGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomRoutingEndpointGroupResponse' 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:
--
-- 'endpointGroup', 'createCustomRoutingEndpointGroupResponse_endpointGroup' - The information about the endpoint group created for a custom routing
-- accelerator.
--
-- 'httpStatus', 'createCustomRoutingEndpointGroupResponse_httpStatus' - The response's http status code.
newCreateCustomRoutingEndpointGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCustomRoutingEndpointGroupResponse
newCreateCustomRoutingEndpointGroupResponse :: Int -> CreateCustomRoutingEndpointGroupResponse
newCreateCustomRoutingEndpointGroupResponse
  Int
pHttpStatus_ =
    CreateCustomRoutingEndpointGroupResponse'
      { $sel:endpointGroup:CreateCustomRoutingEndpointGroupResponse' :: Maybe CustomRoutingEndpointGroup
endpointGroup =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateCustomRoutingEndpointGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The information about the endpoint group created for a custom routing
-- accelerator.
createCustomRoutingEndpointGroupResponse_endpointGroup :: Lens.Lens' CreateCustomRoutingEndpointGroupResponse (Prelude.Maybe CustomRoutingEndpointGroup)
createCustomRoutingEndpointGroupResponse_endpointGroup :: Lens'
  CreateCustomRoutingEndpointGroupResponse
  (Maybe CustomRoutingEndpointGroup)
createCustomRoutingEndpointGroupResponse_endpointGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomRoutingEndpointGroupResponse' {Maybe CustomRoutingEndpointGroup
endpointGroup :: Maybe CustomRoutingEndpointGroup
$sel:endpointGroup:CreateCustomRoutingEndpointGroupResponse' :: CreateCustomRoutingEndpointGroupResponse
-> Maybe CustomRoutingEndpointGroup
endpointGroup} -> Maybe CustomRoutingEndpointGroup
endpointGroup) (\s :: CreateCustomRoutingEndpointGroupResponse
s@CreateCustomRoutingEndpointGroupResponse' {} Maybe CustomRoutingEndpointGroup
a -> CreateCustomRoutingEndpointGroupResponse
s {$sel:endpointGroup:CreateCustomRoutingEndpointGroupResponse' :: Maybe CustomRoutingEndpointGroup
endpointGroup = Maybe CustomRoutingEndpointGroup
a} :: CreateCustomRoutingEndpointGroupResponse)

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

instance
  Prelude.NFData
    CreateCustomRoutingEndpointGroupResponse
  where
  rnf :: CreateCustomRoutingEndpointGroupResponse -> ()
rnf CreateCustomRoutingEndpointGroupResponse' {Int
Maybe CustomRoutingEndpointGroup
httpStatus :: Int
endpointGroup :: Maybe CustomRoutingEndpointGroup
$sel:httpStatus:CreateCustomRoutingEndpointGroupResponse' :: CreateCustomRoutingEndpointGroupResponse -> Int
$sel:endpointGroup:CreateCustomRoutingEndpointGroupResponse' :: CreateCustomRoutingEndpointGroupResponse
-> Maybe CustomRoutingEndpointGroup
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomRoutingEndpointGroup
endpointGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus