{-# 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.DeleteRequestValidator
-- 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 a RequestValidator of a given RestApi.
module Amazonka.APIGateway.DeleteRequestValidator
  ( -- * Creating a Request
    DeleteRequestValidator (..),
    newDeleteRequestValidator,

    -- * Request Lenses
    deleteRequestValidator_restApiId,
    deleteRequestValidator_requestValidatorId,

    -- * Destructuring the Response
    DeleteRequestValidatorResponse (..),
    newDeleteRequestValidatorResponse,
  )
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

-- | Deletes a specified RequestValidator of a given RestApi.
--
-- /See:/ 'newDeleteRequestValidator' smart constructor.
data DeleteRequestValidator = DeleteRequestValidator'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteRequestValidator -> Text
restApiId :: Prelude.Text,
    -- | [Required] The identifier of the RequestValidator to be deleted.
    DeleteRequestValidator -> Text
requestValidatorId :: Prelude.Text
  }
  deriving (DeleteRequestValidator -> DeleteRequestValidator -> Bool
(DeleteRequestValidator -> DeleteRequestValidator -> Bool)
-> (DeleteRequestValidator -> DeleteRequestValidator -> Bool)
-> Eq DeleteRequestValidator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRequestValidator -> DeleteRequestValidator -> Bool
$c/= :: DeleteRequestValidator -> DeleteRequestValidator -> Bool
== :: DeleteRequestValidator -> DeleteRequestValidator -> Bool
$c== :: DeleteRequestValidator -> DeleteRequestValidator -> Bool
Prelude.Eq, ReadPrec [DeleteRequestValidator]
ReadPrec DeleteRequestValidator
Int -> ReadS DeleteRequestValidator
ReadS [DeleteRequestValidator]
(Int -> ReadS DeleteRequestValidator)
-> ReadS [DeleteRequestValidator]
-> ReadPrec DeleteRequestValidator
-> ReadPrec [DeleteRequestValidator]
-> Read DeleteRequestValidator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRequestValidator]
$creadListPrec :: ReadPrec [DeleteRequestValidator]
readPrec :: ReadPrec DeleteRequestValidator
$creadPrec :: ReadPrec DeleteRequestValidator
readList :: ReadS [DeleteRequestValidator]
$creadList :: ReadS [DeleteRequestValidator]
readsPrec :: Int -> ReadS DeleteRequestValidator
$creadsPrec :: Int -> ReadS DeleteRequestValidator
Prelude.Read, Int -> DeleteRequestValidator -> ShowS
[DeleteRequestValidator] -> ShowS
DeleteRequestValidator -> String
(Int -> DeleteRequestValidator -> ShowS)
-> (DeleteRequestValidator -> String)
-> ([DeleteRequestValidator] -> ShowS)
-> Show DeleteRequestValidator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRequestValidator] -> ShowS
$cshowList :: [DeleteRequestValidator] -> ShowS
show :: DeleteRequestValidator -> String
$cshow :: DeleteRequestValidator -> String
showsPrec :: Int -> DeleteRequestValidator -> ShowS
$cshowsPrec :: Int -> DeleteRequestValidator -> ShowS
Prelude.Show, (forall x. DeleteRequestValidator -> Rep DeleteRequestValidator x)
-> (forall x.
    Rep DeleteRequestValidator x -> DeleteRequestValidator)
-> Generic DeleteRequestValidator
forall x. Rep DeleteRequestValidator x -> DeleteRequestValidator
forall x. DeleteRequestValidator -> Rep DeleteRequestValidator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRequestValidator x -> DeleteRequestValidator
$cfrom :: forall x. DeleteRequestValidator -> Rep DeleteRequestValidator x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRequestValidator' 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:
--
-- 'restApiId', 'deleteRequestValidator_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'requestValidatorId', 'deleteRequestValidator_requestValidatorId' - [Required] The identifier of the RequestValidator to be deleted.
newDeleteRequestValidator ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'requestValidatorId'
  Prelude.Text ->
  DeleteRequestValidator
newDeleteRequestValidator :: Text -> Text -> DeleteRequestValidator
newDeleteRequestValidator
  Text
pRestApiId_
  Text
pRequestValidatorId_ =
    DeleteRequestValidator' :: Text -> Text -> DeleteRequestValidator
DeleteRequestValidator'
      { $sel:restApiId:DeleteRequestValidator' :: Text
restApiId = Text
pRestApiId_,
        $sel:requestValidatorId:DeleteRequestValidator' :: Text
requestValidatorId = Text
pRequestValidatorId_
      }

-- | [Required] The string identifier of the associated RestApi.
deleteRequestValidator_restApiId :: Lens.Lens' DeleteRequestValidator Prelude.Text
deleteRequestValidator_restApiId :: (Text -> f Text)
-> DeleteRequestValidator -> f DeleteRequestValidator
deleteRequestValidator_restApiId = (DeleteRequestValidator -> Text)
-> (DeleteRequestValidator -> Text -> DeleteRequestValidator)
-> Lens DeleteRequestValidator DeleteRequestValidator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRequestValidator' {Text
restApiId :: Text
$sel:restApiId:DeleteRequestValidator' :: DeleteRequestValidator -> Text
restApiId} -> Text
restApiId) (\s :: DeleteRequestValidator
s@DeleteRequestValidator' {} Text
a -> DeleteRequestValidator
s {$sel:restApiId:DeleteRequestValidator' :: Text
restApiId = Text
a} :: DeleteRequestValidator)

-- | [Required] The identifier of the RequestValidator to be deleted.
deleteRequestValidator_requestValidatorId :: Lens.Lens' DeleteRequestValidator Prelude.Text
deleteRequestValidator_requestValidatorId :: (Text -> f Text)
-> DeleteRequestValidator -> f DeleteRequestValidator
deleteRequestValidator_requestValidatorId = (DeleteRequestValidator -> Text)
-> (DeleteRequestValidator -> Text -> DeleteRequestValidator)
-> Lens DeleteRequestValidator DeleteRequestValidator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRequestValidator' {Text
requestValidatorId :: Text
$sel:requestValidatorId:DeleteRequestValidator' :: DeleteRequestValidator -> Text
requestValidatorId} -> Text
requestValidatorId) (\s :: DeleteRequestValidator
s@DeleteRequestValidator' {} Text
a -> DeleteRequestValidator
s {$sel:requestValidatorId:DeleteRequestValidator' :: Text
requestValidatorId = Text
a} :: DeleteRequestValidator)

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

instance Prelude.Hashable DeleteRequestValidator

instance Prelude.NFData DeleteRequestValidator

instance Core.ToHeaders DeleteRequestValidator where
  toHeaders :: DeleteRequestValidator -> [Header]
toHeaders =
    [Header] -> DeleteRequestValidator -> [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 DeleteRequestValidator where
  toPath :: DeleteRequestValidator -> ByteString
toPath DeleteRequestValidator' {Text
requestValidatorId :: Text
restApiId :: Text
$sel:requestValidatorId:DeleteRequestValidator' :: DeleteRequestValidator -> Text
$sel:restApiId:DeleteRequestValidator' :: DeleteRequestValidator -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/requestvalidators/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
requestValidatorId
      ]

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

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

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

instance
  Prelude.NFData
    DeleteRequestValidatorResponse