{-# 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.DeleteAuthorizer
-- 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 an existing Authorizer resource.
--
-- <https://docs.aws.amazon.com/cli/latest/reference/apigateway/delete-authorizer.html AWS CLI>
module Amazonka.APIGateway.DeleteAuthorizer
  ( -- * Creating a Request
    DeleteAuthorizer (..),
    newDeleteAuthorizer,

    -- * Request Lenses
    deleteAuthorizer_restApiId,
    deleteAuthorizer_authorizerId,

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

-- | Request to delete an existing Authorizer resource.
--
-- /See:/ 'newDeleteAuthorizer' smart constructor.
data DeleteAuthorizer = DeleteAuthorizer'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteAuthorizer -> Text
restApiId :: Prelude.Text,
    -- | [Required] The identifier of the Authorizer resource.
    DeleteAuthorizer -> Text
authorizerId :: Prelude.Text
  }
  deriving (DeleteAuthorizer -> DeleteAuthorizer -> Bool
(DeleteAuthorizer -> DeleteAuthorizer -> Bool)
-> (DeleteAuthorizer -> DeleteAuthorizer -> Bool)
-> Eq DeleteAuthorizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAuthorizer -> DeleteAuthorizer -> Bool
$c/= :: DeleteAuthorizer -> DeleteAuthorizer -> Bool
== :: DeleteAuthorizer -> DeleteAuthorizer -> Bool
$c== :: DeleteAuthorizer -> DeleteAuthorizer -> Bool
Prelude.Eq, ReadPrec [DeleteAuthorizer]
ReadPrec DeleteAuthorizer
Int -> ReadS DeleteAuthorizer
ReadS [DeleteAuthorizer]
(Int -> ReadS DeleteAuthorizer)
-> ReadS [DeleteAuthorizer]
-> ReadPrec DeleteAuthorizer
-> ReadPrec [DeleteAuthorizer]
-> Read DeleteAuthorizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAuthorizer]
$creadListPrec :: ReadPrec [DeleteAuthorizer]
readPrec :: ReadPrec DeleteAuthorizer
$creadPrec :: ReadPrec DeleteAuthorizer
readList :: ReadS [DeleteAuthorizer]
$creadList :: ReadS [DeleteAuthorizer]
readsPrec :: Int -> ReadS DeleteAuthorizer
$creadsPrec :: Int -> ReadS DeleteAuthorizer
Prelude.Read, Int -> DeleteAuthorizer -> ShowS
[DeleteAuthorizer] -> ShowS
DeleteAuthorizer -> String
(Int -> DeleteAuthorizer -> ShowS)
-> (DeleteAuthorizer -> String)
-> ([DeleteAuthorizer] -> ShowS)
-> Show DeleteAuthorizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAuthorizer] -> ShowS
$cshowList :: [DeleteAuthorizer] -> ShowS
show :: DeleteAuthorizer -> String
$cshow :: DeleteAuthorizer -> String
showsPrec :: Int -> DeleteAuthorizer -> ShowS
$cshowsPrec :: Int -> DeleteAuthorizer -> ShowS
Prelude.Show, (forall x. DeleteAuthorizer -> Rep DeleteAuthorizer x)
-> (forall x. Rep DeleteAuthorizer x -> DeleteAuthorizer)
-> Generic DeleteAuthorizer
forall x. Rep DeleteAuthorizer x -> DeleteAuthorizer
forall x. DeleteAuthorizer -> Rep DeleteAuthorizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAuthorizer x -> DeleteAuthorizer
$cfrom :: forall x. DeleteAuthorizer -> Rep DeleteAuthorizer x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAuthorizer' 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', 'deleteAuthorizer_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'authorizerId', 'deleteAuthorizer_authorizerId' - [Required] The identifier of the Authorizer resource.
newDeleteAuthorizer ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'authorizerId'
  Prelude.Text ->
  DeleteAuthorizer
newDeleteAuthorizer :: Text -> Text -> DeleteAuthorizer
newDeleteAuthorizer Text
pRestApiId_ Text
pAuthorizerId_ =
  DeleteAuthorizer' :: Text -> Text -> DeleteAuthorizer
DeleteAuthorizer'
    { $sel:restApiId:DeleteAuthorizer' :: Text
restApiId = Text
pRestApiId_,
      $sel:authorizerId:DeleteAuthorizer' :: Text
authorizerId = Text
pAuthorizerId_
    }

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

-- | [Required] The identifier of the Authorizer resource.
deleteAuthorizer_authorizerId :: Lens.Lens' DeleteAuthorizer Prelude.Text
deleteAuthorizer_authorizerId :: (Text -> f Text) -> DeleteAuthorizer -> f DeleteAuthorizer
deleteAuthorizer_authorizerId = (DeleteAuthorizer -> Text)
-> (DeleteAuthorizer -> Text -> DeleteAuthorizer)
-> Lens DeleteAuthorizer DeleteAuthorizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAuthorizer' {Text
authorizerId :: Text
$sel:authorizerId:DeleteAuthorizer' :: DeleteAuthorizer -> Text
authorizerId} -> Text
authorizerId) (\s :: DeleteAuthorizer
s@DeleteAuthorizer' {} Text
a -> DeleteAuthorizer
s {$sel:authorizerId:DeleteAuthorizer' :: Text
authorizerId = Text
a} :: DeleteAuthorizer)

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

instance Prelude.Hashable DeleteAuthorizer

instance Prelude.NFData DeleteAuthorizer

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

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

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

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

instance Prelude.NFData DeleteAuthorizerResponse