{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | The name of the DomainName resource to be deleted.
    DeleteDomainName -> Text
domainName :: Prelude.Text
  }
  deriving (DeleteDomainName -> DeleteDomainName -> Bool
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]
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
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. 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' - The name of the DomainName resource to be deleted.
newDeleteDomainName ::
  -- | 'domainName'
  Prelude.Text ->
  DeleteDomainName
newDeleteDomainName :: Text -> DeleteDomainName
newDeleteDomainName Text
pDomainName_ =
  DeleteDomainName' {$sel:domainName:DeleteDomainName' :: Text
domainName = Text
pDomainName_}

-- | The name of the DomainName resource to be deleted.
deleteDomainName_domainName :: Lens.Lens' DeleteDomainName Prelude.Text
deleteDomainName_domainName :: Lens' DeleteDomainName Text
deleteDomainName_domainName = 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 :: (Service -> Service)
-> DeleteDomainName -> Request DeleteDomainName
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteDomainName
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDomainName)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteDomainNameResponse
DeleteDomainNameResponse'

instance Prelude.Hashable DeleteDomainName where
  hashWithSalt :: Int -> DeleteDomainName -> Int
hashWithSalt Int
_salt DeleteDomainName' {Text
domainName :: Text
$sel:domainName:DeleteDomainName' :: DeleteDomainName -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName

instance Prelude.NFData DeleteDomainName where
  rnf :: DeleteDomainName -> ()
rnf DeleteDomainName' {Text
domainName :: Text
$sel:domainName:DeleteDomainName' :: DeleteDomainName -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
domainName

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

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

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

-- | /See:/ 'newDeleteDomainNameResponse' smart constructor.
data DeleteDomainNameResponse = DeleteDomainNameResponse'
  {
  }
  deriving (DeleteDomainNameResponse -> DeleteDomainNameResponse -> Bool
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]
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
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.
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 where
  rnf :: DeleteDomainNameResponse -> ()
rnf DeleteDomainNameResponse
_ = ()