{-# 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.DeleteClientCertificate
-- 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 ClientCertificate resource.
module Amazonka.APIGateway.DeleteClientCertificate
  ( -- * Creating a Request
    DeleteClientCertificate (..),
    newDeleteClientCertificate,

    -- * Request Lenses
    deleteClientCertificate_clientCertificateId,

    -- * Destructuring the Response
    DeleteClientCertificateResponse (..),
    newDeleteClientCertificateResponse,
  )
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 ClientCertificate resource.
--
-- /See:/ 'newDeleteClientCertificate' smart constructor.
data DeleteClientCertificate = DeleteClientCertificate'
  { -- | [Required] The identifier of the ClientCertificate resource to be
    -- deleted.
    DeleteClientCertificate -> Text
clientCertificateId :: Prelude.Text
  }
  deriving (DeleteClientCertificate -> DeleteClientCertificate -> Bool
(DeleteClientCertificate -> DeleteClientCertificate -> Bool)
-> (DeleteClientCertificate -> DeleteClientCertificate -> Bool)
-> Eq DeleteClientCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteClientCertificate -> DeleteClientCertificate -> Bool
$c/= :: DeleteClientCertificate -> DeleteClientCertificate -> Bool
== :: DeleteClientCertificate -> DeleteClientCertificate -> Bool
$c== :: DeleteClientCertificate -> DeleteClientCertificate -> Bool
Prelude.Eq, ReadPrec [DeleteClientCertificate]
ReadPrec DeleteClientCertificate
Int -> ReadS DeleteClientCertificate
ReadS [DeleteClientCertificate]
(Int -> ReadS DeleteClientCertificate)
-> ReadS [DeleteClientCertificate]
-> ReadPrec DeleteClientCertificate
-> ReadPrec [DeleteClientCertificate]
-> Read DeleteClientCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteClientCertificate]
$creadListPrec :: ReadPrec [DeleteClientCertificate]
readPrec :: ReadPrec DeleteClientCertificate
$creadPrec :: ReadPrec DeleteClientCertificate
readList :: ReadS [DeleteClientCertificate]
$creadList :: ReadS [DeleteClientCertificate]
readsPrec :: Int -> ReadS DeleteClientCertificate
$creadsPrec :: Int -> ReadS DeleteClientCertificate
Prelude.Read, Int -> DeleteClientCertificate -> ShowS
[DeleteClientCertificate] -> ShowS
DeleteClientCertificate -> String
(Int -> DeleteClientCertificate -> ShowS)
-> (DeleteClientCertificate -> String)
-> ([DeleteClientCertificate] -> ShowS)
-> Show DeleteClientCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteClientCertificate] -> ShowS
$cshowList :: [DeleteClientCertificate] -> ShowS
show :: DeleteClientCertificate -> String
$cshow :: DeleteClientCertificate -> String
showsPrec :: Int -> DeleteClientCertificate -> ShowS
$cshowsPrec :: Int -> DeleteClientCertificate -> ShowS
Prelude.Show, (forall x.
 DeleteClientCertificate -> Rep DeleteClientCertificate x)
-> (forall x.
    Rep DeleteClientCertificate x -> DeleteClientCertificate)
-> Generic DeleteClientCertificate
forall x. Rep DeleteClientCertificate x -> DeleteClientCertificate
forall x. DeleteClientCertificate -> Rep DeleteClientCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteClientCertificate x -> DeleteClientCertificate
$cfrom :: forall x. DeleteClientCertificate -> Rep DeleteClientCertificate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteClientCertificate' 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:
--
-- 'clientCertificateId', 'deleteClientCertificate_clientCertificateId' - [Required] The identifier of the ClientCertificate resource to be
-- deleted.
newDeleteClientCertificate ::
  -- | 'clientCertificateId'
  Prelude.Text ->
  DeleteClientCertificate
newDeleteClientCertificate :: Text -> DeleteClientCertificate
newDeleteClientCertificate Text
pClientCertificateId_ =
  DeleteClientCertificate' :: Text -> DeleteClientCertificate
DeleteClientCertificate'
    { $sel:clientCertificateId:DeleteClientCertificate' :: Text
clientCertificateId =
        Text
pClientCertificateId_
    }

-- | [Required] The identifier of the ClientCertificate resource to be
-- deleted.
deleteClientCertificate_clientCertificateId :: Lens.Lens' DeleteClientCertificate Prelude.Text
deleteClientCertificate_clientCertificateId :: (Text -> f Text)
-> DeleteClientCertificate -> f DeleteClientCertificate
deleteClientCertificate_clientCertificateId = (DeleteClientCertificate -> Text)
-> (DeleteClientCertificate -> Text -> DeleteClientCertificate)
-> Lens DeleteClientCertificate DeleteClientCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClientCertificate' {Text
clientCertificateId :: Text
$sel:clientCertificateId:DeleteClientCertificate' :: DeleteClientCertificate -> Text
clientCertificateId} -> Text
clientCertificateId) (\s :: DeleteClientCertificate
s@DeleteClientCertificate' {} Text
a -> DeleteClientCertificate
s {$sel:clientCertificateId:DeleteClientCertificate' :: Text
clientCertificateId = Text
a} :: DeleteClientCertificate)

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

instance Prelude.Hashable DeleteClientCertificate

instance Prelude.NFData DeleteClientCertificate

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

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

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

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

instance
  Prelude.NFData
    DeleteClientCertificateResponse