{-# 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-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 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.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 BasePathMapping resource.
--
-- /See:/ 'newDeleteBasePathMapping' smart constructor.
data DeleteBasePathMapping = DeleteBasePathMapping'
  { -- | [Required] The domain name of the BasePathMapping resource to delete.
    DeleteBasePathMapping -> Text
domainName :: Prelude.Text,
    -- | [Required] 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
(DeleteBasePathMapping -> DeleteBasePathMapping -> Bool)
-> (DeleteBasePathMapping -> DeleteBasePathMapping -> Bool)
-> Eq DeleteBasePathMapping
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]
(Int -> ReadS DeleteBasePathMapping)
-> ReadS [DeleteBasePathMapping]
-> ReadPrec DeleteBasePathMapping
-> ReadPrec [DeleteBasePathMapping]
-> Read 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
(Int -> DeleteBasePathMapping -> ShowS)
-> (DeleteBasePathMapping -> String)
-> ([DeleteBasePathMapping] -> ShowS)
-> Show DeleteBasePathMapping
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. DeleteBasePathMapping -> Rep DeleteBasePathMapping x)
-> (forall x. Rep DeleteBasePathMapping x -> DeleteBasePathMapping)
-> Generic DeleteBasePathMapping
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' - [Required] The domain name of the BasePathMapping resource to delete.
--
-- 'basePath', 'deleteBasePathMapping_basePath' - [Required] 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' :: Text -> Text -> DeleteBasePathMapping
DeleteBasePathMapping'
    { $sel:domainName:DeleteBasePathMapping' :: Text
domainName = Text
pDomainName_,
      $sel:basePath:DeleteBasePathMapping' :: Text
basePath = Text
pBasePath_
    }

-- | [Required] The domain name of the BasePathMapping resource to delete.
deleteBasePathMapping_domainName :: Lens.Lens' DeleteBasePathMapping Prelude.Text
deleteBasePathMapping_domainName :: (Text -> f Text)
-> DeleteBasePathMapping -> f DeleteBasePathMapping
deleteBasePathMapping_domainName = (DeleteBasePathMapping -> Text)
-> (DeleteBasePathMapping -> Text -> DeleteBasePathMapping)
-> Lens DeleteBasePathMapping DeleteBasePathMapping Text Text
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)

-- | [Required] 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 :: (Text -> f Text)
-> DeleteBasePathMapping -> f DeleteBasePathMapping
deleteBasePathMapping_basePath = (DeleteBasePathMapping -> Text)
-> (DeleteBasePathMapping -> Text -> DeleteBasePathMapping)
-> Lens DeleteBasePathMapping DeleteBasePathMapping Text Text
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 :: DeleteBasePathMapping -> Request DeleteBasePathMapping
request = Service -> DeleteBasePathMapping -> Request DeleteBasePathMapping
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteBasePathMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteBasePathMapping)))
response =
    AWSResponse DeleteBasePathMapping
-> Logger
-> Service
-> Proxy DeleteBasePathMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteBasePathMapping)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteBasePathMapping
DeleteBasePathMappingResponse
DeleteBasePathMappingResponse'

instance Prelude.Hashable DeleteBasePathMapping

instance Prelude.NFData DeleteBasePathMapping

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

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

-- | /See:/ 'newDeleteBasePathMappingResponse' smart constructor.
data DeleteBasePathMappingResponse = DeleteBasePathMappingResponse'
  {
  }
  deriving (DeleteBasePathMappingResponse
-> DeleteBasePathMappingResponse -> Bool
(DeleteBasePathMappingResponse
 -> DeleteBasePathMappingResponse -> Bool)
-> (DeleteBasePathMappingResponse
    -> DeleteBasePathMappingResponse -> Bool)
-> Eq DeleteBasePathMappingResponse
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]
(Int -> ReadS DeleteBasePathMappingResponse)
-> ReadS [DeleteBasePathMappingResponse]
-> ReadPrec DeleteBasePathMappingResponse
-> ReadPrec [DeleteBasePathMappingResponse]
-> Read 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
(Int -> DeleteBasePathMappingResponse -> ShowS)
-> (DeleteBasePathMappingResponse -> String)
-> ([DeleteBasePathMappingResponse] -> ShowS)
-> Show DeleteBasePathMappingResponse
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.
 DeleteBasePathMappingResponse
 -> Rep DeleteBasePathMappingResponse x)
-> (forall x.
    Rep DeleteBasePathMappingResponse x
    -> DeleteBasePathMappingResponse)
-> Generic DeleteBasePathMappingResponse
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