{-# 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.APIGateway.DeleteDomainName
-- 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)
--
-- Deletes the DomainName resource.
module Amazonka.APIGateway.DeleteDomainName
  ( -- * Creating a Request
    DeleteDomainName (..),
    newDeleteDomainName,

    -- * Request Lenses
    deleteDomainName_domainName,

    -- * Destructuring the Response
    DeleteDomainNameResponse (..),
    newDeleteDomainNameResponse,
  )
where

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

-- | A request to delete the DomainName resource.
--
-- /See:/ 'newDeleteDomainName' smart constructor.
data DeleteDomainName = DeleteDomainName'
  { -- | [Required] The name of the DomainName resource to be deleted.
    DeleteDomainName -> Text
domainName :: Prelude.Text
  }
  deriving (DeleteDomainName -> DeleteDomainName -> Bool
(DeleteDomainName -> DeleteDomainName -> Bool)
-> (DeleteDomainName -> DeleteDomainName -> Bool)
-> Eq DeleteDomainName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDomainName -> DeleteDomainName -> Bool
$c/= :: DeleteDomainName -> DeleteDomainName -> Bool
== :: DeleteDomainName -> DeleteDomainName -> Bool
$c== :: DeleteDomainName -> DeleteDomainName -> Bool
Prelude.Eq, ReadPrec [DeleteDomainName]
ReadPrec DeleteDomainName
Int -> ReadS DeleteDomainName
ReadS [DeleteDomainName]
(Int -> ReadS DeleteDomainName)
-> ReadS [DeleteDomainName]
-> ReadPrec DeleteDomainName
-> ReadPrec [DeleteDomainName]
-> Read DeleteDomainName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDomainName]
$creadListPrec :: ReadPrec [DeleteDomainName]
readPrec :: ReadPrec DeleteDomainName
$creadPrec :: ReadPrec DeleteDomainName
readList :: ReadS [DeleteDomainName]
$creadList :: ReadS [DeleteDomainName]
readsPrec :: Int -> ReadS DeleteDomainName
$creadsPrec :: Int -> ReadS DeleteDomainName
Prelude.Read, Int -> DeleteDomainName -> ShowS
[DeleteDomainName] -> ShowS
DeleteDomainName -> String
(Int -> DeleteDomainName -> ShowS)
-> (DeleteDomainName -> String)
-> ([DeleteDomainName] -> ShowS)
-> Show DeleteDomainName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDomainName] -> ShowS
$cshowList :: [DeleteDomainName] -> ShowS
show :: DeleteDomainName -> String
$cshow :: DeleteDomainName -> String
showsPrec :: Int -> DeleteDomainName -> ShowS
$cshowsPrec :: Int -> DeleteDomainName -> ShowS
Prelude.Show, (forall x. DeleteDomainName -> Rep DeleteDomainName x)
-> (forall x. Rep DeleteDomainName x -> DeleteDomainName)
-> Generic DeleteDomainName
forall x. Rep DeleteDomainName x -> DeleteDomainName
forall x. DeleteDomainName -> Rep DeleteDomainName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDomainName x -> DeleteDomainName
$cfrom :: forall x. DeleteDomainName -> Rep DeleteDomainName x
Prelude.Generic)

-- |
-- Create a value of 'DeleteDomainName' 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:
--
-- 'domainName', 'deleteDomainName_domainName' - [Required] The name of the DomainName resource to be deleted.
newDeleteDomainName ::
  -- | 'domainName'
  Prelude.Text ->
  DeleteDomainName
newDeleteDomainName :: Text -> DeleteDomainName
newDeleteDomainName Text
pDomainName_ =
  DeleteDomainName' :: Text -> DeleteDomainName
DeleteDomainName' {$sel:domainName:DeleteDomainName' :: Text
domainName = Text
pDomainName_}

-- | [Required] The name of the DomainName resource to be deleted.
deleteDomainName_domainName :: Lens.Lens' DeleteDomainName Prelude.Text
deleteDomainName_domainName :: (Text -> f Text) -> DeleteDomainName -> f DeleteDomainName
deleteDomainName_domainName = (DeleteDomainName -> Text)
-> (DeleteDomainName -> Text -> DeleteDomainName)
-> Lens DeleteDomainName DeleteDomainName Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDomainName' {Text
domainName :: Text
$sel:domainName:DeleteDomainName' :: DeleteDomainName -> Text
domainName} -> Text
domainName) (\s :: DeleteDomainName
s@DeleteDomainName' {} Text
a -> DeleteDomainName
s {$sel:domainName:DeleteDomainName' :: Text
domainName = Text
a} :: DeleteDomainName)

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

instance Prelude.Hashable DeleteDomainName

instance Prelude.NFData DeleteDomainName

instance Core.ToHeaders DeleteDomainName where
  toHeaders :: DeleteDomainName -> [Header]
toHeaders =
    [Header] -> DeleteDomainName -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath DeleteDomainName where
  toPath :: DeleteDomainName -> ByteString
toPath DeleteDomainName' {Text
domainName :: Text
$sel:domainName:DeleteDomainName' :: DeleteDomainName -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/domainnames/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName]

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

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

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

instance Prelude.NFData DeleteDomainNameResponse