{-# 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.DeleteBasePathMapping
-- 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 BasePathMapping resource.
module Amazonka.APIGateway.DeleteBasePathMapping
  ( -- * Creating a Request
    DeleteBasePathMapping (..),
    newDeleteBasePathMapping,

    -- * Request Lenses
    deleteBasePathMapping_domainName,
    deleteBasePathMapping_basePath,

    -- * Destructuring the Response
    DeleteBasePathMappingResponse (..),
    newDeleteBasePathMappingResponse,
  )
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 BasePathMapping resource.
--
-- /See:/ 'newDeleteBasePathMapping' smart constructor.
data DeleteBasePathMapping = DeleteBasePathMapping'
  { -- | The domain name of the BasePathMapping resource to delete.
    DeleteBasePathMapping -> Text
domainName :: Prelude.Text,
    -- | The base path name of the BasePathMapping resource to delete.
    --
    -- To specify an empty base path, set this parameter to @\'(none)\'@.
    DeleteBasePathMapping -> Text
basePath :: Prelude.Text
  }
  deriving (DeleteBasePathMapping -> DeleteBasePathMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBasePathMapping -> DeleteBasePathMapping -> Bool
$c/= :: DeleteBasePathMapping -> DeleteBasePathMapping -> Bool
== :: DeleteBasePathMapping -> DeleteBasePathMapping -> Bool
$c== :: DeleteBasePathMapping -> DeleteBasePathMapping -> Bool
Prelude.Eq, ReadPrec [DeleteBasePathMapping]
ReadPrec DeleteBasePathMapping
Int -> ReadS DeleteBasePathMapping
ReadS [DeleteBasePathMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBasePathMapping]
$creadListPrec :: ReadPrec [DeleteBasePathMapping]
readPrec :: ReadPrec DeleteBasePathMapping
$creadPrec :: ReadPrec DeleteBasePathMapping
readList :: ReadS [DeleteBasePathMapping]
$creadList :: ReadS [DeleteBasePathMapping]
readsPrec :: Int -> ReadS DeleteBasePathMapping
$creadsPrec :: Int -> ReadS DeleteBasePathMapping
Prelude.Read, Int -> DeleteBasePathMapping -> ShowS
[DeleteBasePathMapping] -> ShowS
DeleteBasePathMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBasePathMapping] -> ShowS
$cshowList :: [DeleteBasePathMapping] -> ShowS
show :: DeleteBasePathMapping -> String
$cshow :: DeleteBasePathMapping -> String
showsPrec :: Int -> DeleteBasePathMapping -> ShowS
$cshowsPrec :: Int -> DeleteBasePathMapping -> ShowS
Prelude.Show, forall x. Rep DeleteBasePathMapping x -> DeleteBasePathMapping
forall x. DeleteBasePathMapping -> Rep DeleteBasePathMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBasePathMapping x -> DeleteBasePathMapping
$cfrom :: forall x. DeleteBasePathMapping -> Rep DeleteBasePathMapping x
Prelude.Generic)

-- |
-- Create a value of 'DeleteBasePathMapping' 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', 'deleteBasePathMapping_domainName' - The domain name of the BasePathMapping resource to delete.
--
-- 'basePath', 'deleteBasePathMapping_basePath' - The base path name of the BasePathMapping resource to delete.
--
-- To specify an empty base path, set this parameter to @\'(none)\'@.
newDeleteBasePathMapping ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'basePath'
  Prelude.Text ->
  DeleteBasePathMapping
newDeleteBasePathMapping :: Text -> Text -> DeleteBasePathMapping
newDeleteBasePathMapping Text
pDomainName_ Text
pBasePath_ =
  DeleteBasePathMapping'
    { $sel:domainName:DeleteBasePathMapping' :: Text
domainName = Text
pDomainName_,
      $sel:basePath:DeleteBasePathMapping' :: Text
basePath = Text
pBasePath_
    }

-- | The domain name of the BasePathMapping resource to delete.
deleteBasePathMapping_domainName :: Lens.Lens' DeleteBasePathMapping Prelude.Text
deleteBasePathMapping_domainName :: Lens' DeleteBasePathMapping Text
deleteBasePathMapping_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBasePathMapping' {Text
domainName :: Text
$sel:domainName:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
domainName} -> Text
domainName) (\s :: DeleteBasePathMapping
s@DeleteBasePathMapping' {} Text
a -> DeleteBasePathMapping
s {$sel:domainName:DeleteBasePathMapping' :: Text
domainName = Text
a} :: DeleteBasePathMapping)

-- | The base path name of the BasePathMapping resource to delete.
--
-- To specify an empty base path, set this parameter to @\'(none)\'@.
deleteBasePathMapping_basePath :: Lens.Lens' DeleteBasePathMapping Prelude.Text
deleteBasePathMapping_basePath :: Lens' DeleteBasePathMapping Text
deleteBasePathMapping_basePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBasePathMapping' {Text
basePath :: Text
$sel:basePath:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
basePath} -> Text
basePath) (\s :: DeleteBasePathMapping
s@DeleteBasePathMapping' {} Text
a -> DeleteBasePathMapping
s {$sel:basePath:DeleteBasePathMapping' :: Text
basePath = Text
a} :: DeleteBasePathMapping)

instance Core.AWSRequest DeleteBasePathMapping where
  type
    AWSResponse DeleteBasePathMapping =
      DeleteBasePathMappingResponse
  request :: (Service -> Service)
-> DeleteBasePathMapping -> Request DeleteBasePathMapping
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 DeleteBasePathMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteBasePathMapping)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteBasePathMappingResponse
DeleteBasePathMappingResponse'

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

instance Prelude.NFData DeleteBasePathMapping where
  rnf :: DeleteBasePathMapping -> ()
rnf DeleteBasePathMapping' {Text
basePath :: Text
domainName :: Text
$sel:basePath:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
$sel:domainName:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
basePath

instance Data.ToHeaders DeleteBasePathMapping where
  toHeaders :: DeleteBasePathMapping -> [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 DeleteBasePathMapping where
  toPath :: DeleteBasePathMapping -> ByteString
toPath DeleteBasePathMapping' {Text
basePath :: Text
domainName :: Text
$sel:basePath:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
$sel:domainName:DeleteBasePathMapping' :: DeleteBasePathMapping -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/domainnames/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName,
        ByteString
"/basepathmappings/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
basePath
      ]

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

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

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

instance Prelude.NFData DeleteBasePathMappingResponse where
  rnf :: DeleteBasePathMappingResponse -> ()
rnf DeleteBasePathMappingResponse
_ = ()