{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.HsmStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Redshift.Types.HsmStatus 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.Internal

-- | Describes the status of changes to HSM settings.
--
-- /See:/ 'newHsmStatus' smart constructor.
data HsmStatus = HsmStatus'
  { -- | Specifies the name of the HSM client certificate the Amazon Redshift
    -- cluster uses to retrieve the data encryption keys stored in an HSM.
    HsmStatus -> Maybe Text
hsmClientCertificateIdentifier :: Prelude.Maybe Prelude.Text,
    -- | Specifies the name of the HSM configuration that contains the
    -- information the Amazon Redshift cluster can use to retrieve and store
    -- keys in an HSM.
    HsmStatus -> Maybe Text
hsmConfigurationIdentifier :: Prelude.Maybe Prelude.Text,
    -- | Reports whether the Amazon Redshift cluster has finished applying any
    -- HSM settings changes specified in a modify cluster command.
    --
    -- Values: active, applying
    HsmStatus -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (HsmStatus -> HsmStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HsmStatus -> HsmStatus -> Bool
$c/= :: HsmStatus -> HsmStatus -> Bool
== :: HsmStatus -> HsmStatus -> Bool
$c== :: HsmStatus -> HsmStatus -> Bool
Prelude.Eq, ReadPrec [HsmStatus]
ReadPrec HsmStatus
Int -> ReadS HsmStatus
ReadS [HsmStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HsmStatus]
$creadListPrec :: ReadPrec [HsmStatus]
readPrec :: ReadPrec HsmStatus
$creadPrec :: ReadPrec HsmStatus
readList :: ReadS [HsmStatus]
$creadList :: ReadS [HsmStatus]
readsPrec :: Int -> ReadS HsmStatus
$creadsPrec :: Int -> ReadS HsmStatus
Prelude.Read, Int -> HsmStatus -> ShowS
[HsmStatus] -> ShowS
HsmStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HsmStatus] -> ShowS
$cshowList :: [HsmStatus] -> ShowS
show :: HsmStatus -> String
$cshow :: HsmStatus -> String
showsPrec :: Int -> HsmStatus -> ShowS
$cshowsPrec :: Int -> HsmStatus -> ShowS
Prelude.Show, forall x. Rep HsmStatus x -> HsmStatus
forall x. HsmStatus -> Rep HsmStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HsmStatus x -> HsmStatus
$cfrom :: forall x. HsmStatus -> Rep HsmStatus x
Prelude.Generic)

-- |
-- Create a value of 'HsmStatus' 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', 'hsmStatus_hsmClientCertificateIdentifier' - Specifies the name of the HSM client certificate the Amazon Redshift
-- cluster uses to retrieve the data encryption keys stored in an HSM.
--
-- 'hsmConfigurationIdentifier', 'hsmStatus_hsmConfigurationIdentifier' - Specifies the name of the HSM configuration that contains the
-- information the Amazon Redshift cluster can use to retrieve and store
-- keys in an HSM.
--
-- 'status', 'hsmStatus_status' - Reports whether the Amazon Redshift cluster has finished applying any
-- HSM settings changes specified in a modify cluster command.
--
-- Values: active, applying
newHsmStatus ::
  HsmStatus
newHsmStatus :: HsmStatus
newHsmStatus =
  HsmStatus'
    { $sel:hsmClientCertificateIdentifier:HsmStatus' :: Maybe Text
hsmClientCertificateIdentifier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:hsmConfigurationIdentifier:HsmStatus' :: Maybe Text
hsmConfigurationIdentifier = forall a. Maybe a
Prelude.Nothing,
      $sel:status:HsmStatus' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the name of the HSM client certificate the Amazon Redshift
-- cluster uses to retrieve the data encryption keys stored in an HSM.
hsmStatus_hsmClientCertificateIdentifier :: Lens.Lens' HsmStatus (Prelude.Maybe Prelude.Text)
hsmStatus_hsmClientCertificateIdentifier :: Lens' HsmStatus (Maybe Text)
hsmStatus_hsmClientCertificateIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HsmStatus' {Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:hsmClientCertificateIdentifier:HsmStatus' :: HsmStatus -> Maybe Text
hsmClientCertificateIdentifier} -> Maybe Text
hsmClientCertificateIdentifier) (\s :: HsmStatus
s@HsmStatus' {} Maybe Text
a -> HsmStatus
s {$sel:hsmClientCertificateIdentifier:HsmStatus' :: Maybe Text
hsmClientCertificateIdentifier = Maybe Text
a} :: HsmStatus)

-- | Specifies the name of the HSM configuration that contains the
-- information the Amazon Redshift cluster can use to retrieve and store
-- keys in an HSM.
hsmStatus_hsmConfigurationIdentifier :: Lens.Lens' HsmStatus (Prelude.Maybe Prelude.Text)
hsmStatus_hsmConfigurationIdentifier :: Lens' HsmStatus (Maybe Text)
hsmStatus_hsmConfigurationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HsmStatus' {Maybe Text
hsmConfigurationIdentifier :: Maybe Text
$sel:hsmConfigurationIdentifier:HsmStatus' :: HsmStatus -> Maybe Text
hsmConfigurationIdentifier} -> Maybe Text
hsmConfigurationIdentifier) (\s :: HsmStatus
s@HsmStatus' {} Maybe Text
a -> HsmStatus
s {$sel:hsmConfigurationIdentifier:HsmStatus' :: Maybe Text
hsmConfigurationIdentifier = Maybe Text
a} :: HsmStatus)

-- | Reports whether the Amazon Redshift cluster has finished applying any
-- HSM settings changes specified in a modify cluster command.
--
-- Values: active, applying
hsmStatus_status :: Lens.Lens' HsmStatus (Prelude.Maybe Prelude.Text)
hsmStatus_status :: Lens' HsmStatus (Maybe Text)
hsmStatus_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HsmStatus' {Maybe Text
status :: Maybe Text
$sel:status:HsmStatus' :: HsmStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: HsmStatus
s@HsmStatus' {} Maybe Text
a -> HsmStatus
s {$sel:status:HsmStatus' :: Maybe Text
status = Maybe Text
a} :: HsmStatus)

instance Data.FromXML HsmStatus where
  parseXML :: [Node] -> Either String HsmStatus
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> Maybe Text -> HsmStatus
HsmStatus'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"HsmClientCertificateIdentifier")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"HsmConfigurationIdentifier")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Status")

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

instance Prelude.NFData HsmStatus where
  rnf :: HsmStatus -> ()
rnf HsmStatus' {Maybe Text
status :: Maybe Text
hsmConfigurationIdentifier :: Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
$sel:status:HsmStatus' :: HsmStatus -> Maybe Text
$sel:hsmConfigurationIdentifier:HsmStatus' :: HsmStatus -> Maybe Text
$sel:hsmClientCertificateIdentifier:HsmStatus' :: HsmStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hsmClientCertificateIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hsmConfigurationIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status