{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityHub.Types.AwsSecretsManagerSecretDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsSecretsManagerSecretDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsSecretsManagerSecretRotationRules

-- | Details about an Secrets Manager secret.
--
-- /See:/ 'newAwsSecretsManagerSecretDetails' smart constructor.
data AwsSecretsManagerSecretDetails = AwsSecretsManagerSecretDetails'
  { -- | Defines the rotation schedule for the secret.
    AwsSecretsManagerSecretDetails
-> Maybe AwsSecretsManagerSecretRotationRules
rotationRules :: Prelude.Maybe AwsSecretsManagerSecretRotationRules,
    -- | Whether rotation is enabled.
    AwsSecretsManagerSecretDetails -> Maybe Bool
rotationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN, Key ID, or alias of the KMS key used to encrypt the
    -- @SecretString@ or @SecretBinary@ values for versions of this secret.
    AwsSecretsManagerSecretDetails -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The name of the secret.
    AwsSecretsManagerSecretDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Whether the secret is deleted.
    AwsSecretsManagerSecretDetails -> Maybe Bool
deleted :: Prelude.Maybe Prelude.Bool,
    -- | The user-provided description of the secret.
    AwsSecretsManagerSecretDetails -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Whether the rotation occurred within the specified rotation frequency.
    AwsSecretsManagerSecretDetails -> Maybe Bool
rotationOccurredWithinFrequency :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the Lambda function that rotates the secret.
    AwsSecretsManagerSecretDetails -> Maybe Text
rotationLambdaArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsSecretsManagerSecretDetails
-> AwsSecretsManagerSecretDetails -> Bool
(AwsSecretsManagerSecretDetails
 -> AwsSecretsManagerSecretDetails -> Bool)
-> (AwsSecretsManagerSecretDetails
    -> AwsSecretsManagerSecretDetails -> Bool)
-> Eq AwsSecretsManagerSecretDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsSecretsManagerSecretDetails
-> AwsSecretsManagerSecretDetails -> Bool
$c/= :: AwsSecretsManagerSecretDetails
-> AwsSecretsManagerSecretDetails -> Bool
== :: AwsSecretsManagerSecretDetails
-> AwsSecretsManagerSecretDetails -> Bool
$c== :: AwsSecretsManagerSecretDetails
-> AwsSecretsManagerSecretDetails -> Bool
Prelude.Eq, ReadPrec [AwsSecretsManagerSecretDetails]
ReadPrec AwsSecretsManagerSecretDetails
Int -> ReadS AwsSecretsManagerSecretDetails
ReadS [AwsSecretsManagerSecretDetails]
(Int -> ReadS AwsSecretsManagerSecretDetails)
-> ReadS [AwsSecretsManagerSecretDetails]
-> ReadPrec AwsSecretsManagerSecretDetails
-> ReadPrec [AwsSecretsManagerSecretDetails]
-> Read AwsSecretsManagerSecretDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsSecretsManagerSecretDetails]
$creadListPrec :: ReadPrec [AwsSecretsManagerSecretDetails]
readPrec :: ReadPrec AwsSecretsManagerSecretDetails
$creadPrec :: ReadPrec AwsSecretsManagerSecretDetails
readList :: ReadS [AwsSecretsManagerSecretDetails]
$creadList :: ReadS [AwsSecretsManagerSecretDetails]
readsPrec :: Int -> ReadS AwsSecretsManagerSecretDetails
$creadsPrec :: Int -> ReadS AwsSecretsManagerSecretDetails
Prelude.Read, Int -> AwsSecretsManagerSecretDetails -> ShowS
[AwsSecretsManagerSecretDetails] -> ShowS
AwsSecretsManagerSecretDetails -> String
(Int -> AwsSecretsManagerSecretDetails -> ShowS)
-> (AwsSecretsManagerSecretDetails -> String)
-> ([AwsSecretsManagerSecretDetails] -> ShowS)
-> Show AwsSecretsManagerSecretDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsSecretsManagerSecretDetails] -> ShowS
$cshowList :: [AwsSecretsManagerSecretDetails] -> ShowS
show :: AwsSecretsManagerSecretDetails -> String
$cshow :: AwsSecretsManagerSecretDetails -> String
showsPrec :: Int -> AwsSecretsManagerSecretDetails -> ShowS
$cshowsPrec :: Int -> AwsSecretsManagerSecretDetails -> ShowS
Prelude.Show, (forall x.
 AwsSecretsManagerSecretDetails
 -> Rep AwsSecretsManagerSecretDetails x)
-> (forall x.
    Rep AwsSecretsManagerSecretDetails x
    -> AwsSecretsManagerSecretDetails)
-> Generic AwsSecretsManagerSecretDetails
forall x.
Rep AwsSecretsManagerSecretDetails x
-> AwsSecretsManagerSecretDetails
forall x.
AwsSecretsManagerSecretDetails
-> Rep AwsSecretsManagerSecretDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsSecretsManagerSecretDetails x
-> AwsSecretsManagerSecretDetails
$cfrom :: forall x.
AwsSecretsManagerSecretDetails
-> Rep AwsSecretsManagerSecretDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsSecretsManagerSecretDetails' 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:
--
-- 'rotationRules', 'awsSecretsManagerSecretDetails_rotationRules' - Defines the rotation schedule for the secret.
--
-- 'rotationEnabled', 'awsSecretsManagerSecretDetails_rotationEnabled' - Whether rotation is enabled.
--
-- 'kmsKeyId', 'awsSecretsManagerSecretDetails_kmsKeyId' - The ARN, Key ID, or alias of the KMS key used to encrypt the
-- @SecretString@ or @SecretBinary@ values for versions of this secret.
--
-- 'name', 'awsSecretsManagerSecretDetails_name' - The name of the secret.
--
-- 'deleted', 'awsSecretsManagerSecretDetails_deleted' - Whether the secret is deleted.
--
-- 'description', 'awsSecretsManagerSecretDetails_description' - The user-provided description of the secret.
--
-- 'rotationOccurredWithinFrequency', 'awsSecretsManagerSecretDetails_rotationOccurredWithinFrequency' - Whether the rotation occurred within the specified rotation frequency.
--
-- 'rotationLambdaArn', 'awsSecretsManagerSecretDetails_rotationLambdaArn' - The ARN of the Lambda function that rotates the secret.
newAwsSecretsManagerSecretDetails ::
  AwsSecretsManagerSecretDetails
newAwsSecretsManagerSecretDetails :: AwsSecretsManagerSecretDetails
newAwsSecretsManagerSecretDetails =
  AwsSecretsManagerSecretDetails' :: Maybe AwsSecretsManagerSecretRotationRules
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> AwsSecretsManagerSecretDetails
AwsSecretsManagerSecretDetails'
    { $sel:rotationRules:AwsSecretsManagerSecretDetails' :: Maybe AwsSecretsManagerSecretRotationRules
rotationRules =
        Maybe AwsSecretsManagerSecretRotationRules
forall a. Maybe a
Prelude.Nothing,
      $sel:rotationEnabled:AwsSecretsManagerSecretDetails' :: Maybe Bool
rotationEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:AwsSecretsManagerSecretDetails' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsSecretsManagerSecretDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deleted:AwsSecretsManagerSecretDetails' :: Maybe Bool
deleted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AwsSecretsManagerSecretDetails' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rotationOccurredWithinFrequency:AwsSecretsManagerSecretDetails' :: Maybe Bool
rotationOccurredWithinFrequency =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:rotationLambdaArn:AwsSecretsManagerSecretDetails' :: Maybe Text
rotationLambdaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Defines the rotation schedule for the secret.
awsSecretsManagerSecretDetails_rotationRules :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe AwsSecretsManagerSecretRotationRules)
awsSecretsManagerSecretDetails_rotationRules :: (Maybe AwsSecretsManagerSecretRotationRules
 -> f (Maybe AwsSecretsManagerSecretRotationRules))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_rotationRules = (AwsSecretsManagerSecretDetails
 -> Maybe AwsSecretsManagerSecretRotationRules)
-> (AwsSecretsManagerSecretDetails
    -> Maybe AwsSecretsManagerSecretRotationRules
    -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe AwsSecretsManagerSecretRotationRules)
     (Maybe AwsSecretsManagerSecretRotationRules)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe AwsSecretsManagerSecretRotationRules
rotationRules :: Maybe AwsSecretsManagerSecretRotationRules
$sel:rotationRules:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails
-> Maybe AwsSecretsManagerSecretRotationRules
rotationRules} -> Maybe AwsSecretsManagerSecretRotationRules
rotationRules) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe AwsSecretsManagerSecretRotationRules
a -> AwsSecretsManagerSecretDetails
s {$sel:rotationRules:AwsSecretsManagerSecretDetails' :: Maybe AwsSecretsManagerSecretRotationRules
rotationRules = Maybe AwsSecretsManagerSecretRotationRules
a} :: AwsSecretsManagerSecretDetails)

-- | Whether rotation is enabled.
awsSecretsManagerSecretDetails_rotationEnabled :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Bool)
awsSecretsManagerSecretDetails_rotationEnabled :: (Maybe Bool -> f (Maybe Bool))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_rotationEnabled = (AwsSecretsManagerSecretDetails -> Maybe Bool)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Bool -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Bool
rotationEnabled :: Maybe Bool
$sel:rotationEnabled:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
rotationEnabled} -> Maybe Bool
rotationEnabled) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Bool
a -> AwsSecretsManagerSecretDetails
s {$sel:rotationEnabled:AwsSecretsManagerSecretDetails' :: Maybe Bool
rotationEnabled = Maybe Bool
a} :: AwsSecretsManagerSecretDetails)

-- | The ARN, Key ID, or alias of the KMS key used to encrypt the
-- @SecretString@ or @SecretBinary@ values for versions of this secret.
awsSecretsManagerSecretDetails_kmsKeyId :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Text)
awsSecretsManagerSecretDetails_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_kmsKeyId = (AwsSecretsManagerSecretDetails -> Maybe Text)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Text -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Text
a -> AwsSecretsManagerSecretDetails
s {$sel:kmsKeyId:AwsSecretsManagerSecretDetails' :: Maybe Text
kmsKeyId = Maybe Text
a} :: AwsSecretsManagerSecretDetails)

-- | The name of the secret.
awsSecretsManagerSecretDetails_name :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Text)
awsSecretsManagerSecretDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_name = (AwsSecretsManagerSecretDetails -> Maybe Text)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Text -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Text
a -> AwsSecretsManagerSecretDetails
s {$sel:name:AwsSecretsManagerSecretDetails' :: Maybe Text
name = Maybe Text
a} :: AwsSecretsManagerSecretDetails)

-- | Whether the secret is deleted.
awsSecretsManagerSecretDetails_deleted :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Bool)
awsSecretsManagerSecretDetails_deleted :: (Maybe Bool -> f (Maybe Bool))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_deleted = (AwsSecretsManagerSecretDetails -> Maybe Bool)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Bool -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Bool
deleted :: Maybe Bool
$sel:deleted:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
deleted} -> Maybe Bool
deleted) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Bool
a -> AwsSecretsManagerSecretDetails
s {$sel:deleted:AwsSecretsManagerSecretDetails' :: Maybe Bool
deleted = Maybe Bool
a} :: AwsSecretsManagerSecretDetails)

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

-- | Whether the rotation occurred within the specified rotation frequency.
awsSecretsManagerSecretDetails_rotationOccurredWithinFrequency :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Bool)
awsSecretsManagerSecretDetails_rotationOccurredWithinFrequency :: (Maybe Bool -> f (Maybe Bool))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_rotationOccurredWithinFrequency = (AwsSecretsManagerSecretDetails -> Maybe Bool)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Bool -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Bool
rotationOccurredWithinFrequency :: Maybe Bool
$sel:rotationOccurredWithinFrequency:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
rotationOccurredWithinFrequency} -> Maybe Bool
rotationOccurredWithinFrequency) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Bool
a -> AwsSecretsManagerSecretDetails
s {$sel:rotationOccurredWithinFrequency:AwsSecretsManagerSecretDetails' :: Maybe Bool
rotationOccurredWithinFrequency = Maybe Bool
a} :: AwsSecretsManagerSecretDetails)

-- | The ARN of the Lambda function that rotates the secret.
awsSecretsManagerSecretDetails_rotationLambdaArn :: Lens.Lens' AwsSecretsManagerSecretDetails (Prelude.Maybe Prelude.Text)
awsSecretsManagerSecretDetails_rotationLambdaArn :: (Maybe Text -> f (Maybe Text))
-> AwsSecretsManagerSecretDetails
-> f AwsSecretsManagerSecretDetails
awsSecretsManagerSecretDetails_rotationLambdaArn = (AwsSecretsManagerSecretDetails -> Maybe Text)
-> (AwsSecretsManagerSecretDetails
    -> Maybe Text -> AwsSecretsManagerSecretDetails)
-> Lens
     AwsSecretsManagerSecretDetails
     AwsSecretsManagerSecretDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecretsManagerSecretDetails' {Maybe Text
rotationLambdaArn :: Maybe Text
$sel:rotationLambdaArn:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
rotationLambdaArn} -> Maybe Text
rotationLambdaArn) (\s :: AwsSecretsManagerSecretDetails
s@AwsSecretsManagerSecretDetails' {} Maybe Text
a -> AwsSecretsManagerSecretDetails
s {$sel:rotationLambdaArn:AwsSecretsManagerSecretDetails' :: Maybe Text
rotationLambdaArn = Maybe Text
a} :: AwsSecretsManagerSecretDetails)

instance Core.FromJSON AwsSecretsManagerSecretDetails where
  parseJSON :: Value -> Parser AwsSecretsManagerSecretDetails
parseJSON =
    String
-> (Object -> Parser AwsSecretsManagerSecretDetails)
-> Value
-> Parser AwsSecretsManagerSecretDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsSecretsManagerSecretDetails"
      ( \Object
x ->
          Maybe AwsSecretsManagerSecretRotationRules
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> AwsSecretsManagerSecretDetails
AwsSecretsManagerSecretDetails'
            (Maybe AwsSecretsManagerSecretRotationRules
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe AwsSecretsManagerSecretRotationRules)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> AwsSecretsManagerSecretDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe AwsSecretsManagerSecretRotationRules)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RotationRules")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> AwsSecretsManagerSecretDetails)
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
"RotationEnabled")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> AwsSecretsManagerSecretDetails)
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
"KmsKeyId")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> AwsSecretsManagerSecretDetails)
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
"Name")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool -> Maybe Text -> AwsSecretsManagerSecretDetails)
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
"Deleted")
            Parser
  (Maybe Text
   -> Maybe Bool -> Maybe Text -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool -> Maybe Text -> AwsSecretsManagerSecretDetails)
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 Bool -> Maybe Text -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> AwsSecretsManagerSecretDetails)
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
"RotationOccurredWithinFrequency")
            Parser (Maybe Text -> AwsSecretsManagerSecretDetails)
-> Parser (Maybe Text) -> Parser AwsSecretsManagerSecretDetails
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
"RotationLambdaArn")
      )

instance
  Prelude.Hashable
    AwsSecretsManagerSecretDetails

instance
  Prelude.NFData
    AwsSecretsManagerSecretDetails

instance Core.ToJSON AwsSecretsManagerSecretDetails where
  toJSON :: AwsSecretsManagerSecretDetails -> Value
toJSON AwsSecretsManagerSecretDetails' {Maybe Bool
Maybe Text
Maybe AwsSecretsManagerSecretRotationRules
rotationLambdaArn :: Maybe Text
rotationOccurredWithinFrequency :: Maybe Bool
description :: Maybe Text
deleted :: Maybe Bool
name :: Maybe Text
kmsKeyId :: Maybe Text
rotationEnabled :: Maybe Bool
rotationRules :: Maybe AwsSecretsManagerSecretRotationRules
$sel:rotationLambdaArn:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
$sel:rotationOccurredWithinFrequency:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
$sel:description:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
$sel:deleted:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
$sel:name:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
$sel:kmsKeyId:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Text
$sel:rotationEnabled:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails -> Maybe Bool
$sel:rotationRules:AwsSecretsManagerSecretDetails' :: AwsSecretsManagerSecretDetails
-> Maybe AwsSecretsManagerSecretRotationRules
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RotationRules" Text -> AwsSecretsManagerSecretRotationRules -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AwsSecretsManagerSecretRotationRules -> Pair)
-> Maybe AwsSecretsManagerSecretRotationRules -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsSecretsManagerSecretRotationRules
rotationRules,
            (Text
"RotationEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
rotationEnabled,
            (Text
"KmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Deleted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleted,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"RotationOccurredWithinFrequency" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
rotationOccurredWithinFrequency,
            (Text
"RotationLambdaArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rotationLambdaArn
          ]
      )