{-# 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.DeleteCustomRoutingListener
-- 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 a listener for a custom routing accelerator.
module Amazonka.GlobalAccelerator.DeleteCustomRoutingListener
  ( -- * Creating a Request
    DeleteCustomRoutingListener (..),
    newDeleteCustomRoutingListener,

    -- * Request Lenses
    deleteCustomRoutingListener_listenerArn,

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

-- |
-- Create a value of 'DeleteCustomRoutingListener' 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', 'deleteCustomRoutingListener_listenerArn' - The Amazon Resource Name (ARN) of the listener to delete.
newDeleteCustomRoutingListener ::
  -- | 'listenerArn'
  Prelude.Text ->
  DeleteCustomRoutingListener
newDeleteCustomRoutingListener :: Text -> DeleteCustomRoutingListener
newDeleteCustomRoutingListener Text
pListenerArn_ =
  DeleteCustomRoutingListener' :: Text -> DeleteCustomRoutingListener
DeleteCustomRoutingListener'
    { $sel:listenerArn:DeleteCustomRoutingListener' :: Text
listenerArn =
        Text
pListenerArn_
    }

-- | The Amazon Resource Name (ARN) of the listener to delete.
deleteCustomRoutingListener_listenerArn :: Lens.Lens' DeleteCustomRoutingListener Prelude.Text
deleteCustomRoutingListener_listenerArn :: (Text -> f Text)
-> DeleteCustomRoutingListener -> f DeleteCustomRoutingListener
deleteCustomRoutingListener_listenerArn = (DeleteCustomRoutingListener -> Text)
-> (DeleteCustomRoutingListener
    -> Text -> DeleteCustomRoutingListener)
-> Lens
     DeleteCustomRoutingListener DeleteCustomRoutingListener Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomRoutingListener' {Text
listenerArn :: Text
$sel:listenerArn:DeleteCustomRoutingListener' :: DeleteCustomRoutingListener -> Text
listenerArn} -> Text
listenerArn) (\s :: DeleteCustomRoutingListener
s@DeleteCustomRoutingListener' {} Text
a -> DeleteCustomRoutingListener
s {$sel:listenerArn:DeleteCustomRoutingListener' :: Text
listenerArn = Text
a} :: DeleteCustomRoutingListener)

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

instance Prelude.Hashable DeleteCustomRoutingListener

instance Prelude.NFData DeleteCustomRoutingListener

instance Core.ToHeaders DeleteCustomRoutingListener where
  toHeaders :: DeleteCustomRoutingListener -> [Header]
toHeaders =
    [Header] -> DeleteCustomRoutingListener -> [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.DeleteCustomRoutingListener" ::
                          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 DeleteCustomRoutingListener where
  toJSON :: DeleteCustomRoutingListener -> Value
toJSON DeleteCustomRoutingListener' {Text
listenerArn :: Text
$sel:listenerArn:DeleteCustomRoutingListener' :: DeleteCustomRoutingListener -> 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
"ListenerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listenerArn)]
      )

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

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

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

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

instance
  Prelude.NFData
    DeleteCustomRoutingListenerResponse