{-# 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.DeleteCustomRoutingEndpointGroup
-- 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)
--
-- Delete an endpoint group from a listener for a custom routing
-- accelerator.
module Amazonka.GlobalAccelerator.DeleteCustomRoutingEndpointGroup
  ( -- * Creating a Request
    DeleteCustomRoutingEndpointGroup (..),
    newDeleteCustomRoutingEndpointGroup,

    -- * Request Lenses
    deleteCustomRoutingEndpointGroup_endpointGroupArn,

    -- * Destructuring the Response
    DeleteCustomRoutingEndpointGroupResponse (..),
    newDeleteCustomRoutingEndpointGroupResponse,
  )
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:/ 'newDeleteCustomRoutingEndpointGroup' smart constructor.
data DeleteCustomRoutingEndpointGroup = DeleteCustomRoutingEndpointGroup'
  { -- | The Amazon Resource Name (ARN) of the endpoint group to delete.
    DeleteCustomRoutingEndpointGroup -> Text
endpointGroupArn :: Prelude.Text
  }
  deriving (DeleteCustomRoutingEndpointGroup
-> DeleteCustomRoutingEndpointGroup -> Bool
(DeleteCustomRoutingEndpointGroup
 -> DeleteCustomRoutingEndpointGroup -> Bool)
-> (DeleteCustomRoutingEndpointGroup
    -> DeleteCustomRoutingEndpointGroup -> Bool)
-> Eq DeleteCustomRoutingEndpointGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomRoutingEndpointGroup
-> DeleteCustomRoutingEndpointGroup -> Bool
$c/= :: DeleteCustomRoutingEndpointGroup
-> DeleteCustomRoutingEndpointGroup -> Bool
== :: DeleteCustomRoutingEndpointGroup
-> DeleteCustomRoutingEndpointGroup -> Bool
$c== :: DeleteCustomRoutingEndpointGroup
-> DeleteCustomRoutingEndpointGroup -> Bool
Prelude.Eq, ReadPrec [DeleteCustomRoutingEndpointGroup]
ReadPrec DeleteCustomRoutingEndpointGroup
Int -> ReadS DeleteCustomRoutingEndpointGroup
ReadS [DeleteCustomRoutingEndpointGroup]
(Int -> ReadS DeleteCustomRoutingEndpointGroup)
-> ReadS [DeleteCustomRoutingEndpointGroup]
-> ReadPrec DeleteCustomRoutingEndpointGroup
-> ReadPrec [DeleteCustomRoutingEndpointGroup]
-> Read DeleteCustomRoutingEndpointGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCustomRoutingEndpointGroup]
$creadListPrec :: ReadPrec [DeleteCustomRoutingEndpointGroup]
readPrec :: ReadPrec DeleteCustomRoutingEndpointGroup
$creadPrec :: ReadPrec DeleteCustomRoutingEndpointGroup
readList :: ReadS [DeleteCustomRoutingEndpointGroup]
$creadList :: ReadS [DeleteCustomRoutingEndpointGroup]
readsPrec :: Int -> ReadS DeleteCustomRoutingEndpointGroup
$creadsPrec :: Int -> ReadS DeleteCustomRoutingEndpointGroup
Prelude.Read, Int -> DeleteCustomRoutingEndpointGroup -> ShowS
[DeleteCustomRoutingEndpointGroup] -> ShowS
DeleteCustomRoutingEndpointGroup -> String
(Int -> DeleteCustomRoutingEndpointGroup -> ShowS)
-> (DeleteCustomRoutingEndpointGroup -> String)
-> ([DeleteCustomRoutingEndpointGroup] -> ShowS)
-> Show DeleteCustomRoutingEndpointGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomRoutingEndpointGroup] -> ShowS
$cshowList :: [DeleteCustomRoutingEndpointGroup] -> ShowS
show :: DeleteCustomRoutingEndpointGroup -> String
$cshow :: DeleteCustomRoutingEndpointGroup -> String
showsPrec :: Int -> DeleteCustomRoutingEndpointGroup -> ShowS
$cshowsPrec :: Int -> DeleteCustomRoutingEndpointGroup -> ShowS
Prelude.Show, (forall x.
 DeleteCustomRoutingEndpointGroup
 -> Rep DeleteCustomRoutingEndpointGroup x)
-> (forall x.
    Rep DeleteCustomRoutingEndpointGroup x
    -> DeleteCustomRoutingEndpointGroup)
-> Generic DeleteCustomRoutingEndpointGroup
forall x.
Rep DeleteCustomRoutingEndpointGroup x
-> DeleteCustomRoutingEndpointGroup
forall x.
DeleteCustomRoutingEndpointGroup
-> Rep DeleteCustomRoutingEndpointGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCustomRoutingEndpointGroup x
-> DeleteCustomRoutingEndpointGroup
$cfrom :: forall x.
DeleteCustomRoutingEndpointGroup
-> Rep DeleteCustomRoutingEndpointGroup x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCustomRoutingEndpointGroup' 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', 'deleteCustomRoutingEndpointGroup_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group to delete.
newDeleteCustomRoutingEndpointGroup ::
  -- | 'endpointGroupArn'
  Prelude.Text ->
  DeleteCustomRoutingEndpointGroup
newDeleteCustomRoutingEndpointGroup :: Text -> DeleteCustomRoutingEndpointGroup
newDeleteCustomRoutingEndpointGroup
  Text
pEndpointGroupArn_ =
    DeleteCustomRoutingEndpointGroup' :: Text -> DeleteCustomRoutingEndpointGroup
DeleteCustomRoutingEndpointGroup'
      { $sel:endpointGroupArn:DeleteCustomRoutingEndpointGroup' :: Text
endpointGroupArn =
          Text
pEndpointGroupArn_
      }

-- | The Amazon Resource Name (ARN) of the endpoint group to delete.
deleteCustomRoutingEndpointGroup_endpointGroupArn :: Lens.Lens' DeleteCustomRoutingEndpointGroup Prelude.Text
deleteCustomRoutingEndpointGroup_endpointGroupArn :: (Text -> f Text)
-> DeleteCustomRoutingEndpointGroup
-> f DeleteCustomRoutingEndpointGroup
deleteCustomRoutingEndpointGroup_endpointGroupArn = (DeleteCustomRoutingEndpointGroup -> Text)
-> (DeleteCustomRoutingEndpointGroup
    -> Text -> DeleteCustomRoutingEndpointGroup)
-> Lens
     DeleteCustomRoutingEndpointGroup
     DeleteCustomRoutingEndpointGroup
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomRoutingEndpointGroup' {Text
endpointGroupArn :: Text
$sel:endpointGroupArn:DeleteCustomRoutingEndpointGroup' :: DeleteCustomRoutingEndpointGroup -> Text
endpointGroupArn} -> Text
endpointGroupArn) (\s :: DeleteCustomRoutingEndpointGroup
s@DeleteCustomRoutingEndpointGroup' {} Text
a -> DeleteCustomRoutingEndpointGroup
s {$sel:endpointGroupArn:DeleteCustomRoutingEndpointGroup' :: Text
endpointGroupArn = Text
a} :: DeleteCustomRoutingEndpointGroup)

instance
  Core.AWSRequest
    DeleteCustomRoutingEndpointGroup
  where
  type
    AWSResponse DeleteCustomRoutingEndpointGroup =
      DeleteCustomRoutingEndpointGroupResponse
  request :: DeleteCustomRoutingEndpointGroup
-> Request DeleteCustomRoutingEndpointGroup
request = Service
-> DeleteCustomRoutingEndpointGroup
-> Request DeleteCustomRoutingEndpointGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteCustomRoutingEndpointGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteCustomRoutingEndpointGroup)))
response =
    AWSResponse DeleteCustomRoutingEndpointGroup
-> Logger
-> Service
-> Proxy DeleteCustomRoutingEndpointGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteCustomRoutingEndpointGroup)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteCustomRoutingEndpointGroup
DeleteCustomRoutingEndpointGroupResponse
DeleteCustomRoutingEndpointGroupResponse'

instance
  Prelude.Hashable
    DeleteCustomRoutingEndpointGroup

instance
  Prelude.NFData
    DeleteCustomRoutingEndpointGroup

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

instance Core.ToJSON DeleteCustomRoutingEndpointGroup where
  toJSON :: DeleteCustomRoutingEndpointGroup -> Value
toJSON DeleteCustomRoutingEndpointGroup' {Text
endpointGroupArn :: Text
$sel:endpointGroupArn:DeleteCustomRoutingEndpointGroup' :: DeleteCustomRoutingEndpointGroup -> Text
..} =
    [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
"EndpointGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointGroupArn)
          ]
      )

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

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

-- | /See:/ 'newDeleteCustomRoutingEndpointGroupResponse' smart constructor.
data DeleteCustomRoutingEndpointGroupResponse = DeleteCustomRoutingEndpointGroupResponse'
  {
  }
  deriving (DeleteCustomRoutingEndpointGroupResponse
-> DeleteCustomRoutingEndpointGroupResponse -> Bool
(DeleteCustomRoutingEndpointGroupResponse
 -> DeleteCustomRoutingEndpointGroupResponse -> Bool)
-> (DeleteCustomRoutingEndpointGroupResponse
    -> DeleteCustomRoutingEndpointGroupResponse -> Bool)
-> Eq DeleteCustomRoutingEndpointGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomRoutingEndpointGroupResponse
-> DeleteCustomRoutingEndpointGroupResponse -> Bool
$c/= :: DeleteCustomRoutingEndpointGroupResponse
-> DeleteCustomRoutingEndpointGroupResponse -> Bool
== :: DeleteCustomRoutingEndpointGroupResponse
-> DeleteCustomRoutingEndpointGroupResponse -> Bool
$c== :: DeleteCustomRoutingEndpointGroupResponse
-> DeleteCustomRoutingEndpointGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCustomRoutingEndpointGroupResponse]
ReadPrec DeleteCustomRoutingEndpointGroupResponse
Int -> ReadS DeleteCustomRoutingEndpointGroupResponse
ReadS [DeleteCustomRoutingEndpointGroupResponse]
(Int -> ReadS DeleteCustomRoutingEndpointGroupResponse)
-> ReadS [DeleteCustomRoutingEndpointGroupResponse]
-> ReadPrec DeleteCustomRoutingEndpointGroupResponse
-> ReadPrec [DeleteCustomRoutingEndpointGroupResponse]
-> Read DeleteCustomRoutingEndpointGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCustomRoutingEndpointGroupResponse]
$creadListPrec :: ReadPrec [DeleteCustomRoutingEndpointGroupResponse]
readPrec :: ReadPrec DeleteCustomRoutingEndpointGroupResponse
$creadPrec :: ReadPrec DeleteCustomRoutingEndpointGroupResponse
readList :: ReadS [DeleteCustomRoutingEndpointGroupResponse]
$creadList :: ReadS [DeleteCustomRoutingEndpointGroupResponse]
readsPrec :: Int -> ReadS DeleteCustomRoutingEndpointGroupResponse
$creadsPrec :: Int -> ReadS DeleteCustomRoutingEndpointGroupResponse
Prelude.Read, Int -> DeleteCustomRoutingEndpointGroupResponse -> ShowS
[DeleteCustomRoutingEndpointGroupResponse] -> ShowS
DeleteCustomRoutingEndpointGroupResponse -> String
(Int -> DeleteCustomRoutingEndpointGroupResponse -> ShowS)
-> (DeleteCustomRoutingEndpointGroupResponse -> String)
-> ([DeleteCustomRoutingEndpointGroupResponse] -> ShowS)
-> Show DeleteCustomRoutingEndpointGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomRoutingEndpointGroupResponse] -> ShowS
$cshowList :: [DeleteCustomRoutingEndpointGroupResponse] -> ShowS
show :: DeleteCustomRoutingEndpointGroupResponse -> String
$cshow :: DeleteCustomRoutingEndpointGroupResponse -> String
showsPrec :: Int -> DeleteCustomRoutingEndpointGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteCustomRoutingEndpointGroupResponse -> ShowS
Prelude.Show, (forall x.
 DeleteCustomRoutingEndpointGroupResponse
 -> Rep DeleteCustomRoutingEndpointGroupResponse x)
-> (forall x.
    Rep DeleteCustomRoutingEndpointGroupResponse x
    -> DeleteCustomRoutingEndpointGroupResponse)
-> Generic DeleteCustomRoutingEndpointGroupResponse
forall x.
Rep DeleteCustomRoutingEndpointGroupResponse x
-> DeleteCustomRoutingEndpointGroupResponse
forall x.
DeleteCustomRoutingEndpointGroupResponse
-> Rep DeleteCustomRoutingEndpointGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCustomRoutingEndpointGroupResponse x
-> DeleteCustomRoutingEndpointGroupResponse
$cfrom :: forall x.
DeleteCustomRoutingEndpointGroupResponse
-> Rep DeleteCustomRoutingEndpointGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCustomRoutingEndpointGroupResponse' 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.
newDeleteCustomRoutingEndpointGroupResponse ::
  DeleteCustomRoutingEndpointGroupResponse
newDeleteCustomRoutingEndpointGroupResponse :: DeleteCustomRoutingEndpointGroupResponse
newDeleteCustomRoutingEndpointGroupResponse =
  DeleteCustomRoutingEndpointGroupResponse
DeleteCustomRoutingEndpointGroupResponse'

instance
  Prelude.NFData
    DeleteCustomRoutingEndpointGroupResponse