{-# 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.SecretsManager.Types.SecretListEntry
-- 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.SecretsManager.Types.SecretListEntry 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.SecretsManager.Types.RotationRulesType
import Amazonka.SecretsManager.Types.Tag

-- | A structure that contains the details about a secret. It does not
-- include the encrypted @SecretString@ and @SecretBinary@ values. To get
-- those values, use
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html GetSecretValue>
-- .
--
-- /See:/ 'newSecretListEntry' smart constructor.
data SecretListEntry = SecretListEntry'
  { -- | The Amazon Resource Name (ARN) of the secret.
    SecretListEntry -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when a secret was created.
    SecretListEntry -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    -- | The date and time the deletion of the secret occurred. Not present on
    -- active secrets. The secret can be recovered until the number of days in
    -- the recovery window has passed, as specified in the
    -- @RecoveryWindowInDays@ parameter of the
    -- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html DeleteSecret>
    -- operation.
    SecretListEntry -> Maybe POSIX
deletedDate :: Prelude.Maybe Data.POSIX,
    -- | The user-provided description of the secret.
    SecretListEntry -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the KMS key that Secrets Manager uses to encrypt the secret
    -- value. If the secret is encrypted with the Amazon Web Services managed
    -- key @aws\/secretsmanager@, this field is omitted.
    SecretListEntry -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The date that the secret was last accessed in the Region. This field is
    -- omitted if the secret has never been retrieved in the Region.
    SecretListEntry -> Maybe POSIX
lastAccessedDate :: Prelude.Maybe Data.POSIX,
    -- | The last date and time that this secret was modified in any way.
    SecretListEntry -> Maybe POSIX
lastChangedDate :: Prelude.Maybe Data.POSIX,
    -- | The most recent date and time that the Secrets Manager rotation process
    -- was successfully completed. This value is null if the secret hasn\'t
    -- ever rotated.
    SecretListEntry -> Maybe POSIX
lastRotatedDate :: Prelude.Maybe Data.POSIX,
    -- | The friendly name of the secret. You can use forward slashes in the name
    -- to represent a path hierarchy. For example,
    -- @\/prod\/databases\/dbserver1@ could represent the secret for a server
    -- named @dbserver1@ in the folder @databases@ in the folder @prod@.
    SecretListEntry -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    SecretListEntry -> Maybe POSIX
nextRotationDate :: Prelude.Maybe Data.POSIX,
    -- | Returns the name of the service that created the secret.
    SecretListEntry -> Maybe Text
owningService :: Prelude.Maybe Prelude.Text,
    -- | The Region where Secrets Manager originated the secret.
    SecretListEntry -> Maybe Text
primaryRegion :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether automatic, scheduled rotation is enabled for this
    -- secret.
    SecretListEntry -> Maybe Bool
rotationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of an Amazon Web Services Lambda function invoked by Secrets
    -- Manager to rotate and expire the secret either automatically per the
    -- schedule or manually by a call to
    -- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html RotateSecret>
    -- .
    SecretListEntry -> Maybe Text
rotationLambdaARN :: Prelude.Maybe Prelude.Text,
    -- | A structure that defines the rotation configuration for the secret.
    SecretListEntry -> Maybe RotationRulesType
rotationRules :: Prelude.Maybe RotationRulesType,
    -- | A list of all of the currently assigned @SecretVersionStage@ staging
    -- labels and the @SecretVersionId@ attached to each one. Staging labels
    -- are used to keep track of the different versions during the rotation
    -- process.
    --
    -- A version that does not have any @SecretVersionStage@ is considered
    -- deprecated and subject to deletion. Such versions are not included in
    -- this list.
    SecretListEntry -> Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Prelude.NonEmpty Prelude.Text)),
    -- | The list of user-defined tags associated with the secret. To add tags to
    -- a secret, use
    -- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html TagResource>
    -- . To remove tags, use
    -- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html UntagResource>
    -- .
    SecretListEntry -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (SecretListEntry -> SecretListEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecretListEntry -> SecretListEntry -> Bool
$c/= :: SecretListEntry -> SecretListEntry -> Bool
== :: SecretListEntry -> SecretListEntry -> Bool
$c== :: SecretListEntry -> SecretListEntry -> Bool
Prelude.Eq, ReadPrec [SecretListEntry]
ReadPrec SecretListEntry
Int -> ReadS SecretListEntry
ReadS [SecretListEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecretListEntry]
$creadListPrec :: ReadPrec [SecretListEntry]
readPrec :: ReadPrec SecretListEntry
$creadPrec :: ReadPrec SecretListEntry
readList :: ReadS [SecretListEntry]
$creadList :: ReadS [SecretListEntry]
readsPrec :: Int -> ReadS SecretListEntry
$creadsPrec :: Int -> ReadS SecretListEntry
Prelude.Read, Int -> SecretListEntry -> ShowS
[SecretListEntry] -> ShowS
SecretListEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecretListEntry] -> ShowS
$cshowList :: [SecretListEntry] -> ShowS
show :: SecretListEntry -> String
$cshow :: SecretListEntry -> String
showsPrec :: Int -> SecretListEntry -> ShowS
$cshowsPrec :: Int -> SecretListEntry -> ShowS
Prelude.Show, forall x. Rep SecretListEntry x -> SecretListEntry
forall x. SecretListEntry -> Rep SecretListEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SecretListEntry x -> SecretListEntry
$cfrom :: forall x. SecretListEntry -> Rep SecretListEntry x
Prelude.Generic)

-- |
-- Create a value of 'SecretListEntry' 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:
--
-- 'arn', 'secretListEntry_arn' - The Amazon Resource Name (ARN) of the secret.
--
-- 'createdDate', 'secretListEntry_createdDate' - The date and time when a secret was created.
--
-- 'deletedDate', 'secretListEntry_deletedDate' - The date and time the deletion of the secret occurred. Not present on
-- active secrets. The secret can be recovered until the number of days in
-- the recovery window has passed, as specified in the
-- @RecoveryWindowInDays@ parameter of the
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html DeleteSecret>
-- operation.
--
-- 'description', 'secretListEntry_description' - The user-provided description of the secret.
--
-- 'kmsKeyId', 'secretListEntry_kmsKeyId' - The ARN of the KMS key that Secrets Manager uses to encrypt the secret
-- value. If the secret is encrypted with the Amazon Web Services managed
-- key @aws\/secretsmanager@, this field is omitted.
--
-- 'lastAccessedDate', 'secretListEntry_lastAccessedDate' - The date that the secret was last accessed in the Region. This field is
-- omitted if the secret has never been retrieved in the Region.
--
-- 'lastChangedDate', 'secretListEntry_lastChangedDate' - The last date and time that this secret was modified in any way.
--
-- 'lastRotatedDate', 'secretListEntry_lastRotatedDate' - The most recent date and time that the Secrets Manager rotation process
-- was successfully completed. This value is null if the secret hasn\'t
-- ever rotated.
--
-- 'name', 'secretListEntry_name' - The friendly name of the secret. You can use forward slashes in the name
-- to represent a path hierarchy. For example,
-- @\/prod\/databases\/dbserver1@ could represent the secret for a server
-- named @dbserver1@ in the folder @databases@ in the folder @prod@.
--
-- 'nextRotationDate', 'secretListEntry_nextRotationDate' - Undocumented member.
--
-- 'owningService', 'secretListEntry_owningService' - Returns the name of the service that created the secret.
--
-- 'primaryRegion', 'secretListEntry_primaryRegion' - The Region where Secrets Manager originated the secret.
--
-- 'rotationEnabled', 'secretListEntry_rotationEnabled' - Indicates whether automatic, scheduled rotation is enabled for this
-- secret.
--
-- 'rotationLambdaARN', 'secretListEntry_rotationLambdaARN' - The ARN of an Amazon Web Services Lambda function invoked by Secrets
-- Manager to rotate and expire the secret either automatically per the
-- schedule or manually by a call to
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html RotateSecret>
-- .
--
-- 'rotationRules', 'secretListEntry_rotationRules' - A structure that defines the rotation configuration for the secret.
--
-- 'secretVersionsToStages', 'secretListEntry_secretVersionsToStages' - A list of all of the currently assigned @SecretVersionStage@ staging
-- labels and the @SecretVersionId@ attached to each one. Staging labels
-- are used to keep track of the different versions during the rotation
-- process.
--
-- A version that does not have any @SecretVersionStage@ is considered
-- deprecated and subject to deletion. Such versions are not included in
-- this list.
--
-- 'tags', 'secretListEntry_tags' - The list of user-defined tags associated with the secret. To add tags to
-- a secret, use
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html TagResource>
-- . To remove tags, use
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html UntagResource>
-- .
newSecretListEntry ::
  SecretListEntry
newSecretListEntry :: SecretListEntry
newSecretListEntry =
  SecretListEntry'
    { $sel:arn:SecretListEntry' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:SecretListEntry' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:deletedDate:SecretListEntry' :: Maybe POSIX
deletedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SecretListEntry' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:SecretListEntry' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastAccessedDate:SecretListEntry' :: Maybe POSIX
lastAccessedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastChangedDate:SecretListEntry' :: Maybe POSIX
lastChangedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:lastRotatedDate:SecretListEntry' :: Maybe POSIX
lastRotatedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SecretListEntry' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:nextRotationDate:SecretListEntry' :: Maybe POSIX
nextRotationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:owningService:SecretListEntry' :: Maybe Text
owningService = forall a. Maybe a
Prelude.Nothing,
      $sel:primaryRegion:SecretListEntry' :: Maybe Text
primaryRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:rotationEnabled:SecretListEntry' :: Maybe Bool
rotationEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:rotationLambdaARN:SecretListEntry' :: Maybe Text
rotationLambdaARN = forall a. Maybe a
Prelude.Nothing,
      $sel:rotationRules:SecretListEntry' :: Maybe RotationRulesType
rotationRules = forall a. Maybe a
Prelude.Nothing,
      $sel:secretVersionsToStages:SecretListEntry' :: Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SecretListEntry' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the secret.
secretListEntry_arn :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_arn :: Lens' SecretListEntry (Maybe Text)
secretListEntry_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
arn :: Maybe Text
$sel:arn:SecretListEntry' :: SecretListEntry -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:arn:SecretListEntry' :: Maybe Text
arn = Maybe Text
a} :: SecretListEntry)

-- | The date and time when a secret was created.
secretListEntry_createdDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_createdDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:createdDate:SecretListEntry' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time the deletion of the secret occurred. Not present on
-- active secrets. The secret can be recovered until the number of days in
-- the recovery window has passed, as specified in the
-- @RecoveryWindowInDays@ parameter of the
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html DeleteSecret>
-- operation.
secretListEntry_deletedDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_deletedDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_deletedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
deletedDate :: Maybe POSIX
$sel:deletedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
deletedDate} -> Maybe POSIX
deletedDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:deletedDate:SecretListEntry' :: Maybe POSIX
deletedDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The user-provided description of the secret.
secretListEntry_description :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_description :: Lens' SecretListEntry (Maybe Text)
secretListEntry_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
description :: Maybe Text
$sel:description:SecretListEntry' :: SecretListEntry -> Maybe Text
description} -> Maybe Text
description) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:description:SecretListEntry' :: Maybe Text
description = Maybe Text
a} :: SecretListEntry)

-- | The ARN of the KMS key that Secrets Manager uses to encrypt the secret
-- value. If the secret is encrypted with the Amazon Web Services managed
-- key @aws\/secretsmanager@, this field is omitted.
secretListEntry_kmsKeyId :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_kmsKeyId :: Lens' SecretListEntry (Maybe Text)
secretListEntry_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:SecretListEntry' :: SecretListEntry -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:kmsKeyId:SecretListEntry' :: Maybe Text
kmsKeyId = Maybe Text
a} :: SecretListEntry)

-- | The date that the secret was last accessed in the Region. This field is
-- omitted if the secret has never been retrieved in the Region.
secretListEntry_lastAccessedDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_lastAccessedDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_lastAccessedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
lastAccessedDate :: Maybe POSIX
$sel:lastAccessedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
lastAccessedDate} -> Maybe POSIX
lastAccessedDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:lastAccessedDate:SecretListEntry' :: Maybe POSIX
lastAccessedDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The last date and time that this secret was modified in any way.
secretListEntry_lastChangedDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_lastChangedDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_lastChangedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
lastChangedDate :: Maybe POSIX
$sel:lastChangedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
lastChangedDate} -> Maybe POSIX
lastChangedDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:lastChangedDate:SecretListEntry' :: Maybe POSIX
lastChangedDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The most recent date and time that the Secrets Manager rotation process
-- was successfully completed. This value is null if the secret hasn\'t
-- ever rotated.
secretListEntry_lastRotatedDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_lastRotatedDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_lastRotatedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
lastRotatedDate :: Maybe POSIX
$sel:lastRotatedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
lastRotatedDate} -> Maybe POSIX
lastRotatedDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:lastRotatedDate:SecretListEntry' :: Maybe POSIX
lastRotatedDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The friendly name of the secret. You can use forward slashes in the name
-- to represent a path hierarchy. For example,
-- @\/prod\/databases\/dbserver1@ could represent the secret for a server
-- named @dbserver1@ in the folder @databases@ in the folder @prod@.
secretListEntry_name :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_name :: Lens' SecretListEntry (Maybe Text)
secretListEntry_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
name :: Maybe Text
$sel:name:SecretListEntry' :: SecretListEntry -> Maybe Text
name} -> Maybe Text
name) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:name:SecretListEntry' :: Maybe Text
name = Maybe Text
a} :: SecretListEntry)

-- | Undocumented member.
secretListEntry_nextRotationDate :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.UTCTime)
secretListEntry_nextRotationDate :: Lens' SecretListEntry (Maybe UTCTime)
secretListEntry_nextRotationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe POSIX
nextRotationDate :: Maybe POSIX
$sel:nextRotationDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
nextRotationDate} -> Maybe POSIX
nextRotationDate) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe POSIX
a -> SecretListEntry
s {$sel:nextRotationDate:SecretListEntry' :: Maybe POSIX
nextRotationDate = Maybe POSIX
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Returns the name of the service that created the secret.
secretListEntry_owningService :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_owningService :: Lens' SecretListEntry (Maybe Text)
secretListEntry_owningService = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
owningService :: Maybe Text
$sel:owningService:SecretListEntry' :: SecretListEntry -> Maybe Text
owningService} -> Maybe Text
owningService) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:owningService:SecretListEntry' :: Maybe Text
owningService = Maybe Text
a} :: SecretListEntry)

-- | The Region where Secrets Manager originated the secret.
secretListEntry_primaryRegion :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_primaryRegion :: Lens' SecretListEntry (Maybe Text)
secretListEntry_primaryRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
primaryRegion :: Maybe Text
$sel:primaryRegion:SecretListEntry' :: SecretListEntry -> Maybe Text
primaryRegion} -> Maybe Text
primaryRegion) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:primaryRegion:SecretListEntry' :: Maybe Text
primaryRegion = Maybe Text
a} :: SecretListEntry)

-- | Indicates whether automatic, scheduled rotation is enabled for this
-- secret.
secretListEntry_rotationEnabled :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Bool)
secretListEntry_rotationEnabled :: Lens' SecretListEntry (Maybe Bool)
secretListEntry_rotationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Bool
rotationEnabled :: Maybe Bool
$sel:rotationEnabled:SecretListEntry' :: SecretListEntry -> Maybe Bool
rotationEnabled} -> Maybe Bool
rotationEnabled) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Bool
a -> SecretListEntry
s {$sel:rotationEnabled:SecretListEntry' :: Maybe Bool
rotationEnabled = Maybe Bool
a} :: SecretListEntry)

-- | The ARN of an Amazon Web Services Lambda function invoked by Secrets
-- Manager to rotate and expire the secret either automatically per the
-- schedule or manually by a call to
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html RotateSecret>
-- .
secretListEntry_rotationLambdaARN :: Lens.Lens' SecretListEntry (Prelude.Maybe Prelude.Text)
secretListEntry_rotationLambdaARN :: Lens' SecretListEntry (Maybe Text)
secretListEntry_rotationLambdaARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe Text
rotationLambdaARN :: Maybe Text
$sel:rotationLambdaARN:SecretListEntry' :: SecretListEntry -> Maybe Text
rotationLambdaARN} -> Maybe Text
rotationLambdaARN) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe Text
a -> SecretListEntry
s {$sel:rotationLambdaARN:SecretListEntry' :: Maybe Text
rotationLambdaARN = Maybe Text
a} :: SecretListEntry)

-- | A structure that defines the rotation configuration for the secret.
secretListEntry_rotationRules :: Lens.Lens' SecretListEntry (Prelude.Maybe RotationRulesType)
secretListEntry_rotationRules :: Lens' SecretListEntry (Maybe RotationRulesType)
secretListEntry_rotationRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe RotationRulesType
rotationRules :: Maybe RotationRulesType
$sel:rotationRules:SecretListEntry' :: SecretListEntry -> Maybe RotationRulesType
rotationRules} -> Maybe RotationRulesType
rotationRules) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe RotationRulesType
a -> SecretListEntry
s {$sel:rotationRules:SecretListEntry' :: Maybe RotationRulesType
rotationRules = Maybe RotationRulesType
a} :: SecretListEntry)

-- | A list of all of the currently assigned @SecretVersionStage@ staging
-- labels and the @SecretVersionId@ attached to each one. Staging labels
-- are used to keep track of the different versions during the rotation
-- process.
--
-- A version that does not have any @SecretVersionStage@ is considered
-- deprecated and subject to deletion. Such versions are not included in
-- this list.
secretListEntry_secretVersionsToStages :: Lens.Lens' SecretListEntry (Prelude.Maybe (Prelude.HashMap Prelude.Text (Prelude.NonEmpty Prelude.Text)))
secretListEntry_secretVersionsToStages :: Lens' SecretListEntry (Maybe (HashMap Text (NonEmpty Text)))
secretListEntry_secretVersionsToStages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages :: Maybe (HashMap Text (NonEmpty Text))
$sel:secretVersionsToStages:SecretListEntry' :: SecretListEntry -> Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages} -> Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe (HashMap Text (NonEmpty Text))
a -> SecretListEntry
s {$sel:secretVersionsToStages:SecretListEntry' :: Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages = Maybe (HashMap Text (NonEmpty Text))
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of user-defined tags associated with the secret. To add tags to
-- a secret, use
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html TagResource>
-- . To remove tags, use
-- <https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html UntagResource>
-- .
secretListEntry_tags :: Lens.Lens' SecretListEntry (Prelude.Maybe [Tag])
secretListEntry_tags :: Lens' SecretListEntry (Maybe [Tag])
secretListEntry_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretListEntry' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:SecretListEntry' :: SecretListEntry -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: SecretListEntry
s@SecretListEntry' {} Maybe [Tag]
a -> SecretListEntry
s {$sel:tags:SecretListEntry' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: SecretListEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON SecretListEntry where
  parseJSON :: Value -> Parser SecretListEntry
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SecretListEntry"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe RotationRulesType
-> Maybe (HashMap Text (NonEmpty Text))
-> Maybe [Tag]
-> SecretListEntry
SecretListEntry'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeletedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KmsKeyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastAccessedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastChangedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastRotatedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NextRotationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OwningService")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PrimaryRegion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RotationEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RotationLambdaARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RotationRules")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecretVersionsToStages"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable SecretListEntry where
  hashWithSalt :: Int -> SecretListEntry -> Int
hashWithSalt Int
_salt SecretListEntry' {Maybe Bool
Maybe [Tag]
Maybe Text
Maybe (HashMap Text (NonEmpty Text))
Maybe POSIX
Maybe RotationRulesType
tags :: Maybe [Tag]
secretVersionsToStages :: Maybe (HashMap Text (NonEmpty Text))
rotationRules :: Maybe RotationRulesType
rotationLambdaARN :: Maybe Text
rotationEnabled :: Maybe Bool
primaryRegion :: Maybe Text
owningService :: Maybe Text
nextRotationDate :: Maybe POSIX
name :: Maybe Text
lastRotatedDate :: Maybe POSIX
lastChangedDate :: Maybe POSIX
lastAccessedDate :: Maybe POSIX
kmsKeyId :: Maybe Text
description :: Maybe Text
deletedDate :: Maybe POSIX
createdDate :: Maybe POSIX
arn :: Maybe Text
$sel:tags:SecretListEntry' :: SecretListEntry -> Maybe [Tag]
$sel:secretVersionsToStages:SecretListEntry' :: SecretListEntry -> Maybe (HashMap Text (NonEmpty Text))
$sel:rotationRules:SecretListEntry' :: SecretListEntry -> Maybe RotationRulesType
$sel:rotationLambdaARN:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:rotationEnabled:SecretListEntry' :: SecretListEntry -> Maybe Bool
$sel:primaryRegion:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:owningService:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:nextRotationDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:name:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:lastRotatedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:lastChangedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:lastAccessedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:kmsKeyId:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:description:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:deletedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:createdDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:arn:SecretListEntry' :: SecretListEntry -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
deletedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastAccessedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastChangedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastRotatedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
nextRotationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
owningService
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
primaryRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
rotationEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rotationLambdaARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RotationRulesType
rotationRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData SecretListEntry where
  rnf :: SecretListEntry -> ()
rnf SecretListEntry' {Maybe Bool
Maybe [Tag]
Maybe Text
Maybe (HashMap Text (NonEmpty Text))
Maybe POSIX
Maybe RotationRulesType
tags :: Maybe [Tag]
secretVersionsToStages :: Maybe (HashMap Text (NonEmpty Text))
rotationRules :: Maybe RotationRulesType
rotationLambdaARN :: Maybe Text
rotationEnabled :: Maybe Bool
primaryRegion :: Maybe Text
owningService :: Maybe Text
nextRotationDate :: Maybe POSIX
name :: Maybe Text
lastRotatedDate :: Maybe POSIX
lastChangedDate :: Maybe POSIX
lastAccessedDate :: Maybe POSIX
kmsKeyId :: Maybe Text
description :: Maybe Text
deletedDate :: Maybe POSIX
createdDate :: Maybe POSIX
arn :: Maybe Text
$sel:tags:SecretListEntry' :: SecretListEntry -> Maybe [Tag]
$sel:secretVersionsToStages:SecretListEntry' :: SecretListEntry -> Maybe (HashMap Text (NonEmpty Text))
$sel:rotationRules:SecretListEntry' :: SecretListEntry -> Maybe RotationRulesType
$sel:rotationLambdaARN:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:rotationEnabled:SecretListEntry' :: SecretListEntry -> Maybe Bool
$sel:primaryRegion:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:owningService:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:nextRotationDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:name:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:lastRotatedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:lastChangedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:lastAccessedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:kmsKeyId:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:description:SecretListEntry' :: SecretListEntry -> Maybe Text
$sel:deletedDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:createdDate:SecretListEntry' :: SecretListEntry -> Maybe POSIX
$sel:arn:SecretListEntry' :: SecretListEntry -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
deletedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastAccessedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastChangedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastRotatedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
nextRotationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
owningService
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
primaryRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
rotationEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rotationLambdaARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RotationRulesType
rotationRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text (NonEmpty Text))
secretVersionsToStages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags