{-# 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.DeleteHsmConfiguration
-- 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 Amazon Redshift HSM configuration.
module Amazonka.Redshift.DeleteHsmConfiguration
  ( -- * Creating a Request
    DeleteHsmConfiguration (..),
    newDeleteHsmConfiguration,

    -- * Request Lenses
    deleteHsmConfiguration_hsmConfigurationIdentifier,

    -- * Destructuring the Response
    DeleteHsmConfigurationResponse (..),
    newDeleteHsmConfigurationResponse,
  )
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:/ 'newDeleteHsmConfiguration' smart constructor.
data DeleteHsmConfiguration = DeleteHsmConfiguration'
  { -- | The identifier of the Amazon Redshift HSM configuration to be deleted.
    DeleteHsmConfiguration -> Text
hsmConfigurationIdentifier :: Prelude.Text
  }
  deriving (DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool
(DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool)
-> (DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool)
-> Eq DeleteHsmConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool
$c/= :: DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool
== :: DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool
$c== :: DeleteHsmConfiguration -> DeleteHsmConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteHsmConfiguration]
ReadPrec DeleteHsmConfiguration
Int -> ReadS DeleteHsmConfiguration
ReadS [DeleteHsmConfiguration]
(Int -> ReadS DeleteHsmConfiguration)
-> ReadS [DeleteHsmConfiguration]
-> ReadPrec DeleteHsmConfiguration
-> ReadPrec [DeleteHsmConfiguration]
-> Read DeleteHsmConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHsmConfiguration]
$creadListPrec :: ReadPrec [DeleteHsmConfiguration]
readPrec :: ReadPrec DeleteHsmConfiguration
$creadPrec :: ReadPrec DeleteHsmConfiguration
readList :: ReadS [DeleteHsmConfiguration]
$creadList :: ReadS [DeleteHsmConfiguration]
readsPrec :: Int -> ReadS DeleteHsmConfiguration
$creadsPrec :: Int -> ReadS DeleteHsmConfiguration
Prelude.Read, Int -> DeleteHsmConfiguration -> ShowS
[DeleteHsmConfiguration] -> ShowS
DeleteHsmConfiguration -> String
(Int -> DeleteHsmConfiguration -> ShowS)
-> (DeleteHsmConfiguration -> String)
-> ([DeleteHsmConfiguration] -> ShowS)
-> Show DeleteHsmConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHsmConfiguration] -> ShowS
$cshowList :: [DeleteHsmConfiguration] -> ShowS
show :: DeleteHsmConfiguration -> String
$cshow :: DeleteHsmConfiguration -> String
showsPrec :: Int -> DeleteHsmConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteHsmConfiguration -> ShowS
Prelude.Show, (forall x. DeleteHsmConfiguration -> Rep DeleteHsmConfiguration x)
-> (forall x.
    Rep DeleteHsmConfiguration x -> DeleteHsmConfiguration)
-> Generic DeleteHsmConfiguration
forall x. Rep DeleteHsmConfiguration x -> DeleteHsmConfiguration
forall x. DeleteHsmConfiguration -> Rep DeleteHsmConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteHsmConfiguration x -> DeleteHsmConfiguration
$cfrom :: forall x. DeleteHsmConfiguration -> Rep DeleteHsmConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteHsmConfiguration' 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:
--
-- 'hsmConfigurationIdentifier', 'deleteHsmConfiguration_hsmConfigurationIdentifier' - The identifier of the Amazon Redshift HSM configuration to be deleted.
newDeleteHsmConfiguration ::
  -- | 'hsmConfigurationIdentifier'
  Prelude.Text ->
  DeleteHsmConfiguration
newDeleteHsmConfiguration :: Text -> DeleteHsmConfiguration
newDeleteHsmConfiguration
  Text
pHsmConfigurationIdentifier_ =
    DeleteHsmConfiguration' :: Text -> DeleteHsmConfiguration
DeleteHsmConfiguration'
      { $sel:hsmConfigurationIdentifier:DeleteHsmConfiguration' :: Text
hsmConfigurationIdentifier =
          Text
pHsmConfigurationIdentifier_
      }

-- | The identifier of the Amazon Redshift HSM configuration to be deleted.
deleteHsmConfiguration_hsmConfigurationIdentifier :: Lens.Lens' DeleteHsmConfiguration Prelude.Text
deleteHsmConfiguration_hsmConfigurationIdentifier :: (Text -> f Text)
-> DeleteHsmConfiguration -> f DeleteHsmConfiguration
deleteHsmConfiguration_hsmConfigurationIdentifier = (DeleteHsmConfiguration -> Text)
-> (DeleteHsmConfiguration -> Text -> DeleteHsmConfiguration)
-> Lens DeleteHsmConfiguration DeleteHsmConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHsmConfiguration' {Text
hsmConfigurationIdentifier :: Text
$sel:hsmConfigurationIdentifier:DeleteHsmConfiguration' :: DeleteHsmConfiguration -> Text
hsmConfigurationIdentifier} -> Text
hsmConfigurationIdentifier) (\s :: DeleteHsmConfiguration
s@DeleteHsmConfiguration' {} Text
a -> DeleteHsmConfiguration
s {$sel:hsmConfigurationIdentifier:DeleteHsmConfiguration' :: Text
hsmConfigurationIdentifier = Text
a} :: DeleteHsmConfiguration)

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

instance Prelude.Hashable DeleteHsmConfiguration

instance Prelude.NFData DeleteHsmConfiguration

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

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

instance Core.ToQuery DeleteHsmConfiguration where
  toQuery :: DeleteHsmConfiguration -> QueryString
toQuery DeleteHsmConfiguration' {Text
hsmConfigurationIdentifier :: Text
$sel:hsmConfigurationIdentifier:DeleteHsmConfiguration' :: DeleteHsmConfiguration -> 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
"DeleteHsmConfiguration" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"HsmConfigurationIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
hsmConfigurationIdentifier
      ]

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

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

instance
  Prelude.NFData
    DeleteHsmConfigurationResponse