{-# 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.UpdateSecretVersionStage
-- 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)
--
-- Modifies the staging labels attached to a version of a secret. Staging
-- labels are used to track a version as it progresses through the secret
-- rotation process. You can attach a staging label to only one version of
-- a secret at a time. If a staging label to be added is already attached
-- to another version, then it is moved--removed from the other version
-- first and then attached to this one. For more information about staging
-- labels, see
-- <https://docs.aws.amazon.com/secretsmanager/latest/userguide/terms-concepts.html#term_staging-label Staging Labels>
-- in the /Amazon Web Services Secrets Manager User Guide/.
--
-- The staging labels that you specify in the @VersionStage@ parameter are
-- added to the existing list of staging labels--they don\'t replace it.
--
-- You can move the @AWSCURRENT@ staging label to this version by including
-- it in this call.
--
-- Whenever you move @AWSCURRENT@, Secrets Manager automatically moves the
-- label @AWSPREVIOUS@ to the version that @AWSCURRENT@ was removed from.
--
-- If this action results in the last label being removed from a version,
-- then the version is considered to be \'deprecated\' and can be deleted
-- by Secrets Manager.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   secretsmanager:UpdateSecretVersionStage
--
-- __Related operations__
--
-- -   To get the list of staging labels that are currently associated with
--     a version of a secret, use @ DescribeSecret @ and examine the
--     @SecretVersionsToStages@ response value.
module Amazonka.SecretsManager.UpdateSecretVersionStage
  ( -- * Creating a Request
    UpdateSecretVersionStage (..),
    newUpdateSecretVersionStage,

    -- * Request Lenses
    updateSecretVersionStage_removeFromVersionId,
    updateSecretVersionStage_moveToVersionId,
    updateSecretVersionStage_secretId,
    updateSecretVersionStage_versionStage,

    -- * Destructuring the Response
    UpdateSecretVersionStageResponse (..),
    newUpdateSecretVersionStageResponse,

    -- * Response Lenses
    updateSecretVersionStageResponse_arn,
    updateSecretVersionStageResponse_name,
    updateSecretVersionStageResponse_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:/ 'newUpdateSecretVersionStage' smart constructor.
data UpdateSecretVersionStage = UpdateSecretVersionStage'
  { -- | Specifies the secret version ID of the version that the staging label is
    -- to be removed from. If the staging label you are trying to attach to one
    -- version is already attached to a different version, then you must
    -- include this parameter and specify the version that the label is to be
    -- removed from. If the label is attached and you either do not specify
    -- this parameter, or the version ID does not match, then the operation
    -- fails.
    UpdateSecretVersionStage -> Maybe Text
removeFromVersionId :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The secret version ID that you want to add the staging label.
    -- If you want to remove a label from a version, then do not specify this
    -- parameter.
    --
    -- If the staging label is already attached to a different version of the
    -- secret, then you must also specify the @RemoveFromVersionId@ parameter.
    UpdateSecretVersionStage -> Maybe Text
moveToVersionId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the secret with the version with the list of staging labels
    -- you want to modify. You can specify either the Amazon Resource Name
    -- (ARN) or the friendly name of the secret.
    --
    -- For an ARN, we recommend that you specify a complete ARN rather than a
    -- partial ARN.
    UpdateSecretVersionStage -> Text
secretId :: Prelude.Text,
    -- | The staging label to add to this version.
    UpdateSecretVersionStage -> Text
versionStage :: Prelude.Text
  }
  deriving (UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
(UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool)
-> (UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool)
-> Eq UpdateSecretVersionStage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
$c/= :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
== :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
$c== :: UpdateSecretVersionStage -> UpdateSecretVersionStage -> Bool
Prelude.Eq, ReadPrec [UpdateSecretVersionStage]
ReadPrec UpdateSecretVersionStage
Int -> ReadS UpdateSecretVersionStage
ReadS [UpdateSecretVersionStage]
(Int -> ReadS UpdateSecretVersionStage)
-> ReadS [UpdateSecretVersionStage]
-> ReadPrec UpdateSecretVersionStage
-> ReadPrec [UpdateSecretVersionStage]
-> Read UpdateSecretVersionStage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecretVersionStage]
$creadListPrec :: ReadPrec [UpdateSecretVersionStage]
readPrec :: ReadPrec UpdateSecretVersionStage
$creadPrec :: ReadPrec UpdateSecretVersionStage
readList :: ReadS [UpdateSecretVersionStage]
$creadList :: ReadS [UpdateSecretVersionStage]
readsPrec :: Int -> ReadS UpdateSecretVersionStage
$creadsPrec :: Int -> ReadS UpdateSecretVersionStage
Prelude.Read, Int -> UpdateSecretVersionStage -> ShowS
[UpdateSecretVersionStage] -> ShowS
UpdateSecretVersionStage -> String
(Int -> UpdateSecretVersionStage -> ShowS)
-> (UpdateSecretVersionStage -> String)
-> ([UpdateSecretVersionStage] -> ShowS)
-> Show UpdateSecretVersionStage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecretVersionStage] -> ShowS
$cshowList :: [UpdateSecretVersionStage] -> ShowS
show :: UpdateSecretVersionStage -> String
$cshow :: UpdateSecretVersionStage -> String
showsPrec :: Int -> UpdateSecretVersionStage -> ShowS
$cshowsPrec :: Int -> UpdateSecretVersionStage -> ShowS
Prelude.Show, (forall x.
 UpdateSecretVersionStage -> Rep UpdateSecretVersionStage x)
-> (forall x.
    Rep UpdateSecretVersionStage x -> UpdateSecretVersionStage)
-> Generic UpdateSecretVersionStage
forall x.
Rep UpdateSecretVersionStage x -> UpdateSecretVersionStage
forall x.
UpdateSecretVersionStage -> Rep UpdateSecretVersionStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecretVersionStage x -> UpdateSecretVersionStage
$cfrom :: forall x.
UpdateSecretVersionStage -> Rep UpdateSecretVersionStage x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSecretVersionStage' 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:
--
-- 'removeFromVersionId', 'updateSecretVersionStage_removeFromVersionId' - Specifies the secret version ID of the version that the staging label is
-- to be removed from. If the staging label you are trying to attach to one
-- version is already attached to a different version, then you must
-- include this parameter and specify the version that the label is to be
-- removed from. If the label is attached and you either do not specify
-- this parameter, or the version ID does not match, then the operation
-- fails.
--
-- 'moveToVersionId', 'updateSecretVersionStage_moveToVersionId' - (Optional) The secret version ID that you want to add the staging label.
-- If you want to remove a label from a version, then do not specify this
-- parameter.
--
-- If the staging label is already attached to a different version of the
-- secret, then you must also specify the @RemoveFromVersionId@ parameter.
--
-- 'secretId', 'updateSecretVersionStage_secretId' - Specifies the secret with the version with the list of staging labels
-- you want to modify. You can specify either the Amazon Resource Name
-- (ARN) or the friendly name of the secret.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
--
-- 'versionStage', 'updateSecretVersionStage_versionStage' - The staging label to add to this version.
newUpdateSecretVersionStage ::
  -- | 'secretId'
  Prelude.Text ->
  -- | 'versionStage'
  Prelude.Text ->
  UpdateSecretVersionStage
newUpdateSecretVersionStage :: Text -> Text -> UpdateSecretVersionStage
newUpdateSecretVersionStage Text
pSecretId_ Text
pVersionStage_ =
  UpdateSecretVersionStage' :: Maybe Text
-> Maybe Text -> Text -> Text -> UpdateSecretVersionStage
UpdateSecretVersionStage'
    { $sel:removeFromVersionId:UpdateSecretVersionStage' :: Maybe Text
removeFromVersionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:moveToVersionId:UpdateSecretVersionStage' :: Maybe Text
moveToVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretId:UpdateSecretVersionStage' :: Text
secretId = Text
pSecretId_,
      $sel:versionStage:UpdateSecretVersionStage' :: Text
versionStage = Text
pVersionStage_
    }

-- | Specifies the secret version ID of the version that the staging label is
-- to be removed from. If the staging label you are trying to attach to one
-- version is already attached to a different version, then you must
-- include this parameter and specify the version that the label is to be
-- removed from. If the label is attached and you either do not specify
-- this parameter, or the version ID does not match, then the operation
-- fails.
updateSecretVersionStage_removeFromVersionId :: Lens.Lens' UpdateSecretVersionStage (Prelude.Maybe Prelude.Text)
updateSecretVersionStage_removeFromVersionId :: (Maybe Text -> f (Maybe Text))
-> UpdateSecretVersionStage -> f UpdateSecretVersionStage
updateSecretVersionStage_removeFromVersionId = (UpdateSecretVersionStage -> Maybe Text)
-> (UpdateSecretVersionStage
    -> Maybe Text -> UpdateSecretVersionStage)
-> Lens
     UpdateSecretVersionStage
     UpdateSecretVersionStage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Maybe Text
removeFromVersionId :: Maybe Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
removeFromVersionId} -> Maybe Text
removeFromVersionId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Maybe Text
a -> UpdateSecretVersionStage
s {$sel:removeFromVersionId:UpdateSecretVersionStage' :: Maybe Text
removeFromVersionId = Maybe Text
a} :: UpdateSecretVersionStage)

-- | (Optional) The secret version ID that you want to add the staging label.
-- If you want to remove a label from a version, then do not specify this
-- parameter.
--
-- If the staging label is already attached to a different version of the
-- secret, then you must also specify the @RemoveFromVersionId@ parameter.
updateSecretVersionStage_moveToVersionId :: Lens.Lens' UpdateSecretVersionStage (Prelude.Maybe Prelude.Text)
updateSecretVersionStage_moveToVersionId :: (Maybe Text -> f (Maybe Text))
-> UpdateSecretVersionStage -> f UpdateSecretVersionStage
updateSecretVersionStage_moveToVersionId = (UpdateSecretVersionStage -> Maybe Text)
-> (UpdateSecretVersionStage
    -> Maybe Text -> UpdateSecretVersionStage)
-> Lens
     UpdateSecretVersionStage
     UpdateSecretVersionStage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Maybe Text
moveToVersionId :: Maybe Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
moveToVersionId} -> Maybe Text
moveToVersionId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Maybe Text
a -> UpdateSecretVersionStage
s {$sel:moveToVersionId:UpdateSecretVersionStage' :: Maybe Text
moveToVersionId = Maybe Text
a} :: UpdateSecretVersionStage)

-- | Specifies the secret with the version with the list of staging labels
-- you want to modify. You can specify either the Amazon Resource Name
-- (ARN) or the friendly name of the secret.
--
-- For an ARN, we recommend that you specify a complete ARN rather than a
-- partial ARN.
updateSecretVersionStage_secretId :: Lens.Lens' UpdateSecretVersionStage Prelude.Text
updateSecretVersionStage_secretId :: (Text -> f Text)
-> UpdateSecretVersionStage -> f UpdateSecretVersionStage
updateSecretVersionStage_secretId = (UpdateSecretVersionStage -> Text)
-> (UpdateSecretVersionStage -> Text -> UpdateSecretVersionStage)
-> Lens UpdateSecretVersionStage UpdateSecretVersionStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Text
secretId :: Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
secretId} -> Text
secretId) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Text
a -> UpdateSecretVersionStage
s {$sel:secretId:UpdateSecretVersionStage' :: Text
secretId = Text
a} :: UpdateSecretVersionStage)

-- | The staging label to add to this version.
updateSecretVersionStage_versionStage :: Lens.Lens' UpdateSecretVersionStage Prelude.Text
updateSecretVersionStage_versionStage :: (Text -> f Text)
-> UpdateSecretVersionStage -> f UpdateSecretVersionStage
updateSecretVersionStage_versionStage = (UpdateSecretVersionStage -> Text)
-> (UpdateSecretVersionStage -> Text -> UpdateSecretVersionStage)
-> Lens UpdateSecretVersionStage UpdateSecretVersionStage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStage' {Text
versionStage :: Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
versionStage} -> Text
versionStage) (\s :: UpdateSecretVersionStage
s@UpdateSecretVersionStage' {} Text
a -> UpdateSecretVersionStage
s {$sel:versionStage:UpdateSecretVersionStage' :: Text
versionStage = Text
a} :: UpdateSecretVersionStage)

instance Core.AWSRequest UpdateSecretVersionStage where
  type
    AWSResponse UpdateSecretVersionStage =
      UpdateSecretVersionStageResponse
  request :: UpdateSecretVersionStage -> Request UpdateSecretVersionStage
request = Service
-> UpdateSecretVersionStage -> Request UpdateSecretVersionStage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateSecretVersionStage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSecretVersionStage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateSecretVersionStage))
-> Logger
-> Service
-> Proxy UpdateSecretVersionStage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSecretVersionStage)))
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 -> Int -> UpdateSecretVersionStageResponse
UpdateSecretVersionStageResponse'
            (Maybe Text
 -> Maybe Text -> Int -> UpdateSecretVersionStageResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateSecretVersionStageResponse)
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
"ARN")
            Either
  String (Maybe Text -> Int -> UpdateSecretVersionStageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateSecretVersionStageResponse)
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 -> UpdateSecretVersionStageResponse)
-> Either String Int
-> Either String UpdateSecretVersionStageResponse
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 UpdateSecretVersionStage

instance Prelude.NFData UpdateSecretVersionStage

instance Core.ToHeaders UpdateSecretVersionStage where
  toHeaders :: UpdateSecretVersionStage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateSecretVersionStage -> 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.UpdateSecretVersionStage" ::
                          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 UpdateSecretVersionStage where
  toJSON :: UpdateSecretVersionStage -> Value
toJSON UpdateSecretVersionStage' {Maybe Text
Text
versionStage :: Text
secretId :: Text
moveToVersionId :: Maybe Text
removeFromVersionId :: Maybe Text
$sel:versionStage:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:secretId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Text
$sel:moveToVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
$sel:removeFromVersionId:UpdateSecretVersionStage' :: UpdateSecretVersionStage -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RemoveFromVersionId" 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
removeFromVersionId,
            (Text
"MoveToVersionId" 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
moveToVersionId,
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VersionStage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
versionStage)
          ]
      )

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

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

-- | /See:/ 'newUpdateSecretVersionStageResponse' smart constructor.
data UpdateSecretVersionStageResponse = UpdateSecretVersionStageResponse'
  { -- | The ARN of the secret with the modified staging label.
    UpdateSecretVersionStageResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the secret with the modified staging label.
    UpdateSecretVersionStageResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateSecretVersionStageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
(UpdateSecretVersionStageResponse
 -> UpdateSecretVersionStageResponse -> Bool)
-> (UpdateSecretVersionStageResponse
    -> UpdateSecretVersionStageResponse -> Bool)
-> Eq UpdateSecretVersionStageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
$c/= :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
== :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
$c== :: UpdateSecretVersionStageResponse
-> UpdateSecretVersionStageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSecretVersionStageResponse]
ReadPrec UpdateSecretVersionStageResponse
Int -> ReadS UpdateSecretVersionStageResponse
ReadS [UpdateSecretVersionStageResponse]
(Int -> ReadS UpdateSecretVersionStageResponse)
-> ReadS [UpdateSecretVersionStageResponse]
-> ReadPrec UpdateSecretVersionStageResponse
-> ReadPrec [UpdateSecretVersionStageResponse]
-> Read UpdateSecretVersionStageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecretVersionStageResponse]
$creadListPrec :: ReadPrec [UpdateSecretVersionStageResponse]
readPrec :: ReadPrec UpdateSecretVersionStageResponse
$creadPrec :: ReadPrec UpdateSecretVersionStageResponse
readList :: ReadS [UpdateSecretVersionStageResponse]
$creadList :: ReadS [UpdateSecretVersionStageResponse]
readsPrec :: Int -> ReadS UpdateSecretVersionStageResponse
$creadsPrec :: Int -> ReadS UpdateSecretVersionStageResponse
Prelude.Read, Int -> UpdateSecretVersionStageResponse -> ShowS
[UpdateSecretVersionStageResponse] -> ShowS
UpdateSecretVersionStageResponse -> String
(Int -> UpdateSecretVersionStageResponse -> ShowS)
-> (UpdateSecretVersionStageResponse -> String)
-> ([UpdateSecretVersionStageResponse] -> ShowS)
-> Show UpdateSecretVersionStageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecretVersionStageResponse] -> ShowS
$cshowList :: [UpdateSecretVersionStageResponse] -> ShowS
show :: UpdateSecretVersionStageResponse -> String
$cshow :: UpdateSecretVersionStageResponse -> String
showsPrec :: Int -> UpdateSecretVersionStageResponse -> ShowS
$cshowsPrec :: Int -> UpdateSecretVersionStageResponse -> ShowS
Prelude.Show, (forall x.
 UpdateSecretVersionStageResponse
 -> Rep UpdateSecretVersionStageResponse x)
-> (forall x.
    Rep UpdateSecretVersionStageResponse x
    -> UpdateSecretVersionStageResponse)
-> Generic UpdateSecretVersionStageResponse
forall x.
Rep UpdateSecretVersionStageResponse x
-> UpdateSecretVersionStageResponse
forall x.
UpdateSecretVersionStageResponse
-> Rep UpdateSecretVersionStageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecretVersionStageResponse x
-> UpdateSecretVersionStageResponse
$cfrom :: forall x.
UpdateSecretVersionStageResponse
-> Rep UpdateSecretVersionStageResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSecretVersionStageResponse' 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', 'updateSecretVersionStageResponse_arn' - The ARN of the secret with the modified staging label.
--
-- 'name', 'updateSecretVersionStageResponse_name' - The friendly name of the secret with the modified staging label.
--
-- 'httpStatus', 'updateSecretVersionStageResponse_httpStatus' - The response's http status code.
newUpdateSecretVersionStageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSecretVersionStageResponse
newUpdateSecretVersionStageResponse :: Int -> UpdateSecretVersionStageResponse
newUpdateSecretVersionStageResponse Int
pHttpStatus_ =
  UpdateSecretVersionStageResponse' :: Maybe Text -> Maybe Text -> Int -> UpdateSecretVersionStageResponse
UpdateSecretVersionStageResponse'
    { $sel:arn:UpdateSecretVersionStageResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateSecretVersionStageResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateSecretVersionStageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the secret with the modified staging label.
updateSecretVersionStageResponse_arn :: Lens.Lens' UpdateSecretVersionStageResponse (Prelude.Maybe Prelude.Text)
updateSecretVersionStageResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateSecretVersionStageResponse
-> f UpdateSecretVersionStageResponse
updateSecretVersionStageResponse_arn = (UpdateSecretVersionStageResponse -> Maybe Text)
-> (UpdateSecretVersionStageResponse
    -> Maybe Text -> UpdateSecretVersionStageResponse)
-> Lens
     UpdateSecretVersionStageResponse
     UpdateSecretVersionStageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStageResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateSecretVersionStageResponse
s@UpdateSecretVersionStageResponse' {} Maybe Text
a -> UpdateSecretVersionStageResponse
s {$sel:arn:UpdateSecretVersionStageResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateSecretVersionStageResponse)

-- | The friendly name of the secret with the modified staging label.
updateSecretVersionStageResponse_name :: Lens.Lens' UpdateSecretVersionStageResponse (Prelude.Maybe Prelude.Text)
updateSecretVersionStageResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateSecretVersionStageResponse
-> f UpdateSecretVersionStageResponse
updateSecretVersionStageResponse_name = (UpdateSecretVersionStageResponse -> Maybe Text)
-> (UpdateSecretVersionStageResponse
    -> Maybe Text -> UpdateSecretVersionStageResponse)
-> Lens
     UpdateSecretVersionStageResponse
     UpdateSecretVersionStageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecretVersionStageResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateSecretVersionStageResponse' :: UpdateSecretVersionStageResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateSecretVersionStageResponse
s@UpdateSecretVersionStageResponse' {} Maybe Text
a -> UpdateSecretVersionStageResponse
s {$sel:name:UpdateSecretVersionStageResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateSecretVersionStageResponse)

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

instance
  Prelude.NFData
    UpdateSecretVersionStageResponse