AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This is the response object from the GetSecretValue operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.SecretsManager.Model.GetSecretValueResponse

Namespace: Amazon.SecretsManager.Model
Assembly: AWSSDK.SecretsManager.dll
Version: 3.x.y.z

Syntax

C#
public class GetSecretValueResponse : AmazonWebServiceResponse

The GetSecretValueResponse type exposes the following members

Constructors

NameDescription
Public Method GetSecretValueResponse()

Properties

NameTypeDescription
Public Property ARN System.String

Gets and sets the property ARN.

The ARN of the secret.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property CreatedDate System.DateTime

Gets and sets the property CreatedDate.

The date and time that this version of the secret was created. If you don't specify which version in VersionId or VersionStage, then Secrets Manager uses the AWSCURRENT version.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Name System.String

Gets and sets the property Name.

The friendly name of the secret.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property SecretBinary System.IO.MemoryStream

Gets and sets the property SecretBinary.

The decrypted secret value, if the secret value was originally provided as binary data in the form of a byte array. When you retrieve a SecretBinary using the HTTP API, the Python SDK, or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not encoded.

If the secret was created by using the Secrets Manager console, or if the secret value was originally provided as a string, then this field is omitted. The secret value appears in SecretString instead.

Public Property SecretString System.String

Gets and sets the property SecretString.

The decrypted secret value, if the secret value was originally provided as a string or through the Secrets Manager console.

If this secret was created by using the console, then Secrets Manager stores the information as a JSON structure of key/value pairs.

Public Property VersionId System.String

Gets and sets the property VersionId.

The unique identifier of this version of the secret.

Public Property VersionStages System.Collections.Generic.List<System.String>

Gets and sets the property VersionStages.

A list of all of the staging labels currently attached to this version of the secret.

Examples

The following example shows how to retrieve a secret string value.

To retrieve the encrypted secret value of a secret


var client = new AmazonSecretsManagerClient();
var response = client.GetSecretValue(new GetSecretValueRequest 
{
    SecretId = "MyTestDatabaseSecret"
});

string arn = response.ARN;
DateTime createdDate = response.CreatedDate;
string name = response.Name;
string secretString = response.SecretString;
string versionId = response.VersionId;
List<string> versionStages = response.VersionStages;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5