{-# 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.Redshift.DeleteHsmClientCertificate
-- 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 specified HSM client certificate.
module Amazonka.Redshift.DeleteHsmClientCertificate
  ( -- * Creating a Request
    DeleteHsmClientCertificate (..),
    newDeleteHsmClientCertificate,

    -- * Request Lenses
    deleteHsmClientCertificate_hsmClientCertificateIdentifier,

    -- * Destructuring the Response
    DeleteHsmClientCertificateResponse (..),
    newDeleteHsmClientCertificateResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDeleteHsmClientCertificate' smart constructor.
data DeleteHsmClientCertificate = DeleteHsmClientCertificate'
  { -- | The identifier of the HSM client certificate to be deleted.
    DeleteHsmClientCertificate -> Text
hsmClientCertificateIdentifier :: Prelude.Text
  }
  deriving (DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool
(DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool)
-> (DeleteHsmClientCertificate
    -> DeleteHsmClientCertificate -> Bool)
-> Eq DeleteHsmClientCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool
$c/= :: DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool
== :: DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool
$c== :: DeleteHsmClientCertificate -> DeleteHsmClientCertificate -> Bool
Prelude.Eq, ReadPrec [DeleteHsmClientCertificate]
ReadPrec DeleteHsmClientCertificate
Int -> ReadS DeleteHsmClientCertificate
ReadS [DeleteHsmClientCertificate]
(Int -> ReadS DeleteHsmClientCertificate)
-> ReadS [DeleteHsmClientCertificate]
-> ReadPrec DeleteHsmClientCertificate
-> ReadPrec [DeleteHsmClientCertificate]
-> Read DeleteHsmClientCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHsmClientCertificate]
$creadListPrec :: ReadPrec [DeleteHsmClientCertificate]
readPrec :: ReadPrec DeleteHsmClientCertificate
$creadPrec :: ReadPrec DeleteHsmClientCertificate
readList :: ReadS [DeleteHsmClientCertificate]
$creadList :: ReadS [DeleteHsmClientCertificate]
readsPrec :: Int -> ReadS DeleteHsmClientCertificate
$creadsPrec :: Int -> ReadS DeleteHsmClientCertificate
Prelude.Read, Int -> DeleteHsmClientCertificate -> ShowS
[DeleteHsmClientCertificate] -> ShowS
DeleteHsmClientCertificate -> String
(Int -> DeleteHsmClientCertificate -> ShowS)
-> (DeleteHsmClientCertificate -> String)
-> ([DeleteHsmClientCertificate] -> ShowS)
-> Show DeleteHsmClientCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHsmClientCertificate] -> ShowS
$cshowList :: [DeleteHsmClientCertificate] -> ShowS
show :: DeleteHsmClientCertificate -> String
$cshow :: DeleteHsmClientCertificate -> String
showsPrec :: Int -> DeleteHsmClientCertificate -> ShowS
$cshowsPrec :: Int -> DeleteHsmClientCertificate -> ShowS
Prelude.Show, (forall x.
 DeleteHsmClientCertificate -> Rep DeleteHsmClientCertificate x)
-> (forall x.
    Rep DeleteHsmClientCertificate x -> DeleteHsmClientCertificate)
-> Generic DeleteHsmClientCertificate
forall x.
Rep DeleteHsmClientCertificate x -> DeleteHsmClientCertificate
forall x.
DeleteHsmClientCertificate -> Rep DeleteHsmClientCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteHsmClientCertificate x -> DeleteHsmClientCertificate
$cfrom :: forall x.
DeleteHsmClientCertificate -> Rep DeleteHsmClientCertificate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteHsmClientCertificate' 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:
--
-- 'hsmClientCertificateIdentifier', 'deleteHsmClientCertificate_hsmClientCertificateIdentifier' - The identifier of the HSM client certificate to be deleted.
newDeleteHsmClientCertificate ::
  -- | 'hsmClientCertificateIdentifier'
  Prelude.Text ->
  DeleteHsmClientCertificate
newDeleteHsmClientCertificate :: Text -> DeleteHsmClientCertificate
newDeleteHsmClientCertificate
  Text
pHsmClientCertificateIdentifier_ =
    DeleteHsmClientCertificate' :: Text -> DeleteHsmClientCertificate
DeleteHsmClientCertificate'
      { $sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: Text
hsmClientCertificateIdentifier =
          Text
pHsmClientCertificateIdentifier_
      }

-- | The identifier of the HSM client certificate to be deleted.
deleteHsmClientCertificate_hsmClientCertificateIdentifier :: Lens.Lens' DeleteHsmClientCertificate Prelude.Text
deleteHsmClientCertificate_hsmClientCertificateIdentifier :: (Text -> f Text)
-> DeleteHsmClientCertificate -> f DeleteHsmClientCertificate
deleteHsmClientCertificate_hsmClientCertificateIdentifier = (DeleteHsmClientCertificate -> Text)
-> (DeleteHsmClientCertificate
    -> Text -> DeleteHsmClientCertificate)
-> Lens
     DeleteHsmClientCertificate DeleteHsmClientCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHsmClientCertificate' {Text
hsmClientCertificateIdentifier :: Text
$sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: DeleteHsmClientCertificate -> Text
hsmClientCertificateIdentifier} -> Text
hsmClientCertificateIdentifier) (\s :: DeleteHsmClientCertificate
s@DeleteHsmClientCertificate' {} Text
a -> DeleteHsmClientCertificate
s {$sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: Text
hsmClientCertificateIdentifier = Text
a} :: DeleteHsmClientCertificate)

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

instance Prelude.Hashable DeleteHsmClientCertificate

instance Prelude.NFData DeleteHsmClientCertificate

instance Core.ToHeaders DeleteHsmClientCertificate where
  toHeaders :: DeleteHsmClientCertificate -> [Header]
toHeaders = [Header] -> DeleteHsmClientCertificate -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteHsmClientCertificate where
  toPath :: DeleteHsmClientCertificate -> ByteString
toPath = ByteString -> DeleteHsmClientCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DeleteHsmClientCertificate where
  toQuery :: DeleteHsmClientCertificate -> QueryString
toQuery DeleteHsmClientCertificate' {Text
hsmClientCertificateIdentifier :: Text
$sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: DeleteHsmClientCertificate -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteHsmClientCertificate" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"HsmClientCertificateIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
hsmClientCertificateIdentifier
      ]

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

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

instance
  Prelude.NFData
    DeleteHsmClientCertificateResponse