{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
      { $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 :: Lens' DeleteHsmClientCertificate Text
deleteHsmClientCertificate_hsmClientCertificateIdentifier = 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 :: (Service -> Service)
-> DeleteHsmClientCertificate -> Request DeleteHsmClientCertificate
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteHsmClientCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteHsmClientCertificate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteHsmClientCertificateResponse
DeleteHsmClientCertificateResponse'

instance Prelude.Hashable DeleteHsmClientCertificate where
  hashWithSalt :: Int -> DeleteHsmClientCertificate -> Int
hashWithSalt Int
_salt DeleteHsmClientCertificate' {Text
hsmClientCertificateIdentifier :: Text
$sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: DeleteHsmClientCertificate -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hsmClientCertificateIdentifier

instance Prelude.NFData DeleteHsmClientCertificate where
  rnf :: DeleteHsmClientCertificate -> ()
rnf DeleteHsmClientCertificate' {Text
hsmClientCertificateIdentifier :: Text
$sel:hsmClientCertificateIdentifier:DeleteHsmClientCertificate' :: DeleteHsmClientCertificate -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
hsmClientCertificateIdentifier

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

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

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

-- | /See:/ 'newDeleteHsmClientCertificateResponse' smart constructor.
data DeleteHsmClientCertificateResponse = DeleteHsmClientCertificateResponse'
  {
  }
  deriving (DeleteHsmClientCertificateResponse
-> DeleteHsmClientCertificateResponse -> Bool
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]
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
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.
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
  where
  rnf :: DeleteHsmClientCertificateResponse -> ()
rnf DeleteHsmClientCertificateResponse
_ = ()