{-# 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.SecurityHub.Types.AwsRedshiftClusterHsmStatus
-- 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)
module Amazonka.SecurityHub.Types.AwsRedshiftClusterHsmStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'AwsRedshiftClusterHsmStatus' 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:
--
-- 'status', 'awsRedshiftClusterHsmStatus_status' - Indicates whether the Amazon Redshift cluster has finished applying any
-- HSM settings changes specified in a modify cluster command.
--
-- Type: String
--
-- Valid values: @active@ | @applying@
--
-- 'hsmConfigurationIdentifier', 'awsRedshiftClusterHsmStatus_hsmConfigurationIdentifier' - The name of the HSM configuration that contains the information that the
-- Amazon Redshift cluster can use to retrieve and store keys in an HSM.
--
-- 'hsmClientCertificateIdentifier', 'awsRedshiftClusterHsmStatus_hsmClientCertificateIdentifier' - The name of the HSM client certificate that the Amazon Redshift cluster
-- uses to retrieve the data encryption keys that are stored in an HSM.
newAwsRedshiftClusterHsmStatus ::
  AwsRedshiftClusterHsmStatus
newAwsRedshiftClusterHsmStatus :: AwsRedshiftClusterHsmStatus
newAwsRedshiftClusterHsmStatus =
  AwsRedshiftClusterHsmStatus' :: Maybe Text
-> Maybe Text -> Maybe Text -> AwsRedshiftClusterHsmStatus
AwsRedshiftClusterHsmStatus'
    { $sel:status:AwsRedshiftClusterHsmStatus' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmConfigurationIdentifier:AwsRedshiftClusterHsmStatus' :: Maybe Text
hsmConfigurationIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hsmClientCertificateIdentifier:AwsRedshiftClusterHsmStatus' :: Maybe Text
hsmClientCertificateIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the Amazon Redshift cluster has finished applying any
-- HSM settings changes specified in a modify cluster command.
--
-- Type: String
--
-- Valid values: @active@ | @applying@
awsRedshiftClusterHsmStatus_status :: Lens.Lens' AwsRedshiftClusterHsmStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterHsmStatus_status :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterHsmStatus -> f AwsRedshiftClusterHsmStatus
awsRedshiftClusterHsmStatus_status = (AwsRedshiftClusterHsmStatus -> Maybe Text)
-> (AwsRedshiftClusterHsmStatus
    -> Maybe Text -> AwsRedshiftClusterHsmStatus)
-> Lens
     AwsRedshiftClusterHsmStatus
     AwsRedshiftClusterHsmStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterHsmStatus' {Maybe Text
status :: Maybe Text
$sel:status:AwsRedshiftClusterHsmStatus' :: AwsRedshiftClusterHsmStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsRedshiftClusterHsmStatus
s@AwsRedshiftClusterHsmStatus' {} Maybe Text
a -> AwsRedshiftClusterHsmStatus
s {$sel:status:AwsRedshiftClusterHsmStatus' :: Maybe Text
status = Maybe Text
a} :: AwsRedshiftClusterHsmStatus)

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

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

instance Core.FromJSON AwsRedshiftClusterHsmStatus where
  parseJSON :: Value -> Parser AwsRedshiftClusterHsmStatus
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterHsmStatus)
-> Value
-> Parser AwsRedshiftClusterHsmStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterHsmStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> AwsRedshiftClusterHsmStatus
AwsRedshiftClusterHsmStatus'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> AwsRedshiftClusterHsmStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsRedshiftClusterHsmStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe Text -> Maybe Text -> AwsRedshiftClusterHsmStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRedshiftClusterHsmStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HsmConfigurationIdentifier")
            Parser (Maybe Text -> AwsRedshiftClusterHsmStatus)
-> Parser (Maybe Text) -> Parser AwsRedshiftClusterHsmStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HsmClientCertificateIdentifier")
      )

instance Prelude.Hashable AwsRedshiftClusterHsmStatus

instance Prelude.NFData AwsRedshiftClusterHsmStatus

instance Core.ToJSON AwsRedshiftClusterHsmStatus where
  toJSON :: AwsRedshiftClusterHsmStatus -> Value
toJSON AwsRedshiftClusterHsmStatus' {Maybe Text
hsmClientCertificateIdentifier :: Maybe Text
hsmConfigurationIdentifier :: Maybe Text
status :: Maybe Text
$sel:hsmClientCertificateIdentifier:AwsRedshiftClusterHsmStatus' :: AwsRedshiftClusterHsmStatus -> Maybe Text
$sel:hsmConfigurationIdentifier:AwsRedshiftClusterHsmStatus' :: AwsRedshiftClusterHsmStatus -> Maybe Text
$sel:status:AwsRedshiftClusterHsmStatus' :: AwsRedshiftClusterHsmStatus -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"HsmConfigurationIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
hsmConfigurationIdentifier,
            (Text
"HsmClientCertificateIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
hsmClientCertificateIdentifier
          ]
      )