{-# 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.KMS.Types.KeyMetadata
-- 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.KMS.Types.KeyMetadata where

import qualified Amazonka.Core as Core
import Amazonka.KMS.Types.CustomerMasterKeySpec
import Amazonka.KMS.Types.EncryptionAlgorithmSpec
import Amazonka.KMS.Types.ExpirationModelType
import Amazonka.KMS.Types.KeyManagerType
import Amazonka.KMS.Types.KeySpec
import Amazonka.KMS.Types.KeyState
import Amazonka.KMS.Types.KeyUsageType
import Amazonka.KMS.Types.MultiRegionConfiguration
import Amazonka.KMS.Types.OriginType
import Amazonka.KMS.Types.SigningAlgorithmSpec
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains metadata about a KMS key.
--
-- This data type is used as a response element for the CreateKey and
-- DescribeKey operations.
--
-- /See:/ 'newKeyMetadata' smart constructor.
data KeyMetadata = KeyMetadata'
  { -- | The source of the key material for the KMS key. When this value is
    -- @AWS_KMS@, KMS created the key material. When this value is @EXTERNAL@,
    -- the key material was imported or the KMS key doesn\'t have any key
    -- material. When this value is @AWS_CLOUDHSM@, the key material was
    -- created in the CloudHSM cluster associated with a custom key store.
    KeyMetadata -> Maybe OriginType
origin :: Prelude.Maybe OriginType,
    -- | Specifies whether the KMS key\'s key material expires. This value is
    -- present only when @Origin@ is @EXTERNAL@, otherwise this value is
    -- omitted.
    KeyMetadata -> Maybe ExpirationModelType
expirationModel :: Prelude.Maybe ExpirationModelType,
    -- | The manager of the KMS key. KMS keys in your Amazon Web Services account
    -- are either customer managed or Amazon Web Services managed. For more
    -- information about the difference, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys KMS keys>
    -- in the /Key Management Service Developer Guide/.
    KeyMetadata -> Maybe KeyManagerType
keyManager :: Prelude.Maybe KeyManagerType,
    -- | Describes the type of key material in the KMS key.
    KeyMetadata -> Maybe KeySpec
keySpec :: Prelude.Maybe KeySpec,
    -- | Instead, use the @KeySpec@ field.
    --
    -- The @KeySpec@ and @CustomerMasterKeySpec@ fields have the same value. We
    -- recommend that you use the @KeySpec@ field in your code. However, to
    -- avoid breaking changes, KMS will support both fields.
    KeyMetadata -> Maybe CustomerMasterKeySpec
customerMasterKeySpec :: Prelude.Maybe CustomerMasterKeySpec,
    -- | Specifies whether the KMS key is enabled. When @KeyState@ is @Enabled@
    -- this value is true, otherwise it is false.
    KeyMetadata -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The time at which the imported key material expires. When the key
    -- material expires, KMS deletes the key material and the KMS key becomes
    -- unusable. This value is present only for KMS keys whose @Origin@ is
    -- @EXTERNAL@ and whose @ExpirationModel@ is @KEY_MATERIAL_EXPIRES@,
    -- otherwise this value is omitted.
    KeyMetadata -> Maybe POSIX
validTo :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the KMS key. For examples, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms Key Management Service (KMS)>
    -- in the Example ARNs section of the /Amazon Web Services General
    -- Reference/.
    KeyMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The current status of the KMS key.
    --
    -- For more information about how key state affects the use of a KMS key,
    -- see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html Key state: Effect on your KMS key>
    -- in the /Key Management Service Developer Guide/.
    KeyMetadata -> Maybe KeyState
keyState :: Prelude.Maybe KeyState,
    -- | The encryption algorithms that the KMS key supports. You cannot use the
    -- KMS key with other encryption algorithms within KMS.
    --
    -- This value is present only when the @KeyUsage@ of the KMS key is
    -- @ENCRYPT_DECRYPT@.
    KeyMetadata -> Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms :: Prelude.Maybe [EncryptionAlgorithmSpec],
    -- | The twelve-digit account ID of the Amazon Web Services account that owns
    -- the KMS key.
    KeyMetadata -> Maybe Text
aWSAccountId :: Prelude.Maybe Prelude.Text,
    -- | The signing algorithms that the KMS key supports. You cannot use the KMS
    -- key with other signing algorithms within KMS.
    --
    -- This field appears only when the @KeyUsage@ of the KMS key is
    -- @SIGN_VERIFY@.
    KeyMetadata -> Maybe [SigningAlgorithmSpec]
signingAlgorithms :: Prelude.Maybe [SigningAlgorithmSpec],
    -- | The waiting period before the primary key in a multi-Region key is
    -- deleted. This waiting period begins when the last of its replica keys is
    -- deleted. This value is present only when the @KeyState@ of the KMS key
    -- is @PendingReplicaDeletion@. That indicates that the KMS key is the
    -- primary key in a multi-Region key, it is scheduled for deletion, and it
    -- still has existing replica keys.
    --
    -- When a single-Region KMS key or a multi-Region replica key is scheduled
    -- for deletion, its deletion date is displayed in the @DeletionDate@
    -- field. However, when the primary key in a multi-Region key is scheduled
    -- for deletion, its waiting period doesn\'t begin until all of its replica
    -- keys are deleted. This value displays that waiting period. When the last
    -- replica key in the multi-Region key is deleted, the @KeyState@ of the
    -- scheduled primary key changes from @PendingReplicaDeletion@ to
    -- @PendingDeletion@ and the deletion date appears in the @DeletionDate@
    -- field.
    KeyMetadata -> Maybe Natural
pendingDeletionWindowInDays :: Prelude.Maybe Prelude.Natural,
    -- | The
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations cryptographic operations>
    -- for which you can use the KMS key.
    KeyMetadata -> Maybe KeyUsageType
keyUsage :: Prelude.Maybe KeyUsageType,
    -- | The date and time when the KMS key was created.
    KeyMetadata -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The date and time after which KMS deletes this KMS key. This value is
    -- present only when the KMS key is scheduled for deletion, that is, when
    -- its @KeyState@ is @PendingDeletion@.
    --
    -- When the primary key in a multi-Region key is scheduled for deletion but
    -- still has replica keys, its key state is @PendingReplicaDeletion@ and
    -- the length of its waiting period is displayed in the
    -- @PendingDeletionWindowInDays@ field.
    KeyMetadata -> Maybe POSIX
deletionDate :: Prelude.Maybe Core.POSIX,
    -- | The cluster ID of the CloudHSM cluster that contains the key material
    -- for the KMS key. When you create a KMS key in a
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>,
    -- KMS creates the key material for the KMS key in the associated CloudHSM
    -- cluster. This value is present only when the KMS key is created in a
    -- custom key store.
    KeyMetadata -> Maybe Text
cloudHsmClusterId :: Prelude.Maybe Prelude.Text,
    -- | The description of the KMS key.
    KeyMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>
    -- that contains the KMS key. This value is present only when the KMS key
    -- is created in a custom key store.
    KeyMetadata -> Maybe Text
customKeyStoreId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the KMS key is a multi-Region (@True@) or regional
    -- (@False@) key. This value is @True@ for multi-Region primary and replica
    -- keys and @False@ for regional KMS keys.
    --
    -- For more information about multi-Region keys, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
    -- in the /Key Management Service Developer Guide/.
    KeyMetadata -> Maybe Bool
multiRegion :: Prelude.Maybe Prelude.Bool,
    -- | Lists the primary and replica keys in same multi-Region key. This field
    -- is present only when the value of the @MultiRegion@ field is @True@.
    --
    -- For more information about any listed KMS key, use the DescribeKey
    -- operation.
    --
    -- -   @MultiRegionKeyType@ indicates whether the KMS key is a @PRIMARY@ or
    --     @REPLICA@ key.
    --
    -- -   @PrimaryKey@ displays the key ARN and Region of the primary key.
    --     This field displays the current KMS key if it is the primary key.
    --
    -- -   @ReplicaKeys@ displays the key ARNs and Regions of all replica keys.
    --     This field includes the current KMS key if it is a replica key.
    KeyMetadata -> Maybe MultiRegionConfiguration
multiRegionConfiguration :: Prelude.Maybe MultiRegionConfiguration,
    -- | The globally unique identifier for the KMS key.
    KeyMetadata -> Text
keyId :: Prelude.Text
  }
  deriving (KeyMetadata -> KeyMetadata -> Bool
(KeyMetadata -> KeyMetadata -> Bool)
-> (KeyMetadata -> KeyMetadata -> Bool) -> Eq KeyMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyMetadata -> KeyMetadata -> Bool
$c/= :: KeyMetadata -> KeyMetadata -> Bool
== :: KeyMetadata -> KeyMetadata -> Bool
$c== :: KeyMetadata -> KeyMetadata -> Bool
Prelude.Eq, ReadPrec [KeyMetadata]
ReadPrec KeyMetadata
Int -> ReadS KeyMetadata
ReadS [KeyMetadata]
(Int -> ReadS KeyMetadata)
-> ReadS [KeyMetadata]
-> ReadPrec KeyMetadata
-> ReadPrec [KeyMetadata]
-> Read KeyMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeyMetadata]
$creadListPrec :: ReadPrec [KeyMetadata]
readPrec :: ReadPrec KeyMetadata
$creadPrec :: ReadPrec KeyMetadata
readList :: ReadS [KeyMetadata]
$creadList :: ReadS [KeyMetadata]
readsPrec :: Int -> ReadS KeyMetadata
$creadsPrec :: Int -> ReadS KeyMetadata
Prelude.Read, Int -> KeyMetadata -> ShowS
[KeyMetadata] -> ShowS
KeyMetadata -> String
(Int -> KeyMetadata -> ShowS)
-> (KeyMetadata -> String)
-> ([KeyMetadata] -> ShowS)
-> Show KeyMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyMetadata] -> ShowS
$cshowList :: [KeyMetadata] -> ShowS
show :: KeyMetadata -> String
$cshow :: KeyMetadata -> String
showsPrec :: Int -> KeyMetadata -> ShowS
$cshowsPrec :: Int -> KeyMetadata -> ShowS
Prelude.Show, (forall x. KeyMetadata -> Rep KeyMetadata x)
-> (forall x. Rep KeyMetadata x -> KeyMetadata)
-> Generic KeyMetadata
forall x. Rep KeyMetadata x -> KeyMetadata
forall x. KeyMetadata -> Rep KeyMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyMetadata x -> KeyMetadata
$cfrom :: forall x. KeyMetadata -> Rep KeyMetadata x
Prelude.Generic)

-- |
-- Create a value of 'KeyMetadata' 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:
--
-- 'origin', 'keyMetadata_origin' - The source of the key material for the KMS key. When this value is
-- @AWS_KMS@, KMS created the key material. When this value is @EXTERNAL@,
-- the key material was imported or the KMS key doesn\'t have any key
-- material. When this value is @AWS_CLOUDHSM@, the key material was
-- created in the CloudHSM cluster associated with a custom key store.
--
-- 'expirationModel', 'keyMetadata_expirationModel' - Specifies whether the KMS key\'s key material expires. This value is
-- present only when @Origin@ is @EXTERNAL@, otherwise this value is
-- omitted.
--
-- 'keyManager', 'keyMetadata_keyManager' - The manager of the KMS key. KMS keys in your Amazon Web Services account
-- are either customer managed or Amazon Web Services managed. For more
-- information about the difference, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys KMS keys>
-- in the /Key Management Service Developer Guide/.
--
-- 'keySpec', 'keyMetadata_keySpec' - Describes the type of key material in the KMS key.
--
-- 'customerMasterKeySpec', 'keyMetadata_customerMasterKeySpec' - Instead, use the @KeySpec@ field.
--
-- The @KeySpec@ and @CustomerMasterKeySpec@ fields have the same value. We
-- recommend that you use the @KeySpec@ field in your code. However, to
-- avoid breaking changes, KMS will support both fields.
--
-- 'enabled', 'keyMetadata_enabled' - Specifies whether the KMS key is enabled. When @KeyState@ is @Enabled@
-- this value is true, otherwise it is false.
--
-- 'validTo', 'keyMetadata_validTo' - The time at which the imported key material expires. When the key
-- material expires, KMS deletes the key material and the KMS key becomes
-- unusable. This value is present only for KMS keys whose @Origin@ is
-- @EXTERNAL@ and whose @ExpirationModel@ is @KEY_MATERIAL_EXPIRES@,
-- otherwise this value is omitted.
--
-- 'arn', 'keyMetadata_arn' - The Amazon Resource Name (ARN) of the KMS key. For examples, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms Key Management Service (KMS)>
-- in the Example ARNs section of the /Amazon Web Services General
-- Reference/.
--
-- 'keyState', 'keyMetadata_keyState' - The current status of the KMS key.
--
-- For more information about how key state affects the use of a KMS key,
-- see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html Key state: Effect on your KMS key>
-- in the /Key Management Service Developer Guide/.
--
-- 'encryptionAlgorithms', 'keyMetadata_encryptionAlgorithms' - The encryption algorithms that the KMS key supports. You cannot use the
-- KMS key with other encryption algorithms within KMS.
--
-- This value is present only when the @KeyUsage@ of the KMS key is
-- @ENCRYPT_DECRYPT@.
--
-- 'aWSAccountId', 'keyMetadata_aWSAccountId' - The twelve-digit account ID of the Amazon Web Services account that owns
-- the KMS key.
--
-- 'signingAlgorithms', 'keyMetadata_signingAlgorithms' - The signing algorithms that the KMS key supports. You cannot use the KMS
-- key with other signing algorithms within KMS.
--
-- This field appears only when the @KeyUsage@ of the KMS key is
-- @SIGN_VERIFY@.
--
-- 'pendingDeletionWindowInDays', 'keyMetadata_pendingDeletionWindowInDays' - The waiting period before the primary key in a multi-Region key is
-- deleted. This waiting period begins when the last of its replica keys is
-- deleted. This value is present only when the @KeyState@ of the KMS key
-- is @PendingReplicaDeletion@. That indicates that the KMS key is the
-- primary key in a multi-Region key, it is scheduled for deletion, and it
-- still has existing replica keys.
--
-- When a single-Region KMS key or a multi-Region replica key is scheduled
-- for deletion, its deletion date is displayed in the @DeletionDate@
-- field. However, when the primary key in a multi-Region key is scheduled
-- for deletion, its waiting period doesn\'t begin until all of its replica
-- keys are deleted. This value displays that waiting period. When the last
-- replica key in the multi-Region key is deleted, the @KeyState@ of the
-- scheduled primary key changes from @PendingReplicaDeletion@ to
-- @PendingDeletion@ and the deletion date appears in the @DeletionDate@
-- field.
--
-- 'keyUsage', 'keyMetadata_keyUsage' - The
-- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations cryptographic operations>
-- for which you can use the KMS key.
--
-- 'creationDate', 'keyMetadata_creationDate' - The date and time when the KMS key was created.
--
-- 'deletionDate', 'keyMetadata_deletionDate' - The date and time after which KMS deletes this KMS key. This value is
-- present only when the KMS key is scheduled for deletion, that is, when
-- its @KeyState@ is @PendingDeletion@.
--
-- When the primary key in a multi-Region key is scheduled for deletion but
-- still has replica keys, its key state is @PendingReplicaDeletion@ and
-- the length of its waiting period is displayed in the
-- @PendingDeletionWindowInDays@ field.
--
-- 'cloudHsmClusterId', 'keyMetadata_cloudHsmClusterId' - The cluster ID of the CloudHSM cluster that contains the key material
-- for the KMS key. When you create a KMS key in a
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>,
-- KMS creates the key material for the KMS key in the associated CloudHSM
-- cluster. This value is present only when the KMS key is created in a
-- custom key store.
--
-- 'description', 'keyMetadata_description' - The description of the KMS key.
--
-- 'customKeyStoreId', 'keyMetadata_customKeyStoreId' - A unique identifier for the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>
-- that contains the KMS key. This value is present only when the KMS key
-- is created in a custom key store.
--
-- 'multiRegion', 'keyMetadata_multiRegion' - Indicates whether the KMS key is a multi-Region (@True@) or regional
-- (@False@) key. This value is @True@ for multi-Region primary and replica
-- keys and @False@ for regional KMS keys.
--
-- For more information about multi-Region keys, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
-- in the /Key Management Service Developer Guide/.
--
-- 'multiRegionConfiguration', 'keyMetadata_multiRegionConfiguration' - Lists the primary and replica keys in same multi-Region key. This field
-- is present only when the value of the @MultiRegion@ field is @True@.
--
-- For more information about any listed KMS key, use the DescribeKey
-- operation.
--
-- -   @MultiRegionKeyType@ indicates whether the KMS key is a @PRIMARY@ or
--     @REPLICA@ key.
--
-- -   @PrimaryKey@ displays the key ARN and Region of the primary key.
--     This field displays the current KMS key if it is the primary key.
--
-- -   @ReplicaKeys@ displays the key ARNs and Regions of all replica keys.
--     This field includes the current KMS key if it is a replica key.
--
-- 'keyId', 'keyMetadata_keyId' - The globally unique identifier for the KMS key.
newKeyMetadata ::
  -- | 'keyId'
  Prelude.Text ->
  KeyMetadata
newKeyMetadata :: Text -> KeyMetadata
newKeyMetadata Text
pKeyId_ =
  KeyMetadata' :: Maybe OriginType
-> Maybe ExpirationModelType
-> Maybe KeyManagerType
-> Maybe KeySpec
-> Maybe CustomerMasterKeySpec
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> Maybe KeyState
-> Maybe [EncryptionAlgorithmSpec]
-> Maybe Text
-> Maybe [SigningAlgorithmSpec]
-> Maybe Natural
-> Maybe KeyUsageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe MultiRegionConfiguration
-> Text
-> KeyMetadata
KeyMetadata'
    { $sel:origin:KeyMetadata' :: Maybe OriginType
origin = Maybe OriginType
forall a. Maybe a
Prelude.Nothing,
      $sel:expirationModel:KeyMetadata' :: Maybe ExpirationModelType
expirationModel = Maybe ExpirationModelType
forall a. Maybe a
Prelude.Nothing,
      $sel:keyManager:KeyMetadata' :: Maybe KeyManagerType
keyManager = Maybe KeyManagerType
forall a. Maybe a
Prelude.Nothing,
      $sel:keySpec:KeyMetadata' :: Maybe KeySpec
keySpec = Maybe KeySpec
forall a. Maybe a
Prelude.Nothing,
      $sel:customerMasterKeySpec:KeyMetadata' :: Maybe CustomerMasterKeySpec
customerMasterKeySpec = Maybe CustomerMasterKeySpec
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:KeyMetadata' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:validTo:KeyMetadata' :: Maybe POSIX
validTo = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:KeyMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keyState:KeyMetadata' :: Maybe KeyState
keyState = Maybe KeyState
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionAlgorithms:KeyMetadata' :: Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms = Maybe [EncryptionAlgorithmSpec]
forall a. Maybe a
Prelude.Nothing,
      $sel:aWSAccountId:KeyMetadata' :: Maybe Text
aWSAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signingAlgorithms:KeyMetadata' :: Maybe [SigningAlgorithmSpec]
signingAlgorithms = Maybe [SigningAlgorithmSpec]
forall a. Maybe a
Prelude.Nothing,
      $sel:pendingDeletionWindowInDays:KeyMetadata' :: Maybe Natural
pendingDeletionWindowInDays = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:keyUsage:KeyMetadata' :: Maybe KeyUsageType
keyUsage = Maybe KeyUsageType
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:KeyMetadata' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:deletionDate:KeyMetadata' :: Maybe POSIX
deletionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudHsmClusterId:KeyMetadata' :: Maybe Text
cloudHsmClusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:KeyMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customKeyStoreId:KeyMetadata' :: Maybe Text
customKeyStoreId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:multiRegion:KeyMetadata' :: Maybe Bool
multiRegion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:multiRegionConfiguration:KeyMetadata' :: Maybe MultiRegionConfiguration
multiRegionConfiguration = Maybe MultiRegionConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:keyId:KeyMetadata' :: Text
keyId = Text
pKeyId_
    }

-- | The source of the key material for the KMS key. When this value is
-- @AWS_KMS@, KMS created the key material. When this value is @EXTERNAL@,
-- the key material was imported or the KMS key doesn\'t have any key
-- material. When this value is @AWS_CLOUDHSM@, the key material was
-- created in the CloudHSM cluster associated with a custom key store.
keyMetadata_origin :: Lens.Lens' KeyMetadata (Prelude.Maybe OriginType)
keyMetadata_origin :: (Maybe OriginType -> f (Maybe OriginType))
-> KeyMetadata -> f KeyMetadata
keyMetadata_origin = (KeyMetadata -> Maybe OriginType)
-> (KeyMetadata -> Maybe OriginType -> KeyMetadata)
-> Lens
     KeyMetadata KeyMetadata (Maybe OriginType) (Maybe OriginType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe OriginType
origin :: Maybe OriginType
$sel:origin:KeyMetadata' :: KeyMetadata -> Maybe OriginType
origin} -> Maybe OriginType
origin) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe OriginType
a -> KeyMetadata
s {$sel:origin:KeyMetadata' :: Maybe OriginType
origin = Maybe OriginType
a} :: KeyMetadata)

-- | Specifies whether the KMS key\'s key material expires. This value is
-- present only when @Origin@ is @EXTERNAL@, otherwise this value is
-- omitted.
keyMetadata_expirationModel :: Lens.Lens' KeyMetadata (Prelude.Maybe ExpirationModelType)
keyMetadata_expirationModel :: (Maybe ExpirationModelType -> f (Maybe ExpirationModelType))
-> KeyMetadata -> f KeyMetadata
keyMetadata_expirationModel = (KeyMetadata -> Maybe ExpirationModelType)
-> (KeyMetadata -> Maybe ExpirationModelType -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe ExpirationModelType)
     (Maybe ExpirationModelType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe ExpirationModelType
expirationModel :: Maybe ExpirationModelType
$sel:expirationModel:KeyMetadata' :: KeyMetadata -> Maybe ExpirationModelType
expirationModel} -> Maybe ExpirationModelType
expirationModel) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe ExpirationModelType
a -> KeyMetadata
s {$sel:expirationModel:KeyMetadata' :: Maybe ExpirationModelType
expirationModel = Maybe ExpirationModelType
a} :: KeyMetadata)

-- | The manager of the KMS key. KMS keys in your Amazon Web Services account
-- are either customer managed or Amazon Web Services managed. For more
-- information about the difference, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys KMS keys>
-- in the /Key Management Service Developer Guide/.
keyMetadata_keyManager :: Lens.Lens' KeyMetadata (Prelude.Maybe KeyManagerType)
keyMetadata_keyManager :: (Maybe KeyManagerType -> f (Maybe KeyManagerType))
-> KeyMetadata -> f KeyMetadata
keyMetadata_keyManager = (KeyMetadata -> Maybe KeyManagerType)
-> (KeyMetadata -> Maybe KeyManagerType -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe KeyManagerType)
     (Maybe KeyManagerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe KeyManagerType
keyManager :: Maybe KeyManagerType
$sel:keyManager:KeyMetadata' :: KeyMetadata -> Maybe KeyManagerType
keyManager} -> Maybe KeyManagerType
keyManager) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe KeyManagerType
a -> KeyMetadata
s {$sel:keyManager:KeyMetadata' :: Maybe KeyManagerType
keyManager = Maybe KeyManagerType
a} :: KeyMetadata)

-- | Describes the type of key material in the KMS key.
keyMetadata_keySpec :: Lens.Lens' KeyMetadata (Prelude.Maybe KeySpec)
keyMetadata_keySpec :: (Maybe KeySpec -> f (Maybe KeySpec))
-> KeyMetadata -> f KeyMetadata
keyMetadata_keySpec = (KeyMetadata -> Maybe KeySpec)
-> (KeyMetadata -> Maybe KeySpec -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe KeySpec) (Maybe KeySpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe KeySpec
keySpec :: Maybe KeySpec
$sel:keySpec:KeyMetadata' :: KeyMetadata -> Maybe KeySpec
keySpec} -> Maybe KeySpec
keySpec) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe KeySpec
a -> KeyMetadata
s {$sel:keySpec:KeyMetadata' :: Maybe KeySpec
keySpec = Maybe KeySpec
a} :: KeyMetadata)

-- | Instead, use the @KeySpec@ field.
--
-- The @KeySpec@ and @CustomerMasterKeySpec@ fields have the same value. We
-- recommend that you use the @KeySpec@ field in your code. However, to
-- avoid breaking changes, KMS will support both fields.
keyMetadata_customerMasterKeySpec :: Lens.Lens' KeyMetadata (Prelude.Maybe CustomerMasterKeySpec)
keyMetadata_customerMasterKeySpec :: (Maybe CustomerMasterKeySpec -> f (Maybe CustomerMasterKeySpec))
-> KeyMetadata -> f KeyMetadata
keyMetadata_customerMasterKeySpec = (KeyMetadata -> Maybe CustomerMasterKeySpec)
-> (KeyMetadata -> Maybe CustomerMasterKeySpec -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe CustomerMasterKeySpec)
     (Maybe CustomerMasterKeySpec)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe CustomerMasterKeySpec
customerMasterKeySpec :: Maybe CustomerMasterKeySpec
$sel:customerMasterKeySpec:KeyMetadata' :: KeyMetadata -> Maybe CustomerMasterKeySpec
customerMasterKeySpec} -> Maybe CustomerMasterKeySpec
customerMasterKeySpec) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe CustomerMasterKeySpec
a -> KeyMetadata
s {$sel:customerMasterKeySpec:KeyMetadata' :: Maybe CustomerMasterKeySpec
customerMasterKeySpec = Maybe CustomerMasterKeySpec
a} :: KeyMetadata)

-- | Specifies whether the KMS key is enabled. When @KeyState@ is @Enabled@
-- this value is true, otherwise it is false.
keyMetadata_enabled :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Bool)
keyMetadata_enabled :: (Maybe Bool -> f (Maybe Bool)) -> KeyMetadata -> f KeyMetadata
keyMetadata_enabled = (KeyMetadata -> Maybe Bool)
-> (KeyMetadata -> Maybe Bool -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:KeyMetadata' :: KeyMetadata -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Bool
a -> KeyMetadata
s {$sel:enabled:KeyMetadata' :: Maybe Bool
enabled = Maybe Bool
a} :: KeyMetadata)

-- | The time at which the imported key material expires. When the key
-- material expires, KMS deletes the key material and the KMS key becomes
-- unusable. This value is present only for KMS keys whose @Origin@ is
-- @EXTERNAL@ and whose @ExpirationModel@ is @KEY_MATERIAL_EXPIRES@,
-- otherwise this value is omitted.
keyMetadata_validTo :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.UTCTime)
keyMetadata_validTo :: (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata -> f KeyMetadata
keyMetadata_validTo = (KeyMetadata -> Maybe POSIX)
-> (KeyMetadata -> Maybe POSIX -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe POSIX
validTo :: Maybe POSIX
$sel:validTo:KeyMetadata' :: KeyMetadata -> Maybe POSIX
validTo} -> Maybe POSIX
validTo) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe POSIX
a -> KeyMetadata
s {$sel:validTo:KeyMetadata' :: Maybe POSIX
validTo = Maybe POSIX
a} :: KeyMetadata) ((Maybe POSIX -> f (Maybe POSIX)) -> KeyMetadata -> f KeyMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata
-> f KeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the KMS key. For examples, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms Key Management Service (KMS)>
-- in the Example ARNs section of the /Amazon Web Services General
-- Reference/.
keyMetadata_arn :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Text)
keyMetadata_arn :: (Maybe Text -> f (Maybe Text)) -> KeyMetadata -> f KeyMetadata
keyMetadata_arn = (KeyMetadata -> Maybe Text)
-> (KeyMetadata -> Maybe Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:KeyMetadata' :: KeyMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Text
a -> KeyMetadata
s {$sel:arn:KeyMetadata' :: Maybe Text
arn = Maybe Text
a} :: KeyMetadata)

-- | The current status of the KMS key.
--
-- For more information about how key state affects the use of a KMS key,
-- see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html Key state: Effect on your KMS key>
-- in the /Key Management Service Developer Guide/.
keyMetadata_keyState :: Lens.Lens' KeyMetadata (Prelude.Maybe KeyState)
keyMetadata_keyState :: (Maybe KeyState -> f (Maybe KeyState))
-> KeyMetadata -> f KeyMetadata
keyMetadata_keyState = (KeyMetadata -> Maybe KeyState)
-> (KeyMetadata -> Maybe KeyState -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe KeyState) (Maybe KeyState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe KeyState
keyState :: Maybe KeyState
$sel:keyState:KeyMetadata' :: KeyMetadata -> Maybe KeyState
keyState} -> Maybe KeyState
keyState) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe KeyState
a -> KeyMetadata
s {$sel:keyState:KeyMetadata' :: Maybe KeyState
keyState = Maybe KeyState
a} :: KeyMetadata)

-- | The encryption algorithms that the KMS key supports. You cannot use the
-- KMS key with other encryption algorithms within KMS.
--
-- This value is present only when the @KeyUsage@ of the KMS key is
-- @ENCRYPT_DECRYPT@.
keyMetadata_encryptionAlgorithms :: Lens.Lens' KeyMetadata (Prelude.Maybe [EncryptionAlgorithmSpec])
keyMetadata_encryptionAlgorithms :: (Maybe [EncryptionAlgorithmSpec]
 -> f (Maybe [EncryptionAlgorithmSpec]))
-> KeyMetadata -> f KeyMetadata
keyMetadata_encryptionAlgorithms = (KeyMetadata -> Maybe [EncryptionAlgorithmSpec])
-> (KeyMetadata -> Maybe [EncryptionAlgorithmSpec] -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe [EncryptionAlgorithmSpec])
     (Maybe [EncryptionAlgorithmSpec])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms :: Maybe [EncryptionAlgorithmSpec]
$sel:encryptionAlgorithms:KeyMetadata' :: KeyMetadata -> Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms} -> Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe [EncryptionAlgorithmSpec]
a -> KeyMetadata
s {$sel:encryptionAlgorithms:KeyMetadata' :: Maybe [EncryptionAlgorithmSpec]
encryptionAlgorithms = Maybe [EncryptionAlgorithmSpec]
a} :: KeyMetadata) ((Maybe [EncryptionAlgorithmSpec]
  -> f (Maybe [EncryptionAlgorithmSpec]))
 -> KeyMetadata -> f KeyMetadata)
-> ((Maybe [EncryptionAlgorithmSpec]
     -> f (Maybe [EncryptionAlgorithmSpec]))
    -> Maybe [EncryptionAlgorithmSpec]
    -> f (Maybe [EncryptionAlgorithmSpec]))
-> (Maybe [EncryptionAlgorithmSpec]
    -> f (Maybe [EncryptionAlgorithmSpec]))
-> KeyMetadata
-> f KeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
-> Iso
     (Maybe [EncryptionAlgorithmSpec])
     (Maybe [EncryptionAlgorithmSpec])
     (Maybe [EncryptionAlgorithmSpec])
     (Maybe [EncryptionAlgorithmSpec])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
  [EncryptionAlgorithmSpec]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The twelve-digit account ID of the Amazon Web Services account that owns
-- the KMS key.
keyMetadata_aWSAccountId :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Text)
keyMetadata_aWSAccountId :: (Maybe Text -> f (Maybe Text)) -> KeyMetadata -> f KeyMetadata
keyMetadata_aWSAccountId = (KeyMetadata -> Maybe Text)
-> (KeyMetadata -> Maybe Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Text
aWSAccountId :: Maybe Text
$sel:aWSAccountId:KeyMetadata' :: KeyMetadata -> Maybe Text
aWSAccountId} -> Maybe Text
aWSAccountId) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Text
a -> KeyMetadata
s {$sel:aWSAccountId:KeyMetadata' :: Maybe Text
aWSAccountId = Maybe Text
a} :: KeyMetadata)

-- | The signing algorithms that the KMS key supports. You cannot use the KMS
-- key with other signing algorithms within KMS.
--
-- This field appears only when the @KeyUsage@ of the KMS key is
-- @SIGN_VERIFY@.
keyMetadata_signingAlgorithms :: Lens.Lens' KeyMetadata (Prelude.Maybe [SigningAlgorithmSpec])
keyMetadata_signingAlgorithms :: (Maybe [SigningAlgorithmSpec] -> f (Maybe [SigningAlgorithmSpec]))
-> KeyMetadata -> f KeyMetadata
keyMetadata_signingAlgorithms = (KeyMetadata -> Maybe [SigningAlgorithmSpec])
-> (KeyMetadata -> Maybe [SigningAlgorithmSpec] -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe [SigningAlgorithmSpec])
     (Maybe [SigningAlgorithmSpec])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe [SigningAlgorithmSpec]
signingAlgorithms :: Maybe [SigningAlgorithmSpec]
$sel:signingAlgorithms:KeyMetadata' :: KeyMetadata -> Maybe [SigningAlgorithmSpec]
signingAlgorithms} -> Maybe [SigningAlgorithmSpec]
signingAlgorithms) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe [SigningAlgorithmSpec]
a -> KeyMetadata
s {$sel:signingAlgorithms:KeyMetadata' :: Maybe [SigningAlgorithmSpec]
signingAlgorithms = Maybe [SigningAlgorithmSpec]
a} :: KeyMetadata) ((Maybe [SigningAlgorithmSpec] -> f (Maybe [SigningAlgorithmSpec]))
 -> KeyMetadata -> f KeyMetadata)
-> ((Maybe [SigningAlgorithmSpec]
     -> f (Maybe [SigningAlgorithmSpec]))
    -> Maybe [SigningAlgorithmSpec]
    -> f (Maybe [SigningAlgorithmSpec]))
-> (Maybe [SigningAlgorithmSpec]
    -> f (Maybe [SigningAlgorithmSpec]))
-> KeyMetadata
-> f KeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
-> Iso
     (Maybe [SigningAlgorithmSpec])
     (Maybe [SigningAlgorithmSpec])
     (Maybe [SigningAlgorithmSpec])
     (Maybe [SigningAlgorithmSpec])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
  [SigningAlgorithmSpec]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The waiting period before the primary key in a multi-Region key is
-- deleted. This waiting period begins when the last of its replica keys is
-- deleted. This value is present only when the @KeyState@ of the KMS key
-- is @PendingReplicaDeletion@. That indicates that the KMS key is the
-- primary key in a multi-Region key, it is scheduled for deletion, and it
-- still has existing replica keys.
--
-- When a single-Region KMS key or a multi-Region replica key is scheduled
-- for deletion, its deletion date is displayed in the @DeletionDate@
-- field. However, when the primary key in a multi-Region key is scheduled
-- for deletion, its waiting period doesn\'t begin until all of its replica
-- keys are deleted. This value displays that waiting period. When the last
-- replica key in the multi-Region key is deleted, the @KeyState@ of the
-- scheduled primary key changes from @PendingReplicaDeletion@ to
-- @PendingDeletion@ and the deletion date appears in the @DeletionDate@
-- field.
keyMetadata_pendingDeletionWindowInDays :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Natural)
keyMetadata_pendingDeletionWindowInDays :: (Maybe Natural -> f (Maybe Natural))
-> KeyMetadata -> f KeyMetadata
keyMetadata_pendingDeletionWindowInDays = (KeyMetadata -> Maybe Natural)
-> (KeyMetadata -> Maybe Natural -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Natural
pendingDeletionWindowInDays :: Maybe Natural
$sel:pendingDeletionWindowInDays:KeyMetadata' :: KeyMetadata -> Maybe Natural
pendingDeletionWindowInDays} -> Maybe Natural
pendingDeletionWindowInDays) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Natural
a -> KeyMetadata
s {$sel:pendingDeletionWindowInDays:KeyMetadata' :: Maybe Natural
pendingDeletionWindowInDays = Maybe Natural
a} :: KeyMetadata)

-- | The
-- <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations cryptographic operations>
-- for which you can use the KMS key.
keyMetadata_keyUsage :: Lens.Lens' KeyMetadata (Prelude.Maybe KeyUsageType)
keyMetadata_keyUsage :: (Maybe KeyUsageType -> f (Maybe KeyUsageType))
-> KeyMetadata -> f KeyMetadata
keyMetadata_keyUsage = (KeyMetadata -> Maybe KeyUsageType)
-> (KeyMetadata -> Maybe KeyUsageType -> KeyMetadata)
-> Lens
     KeyMetadata KeyMetadata (Maybe KeyUsageType) (Maybe KeyUsageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe KeyUsageType
keyUsage :: Maybe KeyUsageType
$sel:keyUsage:KeyMetadata' :: KeyMetadata -> Maybe KeyUsageType
keyUsage} -> Maybe KeyUsageType
keyUsage) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe KeyUsageType
a -> KeyMetadata
s {$sel:keyUsage:KeyMetadata' :: Maybe KeyUsageType
keyUsage = Maybe KeyUsageType
a} :: KeyMetadata)

-- | The date and time when the KMS key was created.
keyMetadata_creationDate :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.UTCTime)
keyMetadata_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata -> f KeyMetadata
keyMetadata_creationDate = (KeyMetadata -> Maybe POSIX)
-> (KeyMetadata -> Maybe POSIX -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:KeyMetadata' :: KeyMetadata -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe POSIX
a -> KeyMetadata
s {$sel:creationDate:KeyMetadata' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: KeyMetadata) ((Maybe POSIX -> f (Maybe POSIX)) -> KeyMetadata -> f KeyMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata
-> f KeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The date and time after which KMS deletes this KMS key. This value is
-- present only when the KMS key is scheduled for deletion, that is, when
-- its @KeyState@ is @PendingDeletion@.
--
-- When the primary key in a multi-Region key is scheduled for deletion but
-- still has replica keys, its key state is @PendingReplicaDeletion@ and
-- the length of its waiting period is displayed in the
-- @PendingDeletionWindowInDays@ field.
keyMetadata_deletionDate :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.UTCTime)
keyMetadata_deletionDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata -> f KeyMetadata
keyMetadata_deletionDate = (KeyMetadata -> Maybe POSIX)
-> (KeyMetadata -> Maybe POSIX -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe POSIX
deletionDate :: Maybe POSIX
$sel:deletionDate:KeyMetadata' :: KeyMetadata -> Maybe POSIX
deletionDate} -> Maybe POSIX
deletionDate) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe POSIX
a -> KeyMetadata
s {$sel:deletionDate:KeyMetadata' :: Maybe POSIX
deletionDate = Maybe POSIX
a} :: KeyMetadata) ((Maybe POSIX -> f (Maybe POSIX)) -> KeyMetadata -> f KeyMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> KeyMetadata
-> f KeyMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The cluster ID of the CloudHSM cluster that contains the key material
-- for the KMS key. When you create a KMS key in a
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>,
-- KMS creates the key material for the KMS key in the associated CloudHSM
-- cluster. This value is present only when the KMS key is created in a
-- custom key store.
keyMetadata_cloudHsmClusterId :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Text)
keyMetadata_cloudHsmClusterId :: (Maybe Text -> f (Maybe Text)) -> KeyMetadata -> f KeyMetadata
keyMetadata_cloudHsmClusterId = (KeyMetadata -> Maybe Text)
-> (KeyMetadata -> Maybe Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Text
cloudHsmClusterId :: Maybe Text
$sel:cloudHsmClusterId:KeyMetadata' :: KeyMetadata -> Maybe Text
cloudHsmClusterId} -> Maybe Text
cloudHsmClusterId) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Text
a -> KeyMetadata
s {$sel:cloudHsmClusterId:KeyMetadata' :: Maybe Text
cloudHsmClusterId = Maybe Text
a} :: KeyMetadata)

-- | The description of the KMS key.
keyMetadata_description :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Text)
keyMetadata_description :: (Maybe Text -> f (Maybe Text)) -> KeyMetadata -> f KeyMetadata
keyMetadata_description = (KeyMetadata -> Maybe Text)
-> (KeyMetadata -> Maybe Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Text
description :: Maybe Text
$sel:description:KeyMetadata' :: KeyMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Text
a -> KeyMetadata
s {$sel:description:KeyMetadata' :: Maybe Text
description = Maybe Text
a} :: KeyMetadata)

-- | A unique identifier for the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html custom key store>
-- that contains the KMS key. This value is present only when the KMS key
-- is created in a custom key store.
keyMetadata_customKeyStoreId :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Text)
keyMetadata_customKeyStoreId :: (Maybe Text -> f (Maybe Text)) -> KeyMetadata -> f KeyMetadata
keyMetadata_customKeyStoreId = (KeyMetadata -> Maybe Text)
-> (KeyMetadata -> Maybe Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Text
customKeyStoreId :: Maybe Text
$sel:customKeyStoreId:KeyMetadata' :: KeyMetadata -> Maybe Text
customKeyStoreId} -> Maybe Text
customKeyStoreId) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Text
a -> KeyMetadata
s {$sel:customKeyStoreId:KeyMetadata' :: Maybe Text
customKeyStoreId = Maybe Text
a} :: KeyMetadata)

-- | Indicates whether the KMS key is a multi-Region (@True@) or regional
-- (@False@) key. This value is @True@ for multi-Region primary and replica
-- keys and @False@ for regional KMS keys.
--
-- For more information about multi-Region keys, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
-- in the /Key Management Service Developer Guide/.
keyMetadata_multiRegion :: Lens.Lens' KeyMetadata (Prelude.Maybe Prelude.Bool)
keyMetadata_multiRegion :: (Maybe Bool -> f (Maybe Bool)) -> KeyMetadata -> f KeyMetadata
keyMetadata_multiRegion = (KeyMetadata -> Maybe Bool)
-> (KeyMetadata -> Maybe Bool -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe Bool
multiRegion :: Maybe Bool
$sel:multiRegion:KeyMetadata' :: KeyMetadata -> Maybe Bool
multiRegion} -> Maybe Bool
multiRegion) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe Bool
a -> KeyMetadata
s {$sel:multiRegion:KeyMetadata' :: Maybe Bool
multiRegion = Maybe Bool
a} :: KeyMetadata)

-- | Lists the primary and replica keys in same multi-Region key. This field
-- is present only when the value of the @MultiRegion@ field is @True@.
--
-- For more information about any listed KMS key, use the DescribeKey
-- operation.
--
-- -   @MultiRegionKeyType@ indicates whether the KMS key is a @PRIMARY@ or
--     @REPLICA@ key.
--
-- -   @PrimaryKey@ displays the key ARN and Region of the primary key.
--     This field displays the current KMS key if it is the primary key.
--
-- -   @ReplicaKeys@ displays the key ARNs and Regions of all replica keys.
--     This field includes the current KMS key if it is a replica key.
keyMetadata_multiRegionConfiguration :: Lens.Lens' KeyMetadata (Prelude.Maybe MultiRegionConfiguration)
keyMetadata_multiRegionConfiguration :: (Maybe MultiRegionConfiguration
 -> f (Maybe MultiRegionConfiguration))
-> KeyMetadata -> f KeyMetadata
keyMetadata_multiRegionConfiguration = (KeyMetadata -> Maybe MultiRegionConfiguration)
-> (KeyMetadata -> Maybe MultiRegionConfiguration -> KeyMetadata)
-> Lens
     KeyMetadata
     KeyMetadata
     (Maybe MultiRegionConfiguration)
     (Maybe MultiRegionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Maybe MultiRegionConfiguration
multiRegionConfiguration :: Maybe MultiRegionConfiguration
$sel:multiRegionConfiguration:KeyMetadata' :: KeyMetadata -> Maybe MultiRegionConfiguration
multiRegionConfiguration} -> Maybe MultiRegionConfiguration
multiRegionConfiguration) (\s :: KeyMetadata
s@KeyMetadata' {} Maybe MultiRegionConfiguration
a -> KeyMetadata
s {$sel:multiRegionConfiguration:KeyMetadata' :: Maybe MultiRegionConfiguration
multiRegionConfiguration = Maybe MultiRegionConfiguration
a} :: KeyMetadata)

-- | The globally unique identifier for the KMS key.
keyMetadata_keyId :: Lens.Lens' KeyMetadata Prelude.Text
keyMetadata_keyId :: (Text -> f Text) -> KeyMetadata -> f KeyMetadata
keyMetadata_keyId = (KeyMetadata -> Text)
-> (KeyMetadata -> Text -> KeyMetadata)
-> Lens KeyMetadata KeyMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyMetadata' {Text
keyId :: Text
$sel:keyId:KeyMetadata' :: KeyMetadata -> Text
keyId} -> Text
keyId) (\s :: KeyMetadata
s@KeyMetadata' {} Text
a -> KeyMetadata
s {$sel:keyId:KeyMetadata' :: Text
keyId = Text
a} :: KeyMetadata)

instance Core.FromJSON KeyMetadata where
  parseJSON :: Value -> Parser KeyMetadata
parseJSON =
    String
-> (Object -> Parser KeyMetadata) -> Value -> Parser KeyMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KeyMetadata"
      ( \Object
x ->
          Maybe OriginType
-> Maybe ExpirationModelType
-> Maybe KeyManagerType
-> Maybe KeySpec
-> Maybe CustomerMasterKeySpec
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> Maybe KeyState
-> Maybe [EncryptionAlgorithmSpec]
-> Maybe Text
-> Maybe [SigningAlgorithmSpec]
-> Maybe Natural
-> Maybe KeyUsageType
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe MultiRegionConfiguration
-> Text
-> KeyMetadata
KeyMetadata'
            (Maybe OriginType
 -> Maybe ExpirationModelType
 -> Maybe KeyManagerType
 -> Maybe KeySpec
 -> Maybe CustomerMasterKeySpec
 -> Maybe Bool
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe KeyState
 -> Maybe [EncryptionAlgorithmSpec]
 -> Maybe Text
 -> Maybe [SigningAlgorithmSpec]
 -> Maybe Natural
 -> Maybe KeyUsageType
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe MultiRegionConfiguration
 -> Text
 -> KeyMetadata)
-> Parser (Maybe OriginType)
-> Parser
     (Maybe ExpirationModelType
      -> Maybe KeyManagerType
      -> Maybe KeySpec
      -> Maybe CustomerMasterKeySpec
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe OriginType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Origin")
            Parser
  (Maybe ExpirationModelType
   -> Maybe KeyManagerType
   -> Maybe KeySpec
   -> Maybe CustomerMasterKeySpec
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe ExpirationModelType)
-> Parser
     (Maybe KeyManagerType
      -> Maybe KeySpec
      -> Maybe CustomerMasterKeySpec
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExpirationModelType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExpirationModel")
            Parser
  (Maybe KeyManagerType
   -> Maybe KeySpec
   -> Maybe CustomerMasterKeySpec
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe KeyManagerType)
-> Parser
     (Maybe KeySpec
      -> Maybe CustomerMasterKeySpec
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KeyManagerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyManager")
            Parser
  (Maybe KeySpec
   -> Maybe CustomerMasterKeySpec
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe KeySpec)
-> Parser
     (Maybe CustomerMasterKeySpec
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KeySpec)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeySpec")
            Parser
  (Maybe CustomerMasterKeySpec
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe CustomerMasterKeySpec)
-> Parser
     (Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CustomerMasterKeySpec)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomerMasterKeySpec")
            Parser
  (Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Bool)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidTo")
            Parser
  (Maybe Text
   -> Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe KeyState
      -> Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
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
"Arn")
            Parser
  (Maybe KeyState
   -> Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe KeyState)
-> Parser
     (Maybe [EncryptionAlgorithmSpec]
      -> Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KeyState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyState")
            Parser
  (Maybe [EncryptionAlgorithmSpec]
   -> Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe [EncryptionAlgorithmSpec])
-> Parser
     (Maybe Text
      -> Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [EncryptionAlgorithmSpec]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionAlgorithms"
                            Parser (Maybe (Maybe [EncryptionAlgorithmSpec]))
-> Maybe [EncryptionAlgorithmSpec]
-> Parser (Maybe [EncryptionAlgorithmSpec])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EncryptionAlgorithmSpec]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe [SigningAlgorithmSpec]
      -> Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
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
"AWSAccountId")
            Parser
  (Maybe [SigningAlgorithmSpec]
   -> Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe [SigningAlgorithmSpec])
-> Parser
     (Maybe Natural
      -> Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [SigningAlgorithmSpec]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SigningAlgorithms"
                            Parser (Maybe (Maybe [SigningAlgorithmSpec]))
-> Maybe [SigningAlgorithmSpec]
-> Parser (Maybe [SigningAlgorithmSpec])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SigningAlgorithmSpec]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Natural
   -> Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Natural)
-> Parser
     (Maybe KeyUsageType
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PendingDeletionWindowInDays")
            Parser
  (Maybe KeyUsageType
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe KeyUsageType)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KeyUsageType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyUsage")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeletionDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
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
"CloudHsmClusterId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe MultiRegionConfiguration
      -> Text
      -> KeyMetadata)
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
"Description")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe MultiRegionConfiguration
   -> Text
   -> KeyMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe MultiRegionConfiguration -> Text -> KeyMetadata)
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
"CustomKeyStoreId")
            Parser
  (Maybe Bool
   -> Maybe MultiRegionConfiguration -> Text -> KeyMetadata)
-> Parser (Maybe Bool)
-> Parser (Maybe MultiRegionConfiguration -> Text -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MultiRegion")
            Parser (Maybe MultiRegionConfiguration -> Text -> KeyMetadata)
-> Parser (Maybe MultiRegionConfiguration)
-> Parser (Text -> KeyMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MultiRegionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MultiRegionConfiguration")
            Parser (Text -> KeyMetadata) -> Parser Text -> Parser KeyMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"KeyId")
      )

instance Prelude.Hashable KeyMetadata

instance Prelude.NFData KeyMetadata