{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PutSecretValue
-- 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)
--
-- Stores a new encrypted secret value in the specified secret. To do this,
-- the operation creates a new version and attaches it to the secret. The
-- version can contain a new @SecretString@ value or a new @SecretBinary@
-- value. You can also specify the staging labels that are initially
-- attached to the new version.
--
-- We recommend you avoid calling @PutSecretValue@ at a sustained rate of
-- more than once every 10 minutes. When you update the secret value,
-- Secrets Manager creates a new version of the secret. Secrets Manager
-- removes outdated versions when there are more than 100, but it does not
-- remove versions created less than 24 hours ago. If you call
-- @PutSecretValue@ more than once every 10 minutes, you create more
-- versions than Secrets Manager removes, and you will reach the quota for
-- secret versions.
--
-- -   If this operation creates the first version for the secret then
--     Secrets Manager automatically attaches the staging label
--     @AWSCURRENT@ to the new version.
--
-- -   If you do not specify a value for VersionStages then Secrets Manager
--     automatically moves the staging label @AWSCURRENT@ to this new
--     version.
--
-- -   If this operation moves the staging label @AWSCURRENT@ from another
--     version to this version, then Secrets Manager also automatically
--     moves the staging label @AWSPREVIOUS@ to the version that
--     @AWSCURRENT@ was removed from.
--
-- -   This operation is idempotent. If a version with a @VersionId@ with
--     the same value as the @ClientRequestToken@ parameter already exists
--     and you specify the same secret data, the operation succeeds but
--     does nothing. However, if the secret data is different, then the
--     operation fails because you cannot modify an existing version; you
--     can only create new ones.
--
-- -   If you call an operation to encrypt or decrypt the @SecretString@ or
--     @SecretBinary@ for a secret in the same account as the calling user
--     and that secret doesn\'t specify a Amazon Web Services KMS
--     encryption key, Secrets Manager uses the account\'s default Amazon
--     Web Services managed customer master key (CMK) with the alias
--     @aws\/secretsmanager@. If this key doesn\'t already exist in your
--     account then Secrets Manager creates it for you automatically. All
--     users and roles in the same Amazon Web Services account
--     automatically have access to use the default CMK. Note that if an
--     Secrets Manager API call results in Amazon Web Services creating the
--     account\'s Amazon Web Services-managed CMK, it can result in a
--     one-time significant delay in returning the result.
--
-- -   If the secret resides in a different Amazon Web Services account
--     from the credentials calling an API that requires encryption or
--     decryption of the secret value then you must create and use a custom
--     Amazon Web Services KMS CMK because you can\'t access the default
--     CMK for the account using credentials from a different Amazon Web
--     Services account. Store the ARN of the CMK in the secret when you
--     create the secret or when you update it by including it in the
--     @KMSKeyId@. If you call an API that must encrypt or decrypt
--     @SecretString@ or @SecretBinary@ using credentials from a different
--     account then the Amazon Web Services KMS key policy must grant
--     cross-account access to that other account\'s user or role for both
--     the kms:GenerateDataKey and kms:Decrypt operations.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   secretsmanager:PutSecretValue
--
-- -   kms:GenerateDataKey - needed only if you use a customer-managed
--     Amazon Web Services KMS key to encrypt the secret. You do not need
--     this permission to use the account\'s default Amazon Web Services
--     managed CMK for Secrets Manager.
--
-- __Related operations__
--
-- -   To retrieve the encrypted value you store in the version of a
--     secret, use GetSecretValue.
--
-- -   To create a secret, use CreateSecret.
--
-- -   To get the details for a secret, use DescribeSecret.
--
-- -   To list the versions attached to a secret, use ListSecretVersionIds.
module Amazonka.SecretsManager.PutSecretValue
  ( -- * Creating a Request
    PutSecretValue (..),
    newPutSecretValue,

    -- * Request Lenses
    putSecretValue_versionStages,
    putSecretValue_secretBinary,
    putSecretValue_secretString,
    putSecretValue_clientRequestToken,
    putSecretValue_secretId,

    -- * Destructuring the Response
    PutSecretValueResponse (..),
    newPutSecretValueResponse,

    -- * Response Lenses
    putSecretValueResponse_versionId,
    putSecretValueResponse_arn,
    putSecretValueResponse_versionStages,
    putSecretValueResponse_name,
    putSecretValueResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecretsManager.Types

-- | /See:/ 'newPutSecretValue' smart constructor.
data PutSecretValue = PutSecretValue'
  { -- | (Optional) Specifies a list of staging labels that are attached to this
    -- version of the secret. These staging labels are used to track the
    -- versions through the rotation process by the Lambda rotation function.
    --
    -- A staging label must be unique to a single version of the secret. If you
    -- specify a staging label that\'s already associated with a different
    -- version of the same secret then that staging label is automatically
    -- removed from the other version and attached to this version.
    --
    -- If you do not specify a value for @VersionStages@ then Secrets Manager
    -- automatically moves the staging label @AWSCURRENT@ to this new version.
    PutSecretValue -> Maybe (NonEmpty Text)
versionStages :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | (Optional) Specifies binary data that you want to encrypt and store in
    -- the new version of the secret. To use this parameter in the command-line
    -- tools, we recommend that you store your binary data in a file and then
    -- use the appropriate technique for your tool to pass the contents of the
    -- file as a parameter. Either @SecretBinary@ or @SecretString@ must have a
    -- value, but not both. They cannot both be empty.
    --
    -- This parameter is not accessible if the secret using the Secrets Manager
    -- console.
    PutSecretValue -> Maybe (Sensitive Base64)
secretBinary :: Prelude.Maybe (Core.Sensitive Core.Base64),
    -- | (Optional) Specifies text data that you want to encrypt and store in
    -- this new version of the secret. Either @SecretString@ or @SecretBinary@
    -- must have a value, but not both. They cannot both be empty.
    --
    -- If you create this secret by using the Secrets Manager console then
    -- Secrets Manager puts the protected secret text in only the
    -- @SecretString@ parameter. The Secrets Manager console stores the
    -- information as a JSON structure of key\/value pairs that the default
    -- Lambda rotation function knows how to parse.
    --
    -- For storing multiple values, we recommend that you use a JSON text
    -- string argument and specify key\/value pairs. For more information, see
    -- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html Specifying parameter values for the Amazon Web Services CLI>
    -- in the Amazon Web Services CLI User Guide.
    PutSecretValue -> Maybe (Sensitive Text)
secretString :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | (Optional) Specifies a unique identifier for the new version of the
    -- secret.
    --
    -- If you use the Amazon Web Services CLI or one of the Amazon Web Services
    -- SDK to call this operation, then you can leave this parameter empty. The
    -- CLI or SDK generates a random UUID for you and includes that in the
    -- request. If you don\'t use the SDK and instead generate a raw HTTP
    -- request to the Secrets Manager service endpoint, then you must generate
    -- a @ClientRequestToken@ yourself for new versions and include that value
    -- in the request.
    --
    -- This value helps ensure idempotency. Secrets Manager uses this value to
    -- prevent the accidental creation of duplicate versions if there are
    -- failures and retries during the Lambda rotation function\'s processing.
    -- We recommend that you generate a
    -- <https://wikipedia.org/wiki/Universally_unique_identifier UUID-type>
    -- value to ensure uniqueness within the specified secret.
    --
    -- -   If the @ClientRequestToken@ value isn\'t already associated with a
    --     version of the secret then a new version of the secret is created.
    --
    -- -   If a version with this value already exists and that version\'s
    --     @SecretString@ or @SecretBinary@ values are the same as those in the
    --     request then the request is ignored (the operation is idempotent).
    --
    -- -   If a version with this value already exists and the version of the
    --     @SecretString@ and @SecretBinary@ values are different from those in
    --     the request then the request fails because you cannot modify an
    --     existing secret version. You can only create new versions to store
    --     new secret values.
    --
    -- This value becomes the @VersionId@ of the new version.
    PutSecretValue -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the secret to which you want to add a new version. You can
    -- specify either the Amazon Resource Name (ARN) or the friendly name of
    -- the secret. The secret must already exist.
    --
    -- For an ARN, we recommend that you specify a complete ARN rather than a
    -- partial ARN.
    PutSecretValue -> Text
secretId :: Prelude.Text
  }
  deriving (PutSecretValue -> PutSecretValue -> Bool
(PutSecretValue -> PutSecretValue -> Bool)
-> (PutSecretValue -> PutSecretValue -> Bool) -> Eq PutSecretValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutSecretValue -> PutSecretValue -> Bool
$c/= :: PutSecretValue -> PutSecretValue -> Bool
== :: PutSecretValue -> PutSecretValue -> Bool
$c== :: PutSecretValue -> PutSecretValue -> Bool
Prelude.Eq, Int -> PutSecretValue -> ShowS
[PutSecretValue] -> ShowS
PutSecretValue -> String
(Int -> PutSecretValue -> ShowS)
-> (PutSecretValue -> String)
-> ([PutSecretValue] -> ShowS)
-> Show PutSecretValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutSecretValue] -> ShowS
$cshowList :: [PutSecretValue] -> ShowS
show :: PutSecretValue -> String
$cshow :: PutSecretValue -> String
showsPrec :: Int -> PutSecretValue -> ShowS
$cshowsPrec :: Int -> PutSecretValue -> ShowS
Prelude.Show, (forall x. PutSecretValue -> Rep PutSecretValue x)
-> (forall x. Rep PutSecretValue x -> PutSecretValue)
-> Generic PutSecretValue
forall x. Rep PutSecretValue x -> PutSecretValue
forall x. PutSecretValue -> Rep PutSecretValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutSecretValue x -> PutSecretValue
$cfrom :: forall x. PutSecretValue -> Rep PutSecretValue x
Prelude.Generic)

-- |
-- Create a value of 'PutSecretValue' 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:
--
-- 'versionStages', 'putSecretValue_versionStages' - (Optional) Specifies a list of staging labels that are attached to this
-- version of the secret. These staging labels are used to track the
-- versions through the rotation process by the Lambda rotation function.
--
-- A staging label must be unique to a single version of the secret. If you
-- specify a staging label that\'s already associated with a different
-- version of the same secret then that staging label is automatically
-- removed from the other version and attached to this version.
--
-- If you do not specify a value for @VersionStages@ then Secrets Manager
-- automatically moves the staging label @AWSCURRENT@ to this new version.
--
-- 'secretBinary', 'putSecretValue_secretBinary' - (Optional) Specifies binary data that you want to encrypt and store in
-- the new version of the secret. To use this parameter in the command-line
-- tools, we recommend that you store your binary data in a file and then
-- use the appropriate technique for your tool to pass the contents of the
-- file as a parameter. Either @SecretBinary@ or @SecretString@ must have a
-- value, but not both. They cannot both be empty.
--
-- This parameter is not accessible if the secret using the Secrets Manager
-- console.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'secretString', 'putSecretValue_secretString' - (Optional) Specifies text data that you want to encrypt and store in
-- this new version of the secret. Either @SecretString@ or @SecretBinary@
-- must have a value, but not both. They cannot both be empty.
--
-- If you create this secret by using the Secrets Manager console then
-- Secrets Manager puts the protected secret text in only the
-- @SecretString@ parameter. The Secrets Manager console stores the
-- information as a JSON structure of key\/value pairs that the default
-- Lambda rotation function knows how to parse.
--
-- For storing multiple values, we recommend that you use a JSON text
-- string argument and specify key\/value pairs. For more information, see
-- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html Specifying parameter values for the Amazon Web Services CLI>
-- in the Amazon Web Services CLI User Guide.
--
-- 'clientRequestToken', 'putSecretValue_clientRequestToken' - (Optional) Specifies a unique identifier for the new version of the
-- secret.
--
-- If you use the Amazon Web Services CLI or one of the Amazon Web Services
-- SDK to call this operation, then you can leave this parameter empty. The
-- CLI or SDK generates a random UUID for you and includes that in the
-- request. If you don\'t use the SDK and instead generate a raw HTTP
-- request to the Secrets Manager service endpoint, then you must generate
-- a @ClientRequestToken@ yourself for new versions and include that value
-- in the request.
--
-- This value helps ensure idempotency. Secrets Manager uses this value to
-- prevent the accidental creation of duplicate versions if there are
-- failures and retries during the Lambda rotation function\'s processing.
-- We recommend that you generate a
-- <https://wikipedia.org/wiki/Universally_unique_identifier UUID-type>
-- value to ensure uniqueness within the specified secret.
--
-- -   If the @ClientRequestToken@ value isn\'t already associated with a
--     version of the secret then a new version of the secret is created.
--
-- -   If a version with this value already exists and that version\'s
--     @SecretString@ or @SecretBinary@ values are the same as those in the
--     request then the request is ignored (the operation is idempotent).
--
-- -   If a version with this value already exists and the version of the
--     @SecretString@ and @SecretBinary@ values are different from those in
--     the request then the request fails because you cannot modify an
--     existing secret version. You can only create new versions to store
--     new secret values.
--
-- This value becomes the @VersionId@ of the new version.
--
-- 'secretId', 'putSecretValue_secretId' - Specifies the secret to which you want to add a new version. You can
-- specify either the Amazon Resource Name (ARN) or the friendly name of
-- the secret. The secret must already exist.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
newPutSecretValue ::
  -- | 'secretId'
  Prelude.Text ->
  PutSecretValue
newPutSecretValue :: Text -> PutSecretValue
newPutSecretValue Text
pSecretId_ =
  PutSecretValue' :: Maybe (NonEmpty Text)
-> Maybe (Sensitive Base64)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Text
-> PutSecretValue
PutSecretValue'
    { $sel:versionStages:PutSecretValue' :: Maybe (NonEmpty Text)
versionStages = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:secretBinary:PutSecretValue' :: Maybe (Sensitive Base64)
secretBinary = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
      $sel:secretString:PutSecretValue' :: Maybe (Sensitive Text)
secretString = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:PutSecretValue' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretId:PutSecretValue' :: Text
secretId = Text
pSecretId_
    }

-- | (Optional) Specifies a list of staging labels that are attached to this
-- version of the secret. These staging labels are used to track the
-- versions through the rotation process by the Lambda rotation function.
--
-- A staging label must be unique to a single version of the secret. If you
-- specify a staging label that\'s already associated with a different
-- version of the same secret then that staging label is automatically
-- removed from the other version and attached to this version.
--
-- If you do not specify a value for @VersionStages@ then Secrets Manager
-- automatically moves the staging label @AWSCURRENT@ to this new version.
putSecretValue_versionStages :: Lens.Lens' PutSecretValue (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
putSecretValue_versionStages :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutSecretValue -> f PutSecretValue
putSecretValue_versionStages = (PutSecretValue -> Maybe (NonEmpty Text))
-> (PutSecretValue -> Maybe (NonEmpty Text) -> PutSecretValue)
-> Lens
     PutSecretValue
     PutSecretValue
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValue' {Maybe (NonEmpty Text)
versionStages :: Maybe (NonEmpty Text)
$sel:versionStages:PutSecretValue' :: PutSecretValue -> Maybe (NonEmpty Text)
versionStages} -> Maybe (NonEmpty Text)
versionStages) (\s :: PutSecretValue
s@PutSecretValue' {} Maybe (NonEmpty Text)
a -> PutSecretValue
s {$sel:versionStages:PutSecretValue' :: Maybe (NonEmpty Text)
versionStages = Maybe (NonEmpty Text)
a} :: PutSecretValue) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> PutSecretValue -> f PutSecretValue)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutSecretValue
-> f PutSecretValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | (Optional) Specifies binary data that you want to encrypt and store in
-- the new version of the secret. To use this parameter in the command-line
-- tools, we recommend that you store your binary data in a file and then
-- use the appropriate technique for your tool to pass the contents of the
-- file as a parameter. Either @SecretBinary@ or @SecretString@ must have a
-- value, but not both. They cannot both be empty.
--
-- This parameter is not accessible if the secret using the Secrets Manager
-- console.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
putSecretValue_secretBinary :: Lens.Lens' PutSecretValue (Prelude.Maybe Prelude.ByteString)
putSecretValue_secretBinary :: (Maybe ByteString -> f (Maybe ByteString))
-> PutSecretValue -> f PutSecretValue
putSecretValue_secretBinary = (PutSecretValue -> Maybe (Sensitive Base64))
-> (PutSecretValue -> Maybe (Sensitive Base64) -> PutSecretValue)
-> Lens
     PutSecretValue
     PutSecretValue
     (Maybe (Sensitive Base64))
     (Maybe (Sensitive Base64))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValue' {Maybe (Sensitive Base64)
secretBinary :: Maybe (Sensitive Base64)
$sel:secretBinary:PutSecretValue' :: PutSecretValue -> Maybe (Sensitive Base64)
secretBinary} -> Maybe (Sensitive Base64)
secretBinary) (\s :: PutSecretValue
s@PutSecretValue' {} Maybe (Sensitive Base64)
a -> PutSecretValue
s {$sel:secretBinary:PutSecretValue' :: Maybe (Sensitive Base64)
secretBinary = Maybe (Sensitive Base64)
a} :: PutSecretValue) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
 -> PutSecretValue -> f PutSecretValue)
-> ((Maybe ByteString -> f (Maybe ByteString))
    -> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> PutSecretValue
-> f PutSecretValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Base64) (Sensitive Base64) ByteString ByteString
-> Iso
     (Maybe (Sensitive Base64))
     (Maybe (Sensitive Base64))
     (Maybe ByteString)
     (Maybe ByteString)
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 (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
     ByteString
     ByteString
     (Sensitive Base64)
     (Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange ByteString ByteString Base64 (Identity Base64)
 -> Exchange
      ByteString
      ByteString
      (Sensitive Base64)
      (Identity (Sensitive Base64)))
-> (Exchange ByteString ByteString ByteString (Identity ByteString)
    -> Exchange ByteString ByteString Base64 (Identity Base64))
-> AnIso
     (Sensitive Base64) (Sensitive Base64) ByteString ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64)

-- | (Optional) Specifies text data that you want to encrypt and store in
-- this new version of the secret. Either @SecretString@ or @SecretBinary@
-- must have a value, but not both. They cannot both be empty.
--
-- If you create this secret by using the Secrets Manager console then
-- Secrets Manager puts the protected secret text in only the
-- @SecretString@ parameter. The Secrets Manager console stores the
-- information as a JSON structure of key\/value pairs that the default
-- Lambda rotation function knows how to parse.
--
-- For storing multiple values, we recommend that you use a JSON text
-- string argument and specify key\/value pairs. For more information, see
-- <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html Specifying parameter values for the Amazon Web Services CLI>
-- in the Amazon Web Services CLI User Guide.
putSecretValue_secretString :: Lens.Lens' PutSecretValue (Prelude.Maybe Prelude.Text)
putSecretValue_secretString :: (Maybe Text -> f (Maybe Text))
-> PutSecretValue -> f PutSecretValue
putSecretValue_secretString = (PutSecretValue -> Maybe (Sensitive Text))
-> (PutSecretValue -> Maybe (Sensitive Text) -> PutSecretValue)
-> Lens
     PutSecretValue
     PutSecretValue
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValue' {Maybe (Sensitive Text)
secretString :: Maybe (Sensitive Text)
$sel:secretString:PutSecretValue' :: PutSecretValue -> Maybe (Sensitive Text)
secretString} -> Maybe (Sensitive Text)
secretString) (\s :: PutSecretValue
s@PutSecretValue' {} Maybe (Sensitive Text)
a -> PutSecretValue
s {$sel:secretString:PutSecretValue' :: Maybe (Sensitive Text)
secretString = Maybe (Sensitive Text)
a} :: PutSecretValue) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutSecretValue -> f PutSecretValue)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutSecretValue
-> f PutSecretValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | (Optional) Specifies a unique identifier for the new version of the
-- secret.
--
-- If you use the Amazon Web Services CLI or one of the Amazon Web Services
-- SDK to call this operation, then you can leave this parameter empty. The
-- CLI or SDK generates a random UUID for you and includes that in the
-- request. If you don\'t use the SDK and instead generate a raw HTTP
-- request to the Secrets Manager service endpoint, then you must generate
-- a @ClientRequestToken@ yourself for new versions and include that value
-- in the request.
--
-- This value helps ensure idempotency. Secrets Manager uses this value to
-- prevent the accidental creation of duplicate versions if there are
-- failures and retries during the Lambda rotation function\'s processing.
-- We recommend that you generate a
-- <https://wikipedia.org/wiki/Universally_unique_identifier UUID-type>
-- value to ensure uniqueness within the specified secret.
--
-- -   If the @ClientRequestToken@ value isn\'t already associated with a
--     version of the secret then a new version of the secret is created.
--
-- -   If a version with this value already exists and that version\'s
--     @SecretString@ or @SecretBinary@ values are the same as those in the
--     request then the request is ignored (the operation is idempotent).
--
-- -   If a version with this value already exists and the version of the
--     @SecretString@ and @SecretBinary@ values are different from those in
--     the request then the request fails because you cannot modify an
--     existing secret version. You can only create new versions to store
--     new secret values.
--
-- This value becomes the @VersionId@ of the new version.
putSecretValue_clientRequestToken :: Lens.Lens' PutSecretValue (Prelude.Maybe Prelude.Text)
putSecretValue_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> PutSecretValue -> f PutSecretValue
putSecretValue_clientRequestToken = (PutSecretValue -> Maybe Text)
-> (PutSecretValue -> Maybe Text -> PutSecretValue)
-> Lens PutSecretValue PutSecretValue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValue' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:PutSecretValue' :: PutSecretValue -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: PutSecretValue
s@PutSecretValue' {} Maybe Text
a -> PutSecretValue
s {$sel:clientRequestToken:PutSecretValue' :: Maybe Text
clientRequestToken = Maybe Text
a} :: PutSecretValue)

-- | Specifies the secret to which you want to add a new version. You can
-- specify either the Amazon Resource Name (ARN) or the friendly name of
-- the secret. The secret must already exist.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
putSecretValue_secretId :: Lens.Lens' PutSecretValue Prelude.Text
putSecretValue_secretId :: (Text -> f Text) -> PutSecretValue -> f PutSecretValue
putSecretValue_secretId = (PutSecretValue -> Text)
-> (PutSecretValue -> Text -> PutSecretValue)
-> Lens PutSecretValue PutSecretValue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValue' {Text
secretId :: Text
$sel:secretId:PutSecretValue' :: PutSecretValue -> Text
secretId} -> Text
secretId) (\s :: PutSecretValue
s@PutSecretValue' {} Text
a -> PutSecretValue
s {$sel:secretId:PutSecretValue' :: Text
secretId = Text
a} :: PutSecretValue)

instance Core.AWSRequest PutSecretValue where
  type
    AWSResponse PutSecretValue =
      PutSecretValueResponse
  request :: PutSecretValue -> Request PutSecretValue
request = Service -> PutSecretValue -> Request PutSecretValue
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutSecretValue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutSecretValue)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutSecretValue))
-> Logger
-> Service
-> Proxy PutSecretValue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutSecretValue)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Int
-> PutSecretValueResponse
PutSecretValueResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Int
 -> PutSecretValueResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Int
      -> PutSecretValueResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionId")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Int
   -> PutSecretValueResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty Text)
      -> Maybe Text -> Int -> PutSecretValueResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ARN")
            Either
  String
  (Maybe (NonEmpty Text)
   -> Maybe Text -> Int -> PutSecretValueResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either String (Maybe Text -> Int -> PutSecretValueResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionStages")
            Either String (Maybe Text -> Int -> PutSecretValueResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutSecretValueResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either String (Int -> PutSecretValueResponse)
-> Either String Int -> Either String PutSecretValueResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutSecretValue

instance Prelude.NFData PutSecretValue

instance Core.ToHeaders PutSecretValue where
  toHeaders :: PutSecretValue -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutSecretValue -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"secretsmanager.PutSecretValue" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutSecretValue where
  toJSON :: PutSecretValue -> Value
toJSON PutSecretValue' {Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe (Sensitive Base64)
Text
secretId :: Text
clientRequestToken :: Maybe Text
secretString :: Maybe (Sensitive Text)
secretBinary :: Maybe (Sensitive Base64)
versionStages :: Maybe (NonEmpty Text)
$sel:secretId:PutSecretValue' :: PutSecretValue -> Text
$sel:clientRequestToken:PutSecretValue' :: PutSecretValue -> Maybe Text
$sel:secretString:PutSecretValue' :: PutSecretValue -> Maybe (Sensitive Text)
$sel:secretBinary:PutSecretValue' :: PutSecretValue -> Maybe (Sensitive Base64)
$sel:versionStages:PutSecretValue' :: PutSecretValue -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"VersionStages" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
versionStages,
            (Text
"SecretBinary" Text -> Sensitive Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Base64 -> Pair)
-> Maybe (Sensitive Base64) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Base64)
secretBinary,
            (Text
"SecretString" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
secretString,
            (Text
"ClientRequestToken" 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
clientRequestToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SecretId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretId)
          ]
      )

instance Core.ToPath PutSecretValue where
  toPath :: PutSecretValue -> ByteString
toPath = ByteString -> PutSecretValue -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PutSecretValue where
  toQuery :: PutSecretValue -> QueryString
toQuery = QueryString -> PutSecretValue -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutSecretValueResponse' smart constructor.
data PutSecretValueResponse = PutSecretValueResponse'
  { -- | The unique identifier of the version of the secret you just created or
    -- updated.
    PutSecretValueResponse -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the secret for which you just created
    -- a version.
    PutSecretValueResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The list of staging labels that are currently attached to this version
    -- of the secret. Staging labels are used to track a version as it
    -- progresses through the secret rotation process.
    PutSecretValueResponse -> Maybe (NonEmpty Text)
versionStages :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The friendly name of the secret for which you just created or updated a
    -- version.
    PutSecretValueResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PutSecretValueResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutSecretValueResponse -> PutSecretValueResponse -> Bool
(PutSecretValueResponse -> PutSecretValueResponse -> Bool)
-> (PutSecretValueResponse -> PutSecretValueResponse -> Bool)
-> Eq PutSecretValueResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutSecretValueResponse -> PutSecretValueResponse -> Bool
$c/= :: PutSecretValueResponse -> PutSecretValueResponse -> Bool
== :: PutSecretValueResponse -> PutSecretValueResponse -> Bool
$c== :: PutSecretValueResponse -> PutSecretValueResponse -> Bool
Prelude.Eq, ReadPrec [PutSecretValueResponse]
ReadPrec PutSecretValueResponse
Int -> ReadS PutSecretValueResponse
ReadS [PutSecretValueResponse]
(Int -> ReadS PutSecretValueResponse)
-> ReadS [PutSecretValueResponse]
-> ReadPrec PutSecretValueResponse
-> ReadPrec [PutSecretValueResponse]
-> Read PutSecretValueResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutSecretValueResponse]
$creadListPrec :: ReadPrec [PutSecretValueResponse]
readPrec :: ReadPrec PutSecretValueResponse
$creadPrec :: ReadPrec PutSecretValueResponse
readList :: ReadS [PutSecretValueResponse]
$creadList :: ReadS [PutSecretValueResponse]
readsPrec :: Int -> ReadS PutSecretValueResponse
$creadsPrec :: Int -> ReadS PutSecretValueResponse
Prelude.Read, Int -> PutSecretValueResponse -> ShowS
[PutSecretValueResponse] -> ShowS
PutSecretValueResponse -> String
(Int -> PutSecretValueResponse -> ShowS)
-> (PutSecretValueResponse -> String)
-> ([PutSecretValueResponse] -> ShowS)
-> Show PutSecretValueResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutSecretValueResponse] -> ShowS
$cshowList :: [PutSecretValueResponse] -> ShowS
show :: PutSecretValueResponse -> String
$cshow :: PutSecretValueResponse -> String
showsPrec :: Int -> PutSecretValueResponse -> ShowS
$cshowsPrec :: Int -> PutSecretValueResponse -> ShowS
Prelude.Show, (forall x. PutSecretValueResponse -> Rep PutSecretValueResponse x)
-> (forall x.
    Rep PutSecretValueResponse x -> PutSecretValueResponse)
-> Generic PutSecretValueResponse
forall x. Rep PutSecretValueResponse x -> PutSecretValueResponse
forall x. PutSecretValueResponse -> Rep PutSecretValueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutSecretValueResponse x -> PutSecretValueResponse
$cfrom :: forall x. PutSecretValueResponse -> Rep PutSecretValueResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutSecretValueResponse' 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:
--
-- 'versionId', 'putSecretValueResponse_versionId' - The unique identifier of the version of the secret you just created or
-- updated.
--
-- 'arn', 'putSecretValueResponse_arn' - The Amazon Resource Name (ARN) for the secret for which you just created
-- a version.
--
-- 'versionStages', 'putSecretValueResponse_versionStages' - The list of staging labels that are currently attached to this version
-- of the secret. Staging labels are used to track a version as it
-- progresses through the secret rotation process.
--
-- 'name', 'putSecretValueResponse_name' - The friendly name of the secret for which you just created or updated a
-- version.
--
-- 'httpStatus', 'putSecretValueResponse_httpStatus' - The response's http status code.
newPutSecretValueResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutSecretValueResponse
newPutSecretValueResponse :: Int -> PutSecretValueResponse
newPutSecretValueResponse Int
pHttpStatus_ =
  PutSecretValueResponse' :: Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Int
-> PutSecretValueResponse
PutSecretValueResponse'
    { $sel:versionId:PutSecretValueResponse' :: Maybe Text
versionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:PutSecretValueResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionStages:PutSecretValueResponse' :: Maybe (NonEmpty Text)
versionStages = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:PutSecretValueResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutSecretValueResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier of the version of the secret you just created or
-- updated.
putSecretValueResponse_versionId :: Lens.Lens' PutSecretValueResponse (Prelude.Maybe Prelude.Text)
putSecretValueResponse_versionId :: (Maybe Text -> f (Maybe Text))
-> PutSecretValueResponse -> f PutSecretValueResponse
putSecretValueResponse_versionId = (PutSecretValueResponse -> Maybe Text)
-> (PutSecretValueResponse -> Maybe Text -> PutSecretValueResponse)
-> Lens
     PutSecretValueResponse
     PutSecretValueResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValueResponse' {Maybe Text
versionId :: Maybe Text
$sel:versionId:PutSecretValueResponse' :: PutSecretValueResponse -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: PutSecretValueResponse
s@PutSecretValueResponse' {} Maybe Text
a -> PutSecretValueResponse
s {$sel:versionId:PutSecretValueResponse' :: Maybe Text
versionId = Maybe Text
a} :: PutSecretValueResponse)

-- | The Amazon Resource Name (ARN) for the secret for which you just created
-- a version.
putSecretValueResponse_arn :: Lens.Lens' PutSecretValueResponse (Prelude.Maybe Prelude.Text)
putSecretValueResponse_arn :: (Maybe Text -> f (Maybe Text))
-> PutSecretValueResponse -> f PutSecretValueResponse
putSecretValueResponse_arn = (PutSecretValueResponse -> Maybe Text)
-> (PutSecretValueResponse -> Maybe Text -> PutSecretValueResponse)
-> Lens
     PutSecretValueResponse
     PutSecretValueResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValueResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:PutSecretValueResponse' :: PutSecretValueResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PutSecretValueResponse
s@PutSecretValueResponse' {} Maybe Text
a -> PutSecretValueResponse
s {$sel:arn:PutSecretValueResponse' :: Maybe Text
arn = Maybe Text
a} :: PutSecretValueResponse)

-- | The list of staging labels that are currently attached to this version
-- of the secret. Staging labels are used to track a version as it
-- progresses through the secret rotation process.
putSecretValueResponse_versionStages :: Lens.Lens' PutSecretValueResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
putSecretValueResponse_versionStages :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutSecretValueResponse -> f PutSecretValueResponse
putSecretValueResponse_versionStages = (PutSecretValueResponse -> Maybe (NonEmpty Text))
-> (PutSecretValueResponse
    -> Maybe (NonEmpty Text) -> PutSecretValueResponse)
-> Lens
     PutSecretValueResponse
     PutSecretValueResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValueResponse' {Maybe (NonEmpty Text)
versionStages :: Maybe (NonEmpty Text)
$sel:versionStages:PutSecretValueResponse' :: PutSecretValueResponse -> Maybe (NonEmpty Text)
versionStages} -> Maybe (NonEmpty Text)
versionStages) (\s :: PutSecretValueResponse
s@PutSecretValueResponse' {} Maybe (NonEmpty Text)
a -> PutSecretValueResponse
s {$sel:versionStages:PutSecretValueResponse' :: Maybe (NonEmpty Text)
versionStages = Maybe (NonEmpty Text)
a} :: PutSecretValueResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> PutSecretValueResponse -> f PutSecretValueResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> PutSecretValueResponse
-> f PutSecretValueResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The friendly name of the secret for which you just created or updated a
-- version.
putSecretValueResponse_name :: Lens.Lens' PutSecretValueResponse (Prelude.Maybe Prelude.Text)
putSecretValueResponse_name :: (Maybe Text -> f (Maybe Text))
-> PutSecretValueResponse -> f PutSecretValueResponse
putSecretValueResponse_name = (PutSecretValueResponse -> Maybe Text)
-> (PutSecretValueResponse -> Maybe Text -> PutSecretValueResponse)
-> Lens
     PutSecretValueResponse
     PutSecretValueResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValueResponse' {Maybe Text
name :: Maybe Text
$sel:name:PutSecretValueResponse' :: PutSecretValueResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: PutSecretValueResponse
s@PutSecretValueResponse' {} Maybe Text
a -> PutSecretValueResponse
s {$sel:name:PutSecretValueResponse' :: Maybe Text
name = Maybe Text
a} :: PutSecretValueResponse)

-- | The response's http status code.
putSecretValueResponse_httpStatus :: Lens.Lens' PutSecretValueResponse Prelude.Int
putSecretValueResponse_httpStatus :: (Int -> f Int)
-> PutSecretValueResponse -> f PutSecretValueResponse
putSecretValueResponse_httpStatus = (PutSecretValueResponse -> Int)
-> (PutSecretValueResponse -> Int -> PutSecretValueResponse)
-> Lens PutSecretValueResponse PutSecretValueResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutSecretValueResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutSecretValueResponse' :: PutSecretValueResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutSecretValueResponse
s@PutSecretValueResponse' {} Int
a -> PutSecretValueResponse
s {$sel:httpStatus:PutSecretValueResponse' :: Int
httpStatus = Int
a} :: PutSecretValueResponse)

instance Prelude.NFData PutSecretValueResponse