Class SecretManagerServiceClient (1.4.0)

public abstract class SecretManagerServiceClient

SecretManagerService client wrapper, for convenient use.

Inheritance

Object > SecretManagerServiceClient

Namespace

Google.Cloud.SecretManager.V1

Assembly

Google.Cloud.SecretManager.V1.dll

Remarks

Secret Manager Service

Manages secrets and operations using those secrets. Implements a REST model with the following objects:

  • [Secret][google.cloud.secretmanager.v1.Secret]
  • [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the SecretManagerService service, which is a host of "secretmanager.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default SecretManagerService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default SecretManagerService scopes are:

GrpcClient

public virtual SecretManagerService.SecretManagerServiceClient GrpcClient { get; }

The underlying gRPC SecretManagerService client

Property Value
TypeDescription
SecretManagerService.SecretManagerServiceClient

Methods

AccessSecretVersion(AccessSecretVersionRequest, CallSettings)

public virtual AccessSecretVersionResponse AccessSecretVersion(AccessSecretVersionRequest request, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestAccessSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessSecretVersionResponse

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
AccessSecretVersionRequest request = new AccessSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
AccessSecretVersionResponse response = secretManagerServiceClient.AccessSecretVersion(request);

AccessSecretVersion(SecretVersionName, CallSettings)

public virtual AccessSecretVersionResponse AccessSecretVersion(SecretVersionName name, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessSecretVersionResponse

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
AccessSecretVersionResponse response = secretManagerServiceClient.AccessSecretVersion(name);

AccessSecretVersion(String, CallSettings)

public virtual AccessSecretVersionResponse AccessSecretVersion(string name, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AccessSecretVersionResponse

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
AccessSecretVersionResponse response = secretManagerServiceClient.AccessSecretVersion(name);

AccessSecretVersionAsync(AccessSecretVersionRequest, CallSettings)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(AccessSecretVersionRequest request, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestAccessSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
AccessSecretVersionRequest request = new AccessSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(request);

AccessSecretVersionAsync(AccessSecretVersionRequest, CancellationToken)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(AccessSecretVersionRequest request, CancellationToken cancellationToken)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestAccessSecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
AccessSecretVersionRequest request = new AccessSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(request);

AccessSecretVersionAsync(SecretVersionName, CallSettings)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(SecretVersionName name, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(name);

AccessSecretVersionAsync(SecretVersionName, CancellationToken)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(SecretVersionName name, CancellationToken cancellationToken)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(name);

AccessSecretVersionAsync(String, CallSettings)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(string name, CallSettings callSettings = null)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(name);

AccessSecretVersionAsync(String, CancellationToken)

public virtual Task<AccessSecretVersionResponse> AccessSecretVersionAsync(string name, CancellationToken cancellationToken)

Accesses a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AccessSecretVersionResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
AccessSecretVersionResponse response = await secretManagerServiceClient.AccessSecretVersionAsync(name);

AddSecretVersion(AddSecretVersionRequest, CallSettings)

public virtual SecretVersion AddSecretVersion(AddSecretVersionRequest request, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestAddSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
AddSecretVersionRequest request = new AddSecretVersionRequest
{
    ParentAsSecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
    Payload = new SecretPayload(),
};
// Make the request
SecretVersion response = secretManagerServiceClient.AddSecretVersion(request);

AddSecretVersion(SecretName, SecretPayload, CallSettings)

public virtual SecretVersion AddSecretVersion(SecretName parent, SecretPayload payload, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretName parent = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = secretManagerServiceClient.AddSecretVersion(parent, payload);

AddSecretVersion(String, SecretPayload, CallSettings)

public virtual SecretVersion AddSecretVersion(string parent, SecretPayload payload, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/secrets/[SECRET]";
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = secretManagerServiceClient.AddSecretVersion(parent, payload);

AddSecretVersionAsync(AddSecretVersionRequest, CallSettings)

public virtual Task<SecretVersion> AddSecretVersionAsync(AddSecretVersionRequest request, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestAddSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
AddSecretVersionRequest request = new AddSecretVersionRequest
{
    ParentAsSecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
    Payload = new SecretPayload(),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(request);

AddSecretVersionAsync(AddSecretVersionRequest, CancellationToken)

public virtual Task<SecretVersion> AddSecretVersionAsync(AddSecretVersionRequest request, CancellationToken cancellationToken)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestAddSecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
AddSecretVersionRequest request = new AddSecretVersionRequest
{
    ParentAsSecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
    Payload = new SecretPayload(),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(request);

AddSecretVersionAsync(SecretName, SecretPayload, CallSettings)

public virtual Task<SecretVersion> AddSecretVersionAsync(SecretName parent, SecretPayload payload, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName parent = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(parent, payload);

AddSecretVersionAsync(SecretName, SecretPayload, CancellationToken)

public virtual Task<SecretVersion> AddSecretVersionAsync(SecretName parent, SecretPayload payload, CancellationToken cancellationToken)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName parent = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(parent, payload);

AddSecretVersionAsync(String, SecretPayload, CallSettings)

public virtual Task<SecretVersion> AddSecretVersionAsync(string parent, SecretPayload payload, CallSettings callSettings = null)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/secrets/[SECRET]";
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(parent, payload);

AddSecretVersionAsync(String, SecretPayload, CancellationToken)

public virtual Task<SecretVersion> AddSecretVersionAsync(string parent, SecretPayload payload, CancellationToken cancellationToken)

Creates a new [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to associate with the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*.

payloadSecretPayload

Required. The secret payload of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/secrets/[SECRET]";
SecretPayload payload = new SecretPayload();
// Make the request
SecretVersion response = await secretManagerServiceClient.AddSecretVersionAsync(parent, payload);

Create()

public static SecretManagerServiceClient Create()

Synchronously creates a SecretManagerServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SecretManagerServiceClientBuilder.

Returns
TypeDescription
SecretManagerServiceClient

The created SecretManagerServiceClient.

CreateAsync(CancellationToken)

public static Task<SecretManagerServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a SecretManagerServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SecretManagerServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<SecretManagerServiceClient>

The task representing the created SecretManagerServiceClient.

CreateSecret(ProjectName, String, Secret, CallSettings)

public virtual Secret CreateSecret(ProjectName parent, string secretId, Secret secret, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentProjectName

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = secretManagerServiceClient.CreateSecret(parent, secretId, secret);

CreateSecret(CreateSecretRequest, CallSettings)

public virtual Secret CreateSecret(CreateSecretRequest request, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestCreateSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
CreateSecretRequest request = new CreateSecretRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SecretId = "",
    Secret = new Secret(),
};
// Make the request
Secret response = secretManagerServiceClient.CreateSecret(request);

CreateSecret(String, String, Secret, CallSettings)

public virtual Secret CreateSecret(string parent, string secretId, Secret secret, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentString

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = secretManagerServiceClient.CreateSecret(parent, secretId, secret);

CreateSecretAsync(ProjectName, String, Secret, CallSettings)

public virtual Task<Secret> CreateSecretAsync(ProjectName parent, string secretId, Secret secret, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentProjectName

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(parent, secretId, secret);

CreateSecretAsync(ProjectName, String, Secret, CancellationToken)

public virtual Task<Secret> CreateSecretAsync(ProjectName parent, string secretId, Secret secret, CancellationToken cancellationToken)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentProjectName

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(parent, secretId, secret);

CreateSecretAsync(CreateSecretRequest, CallSettings)

public virtual Task<Secret> CreateSecretAsync(CreateSecretRequest request, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestCreateSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSecretRequest request = new CreateSecretRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SecretId = "",
    Secret = new Secret(),
};
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(request);

CreateSecretAsync(CreateSecretRequest, CancellationToken)

public virtual Task<Secret> CreateSecretAsync(CreateSecretRequest request, CancellationToken cancellationToken)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestCreateSecretRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSecretRequest request = new CreateSecretRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    SecretId = "",
    Secret = new Secret(),
};
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(request);

CreateSecretAsync(String, String, Secret, CallSettings)

public virtual Task<Secret> CreateSecretAsync(string parent, string secretId, Secret secret, CallSettings callSettings = null)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentString

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(parent, secretId, secret);

CreateSecretAsync(String, String, Secret, CancellationToken)

public virtual Task<Secret> CreateSecretAsync(string parent, string secretId, Secret secret, CancellationToken cancellationToken)

Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
parentString

Required. The resource name of the project to associate with the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*.

secretIdString

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore (_) characters.

secretSecret

Required. A [Secret][google.cloud.secretmanager.v1.Secret] with initial field values.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
string secretId = "";
Secret secret = new Secret();
// Make the request
Secret response = await secretManagerServiceClient.CreateSecretAsync(parent, secretId, secret);

DeleteSecret(DeleteSecretRequest, CallSettings)

public virtual void DeleteSecret(DeleteSecretRequest request, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestDeleteSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
DeleteSecretRequest request = new DeleteSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
secretManagerServiceClient.DeleteSecret(request);

DeleteSecret(SecretName, CallSettings)

public virtual void DeleteSecret(SecretName name, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
secretManagerServiceClient.DeleteSecret(name);

DeleteSecret(String, CallSettings)

public virtual void DeleteSecret(string name, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
secretManagerServiceClient.DeleteSecret(name);

DeleteSecretAsync(DeleteSecretRequest, CallSettings)

public virtual Task DeleteSecretAsync(DeleteSecretRequest request, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestDeleteSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSecretRequest request = new DeleteSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(request);

DeleteSecretAsync(DeleteSecretRequest, CancellationToken)

public virtual Task DeleteSecretAsync(DeleteSecretRequest request, CancellationToken cancellationToken)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestDeleteSecretRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSecretRequest request = new DeleteSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(request);

DeleteSecretAsync(SecretName, CallSettings)

public virtual Task DeleteSecretAsync(SecretName name, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(name);

DeleteSecretAsync(SecretName, CancellationToken)

public virtual Task DeleteSecretAsync(SecretName name, CancellationToken cancellationToken)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(name);

DeleteSecretAsync(String, CallSettings)

public virtual Task DeleteSecretAsync(string name, CallSettings callSettings = null)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(name);

DeleteSecretAsync(String, CancellationToken)

public virtual Task DeleteSecretAsync(string name, CancellationToken cancellationToken)

Deletes a [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] to delete in the format projects/*/secrets/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
await secretManagerServiceClient.DeleteSecretAsync(name);

DestroySecretVersion(DestroySecretVersionRequest, CallSettings)

public virtual SecretVersion DestroySecretVersion(DestroySecretVersionRequest request, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
requestDestroySecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
DestroySecretVersionRequest request = new DestroySecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = secretManagerServiceClient.DestroySecretVersion(request);

DestroySecretVersion(SecretVersionName, CallSettings)

public virtual SecretVersion DestroySecretVersion(SecretVersionName name, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = secretManagerServiceClient.DestroySecretVersion(name);

DestroySecretVersion(String, CallSettings)

public virtual SecretVersion DestroySecretVersion(string name, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = secretManagerServiceClient.DestroySecretVersion(name);

DestroySecretVersionAsync(DestroySecretVersionRequest, CallSettings)

public virtual Task<SecretVersion> DestroySecretVersionAsync(DestroySecretVersionRequest request, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
requestDestroySecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DestroySecretVersionRequest request = new DestroySecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(request);

DestroySecretVersionAsync(DestroySecretVersionRequest, CancellationToken)

public virtual Task<SecretVersion> DestroySecretVersionAsync(DestroySecretVersionRequest request, CancellationToken cancellationToken)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
requestDestroySecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DestroySecretVersionRequest request = new DestroySecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(request);

DestroySecretVersionAsync(SecretVersionName, CallSettings)

public virtual Task<SecretVersion> DestroySecretVersionAsync(SecretVersionName name, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(name);

DestroySecretVersionAsync(SecretVersionName, CancellationToken)

public virtual Task<SecretVersion> DestroySecretVersionAsync(SecretVersionName name, CancellationToken cancellationToken)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(name);

DestroySecretVersionAsync(String, CallSettings)

public virtual Task<SecretVersion> DestroySecretVersionAsync(string name, CallSettings callSettings = null)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(name);

DestroySecretVersionAsync(String, CancellationToken)

public virtual Task<SecretVersion> DestroySecretVersionAsync(string name, CancellationToken cancellationToken)

Destroys a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1.SecretVersion.State.DESTROYED] and irrevocably destroys the secret data.

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.DestroySecretVersionAsync(name);

DisableSecretVersion(DisableSecretVersionRequest, CallSettings)

public virtual SecretVersion DisableSecretVersion(DisableSecretVersionRequest request, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
requestDisableSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
DisableSecretVersionRequest request = new DisableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = secretManagerServiceClient.DisableSecretVersion(request);

DisableSecretVersion(SecretVersionName, CallSettings)

public virtual SecretVersion DisableSecretVersion(SecretVersionName name, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = secretManagerServiceClient.DisableSecretVersion(name);

DisableSecretVersion(String, CallSettings)

public virtual SecretVersion DisableSecretVersion(string name, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = secretManagerServiceClient.DisableSecretVersion(name);

DisableSecretVersionAsync(DisableSecretVersionRequest, CallSettings)

public virtual Task<SecretVersion> DisableSecretVersionAsync(DisableSecretVersionRequest request, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
requestDisableSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DisableSecretVersionRequest request = new DisableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(request);

DisableSecretVersionAsync(DisableSecretVersionRequest, CancellationToken)

public virtual Task<SecretVersion> DisableSecretVersionAsync(DisableSecretVersionRequest request, CancellationToken cancellationToken)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
requestDisableSecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
DisableSecretVersionRequest request = new DisableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(request);

DisableSecretVersionAsync(SecretVersionName, CallSettings)

public virtual Task<SecretVersion> DisableSecretVersionAsync(SecretVersionName name, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(name);

DisableSecretVersionAsync(SecretVersionName, CancellationToken)

public virtual Task<SecretVersion> DisableSecretVersionAsync(SecretVersionName name, CancellationToken cancellationToken)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(name);

DisableSecretVersionAsync(String, CallSettings)

public virtual Task<SecretVersion> DisableSecretVersionAsync(string name, CallSettings callSettings = null)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(name);

DisableSecretVersionAsync(String, CancellationToken)

public virtual Task<SecretVersion> DisableSecretVersionAsync(string name, CancellationToken cancellationToken)

Disables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1.SecretVersion.State.DISABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.DisableSecretVersionAsync(name);

EnableSecretVersion(EnableSecretVersionRequest, CallSettings)

public virtual SecretVersion EnableSecretVersion(EnableSecretVersionRequest request, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
requestEnableSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
EnableSecretVersionRequest request = new EnableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = secretManagerServiceClient.EnableSecretVersion(request);

EnableSecretVersion(SecretVersionName, CallSettings)

public virtual SecretVersion EnableSecretVersion(SecretVersionName name, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = secretManagerServiceClient.EnableSecretVersion(name);

EnableSecretVersion(String, CallSettings)

public virtual SecretVersion EnableSecretVersion(string name, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = secretManagerServiceClient.EnableSecretVersion(name);

EnableSecretVersionAsync(EnableSecretVersionRequest, CallSettings)

public virtual Task<SecretVersion> EnableSecretVersionAsync(EnableSecretVersionRequest request, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
requestEnableSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
EnableSecretVersionRequest request = new EnableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(request);

EnableSecretVersionAsync(EnableSecretVersionRequest, CancellationToken)

public virtual Task<SecretVersion> EnableSecretVersionAsync(EnableSecretVersionRequest request, CancellationToken cancellationToken)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
requestEnableSecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
EnableSecretVersionRequest request = new EnableSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(request);

EnableSecretVersionAsync(SecretVersionName, CallSettings)

public virtual Task<SecretVersion> EnableSecretVersionAsync(SecretVersionName name, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(name);

EnableSecretVersionAsync(SecretVersionName, CancellationToken)

public virtual Task<SecretVersion> EnableSecretVersionAsync(SecretVersionName name, CancellationToken cancellationToken)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(name);

EnableSecretVersionAsync(String, CallSettings)

public virtual Task<SecretVersion> EnableSecretVersionAsync(string name, CallSettings callSettings = null)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(name);

EnableSecretVersionAsync(String, CancellationToken)

public virtual Task<SecretVersion> EnableSecretVersionAsync(string name, CancellationToken cancellationToken)

Enables a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1.SecretVersion.State.ENABLED].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in the format projects/*/secrets/*/versions/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.EnableSecretVersionAsync(name);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = secretManagerServiceClient.GetIamPolicy(request);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await secretManagerServiceClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await secretManagerServiceClient.GetIamPolicyAsync(request);

GetSecret(GetSecretRequest, CallSettings)

public virtual Secret GetSecret(GetSecretRequest request, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGetSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
GetSecretRequest request = new GetSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
Secret response = secretManagerServiceClient.GetSecret(request);

GetSecret(SecretName, CallSettings)

public virtual Secret GetSecret(SecretName name, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
Secret response = secretManagerServiceClient.GetSecret(name);

GetSecret(String, CallSettings)

public virtual Secret GetSecret(string name, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
Secret response = secretManagerServiceClient.GetSecret(name);

GetSecretAsync(GetSecretRequest, CallSettings)

public virtual Task<Secret> GetSecretAsync(GetSecretRequest request, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGetSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetSecretRequest request = new GetSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(request);

GetSecretAsync(GetSecretRequest, CancellationToken)

public virtual Task<Secret> GetSecretAsync(GetSecretRequest request, CancellationToken cancellationToken)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGetSecretRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetSecretRequest request = new GetSecretRequest
{
    SecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(request);

GetSecretAsync(SecretName, CallSettings)

public virtual Task<Secret> GetSecretAsync(SecretName name, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(name);

GetSecretAsync(SecretName, CancellationToken)

public virtual Task<Secret> GetSecretAsync(SecretName name, CancellationToken cancellationToken)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName name = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(name);

GetSecretAsync(String, CallSettings)

public virtual Task<Secret> GetSecretAsync(string name, CallSettings callSettings = null)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(name);

GetSecretAsync(String, CancellationToken)

public virtual Task<Secret> GetSecretAsync(string name, CancellationToken cancellationToken)

Gets metadata for a given [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
nameString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret], in the format projects/*/secrets/*.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
Secret response = await secretManagerServiceClient.GetSecretAsync(name);

GetSecretVersion(GetSecretVersionRequest, CallSettings)

public virtual SecretVersion GetSecretVersion(GetSecretVersionRequest request, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestGetSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
GetSecretVersionRequest request = new GetSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = secretManagerServiceClient.GetSecretVersion(request);

GetSecretVersion(SecretVersionName, CallSettings)

public virtual SecretVersion GetSecretVersion(SecretVersionName name, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = secretManagerServiceClient.GetSecretVersion(name);

GetSecretVersion(String, CallSettings)

public virtual SecretVersion GetSecretVersion(string name, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SecretVersion

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = secretManagerServiceClient.GetSecretVersion(name);

GetSecretVersionAsync(GetSecretVersionRequest, CallSettings)

public virtual Task<SecretVersion> GetSecretVersionAsync(GetSecretVersionRequest request, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestGetSecretVersionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetSecretVersionRequest request = new GetSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(request);

GetSecretVersionAsync(GetSecretVersionRequest, CancellationToken)

public virtual Task<SecretVersion> GetSecretVersionAsync(GetSecretVersionRequest request, CancellationToken cancellationToken)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
requestGetSecretVersionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
GetSecretVersionRequest request = new GetSecretVersionRequest
{
    SecretVersionName = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]"),
};
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(request);

GetSecretVersionAsync(SecretVersionName, CallSettings)

public virtual Task<SecretVersion> GetSecretVersionAsync(SecretVersionName name, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(name);

GetSecretVersionAsync(SecretVersionName, CancellationToken)

public virtual Task<SecretVersion> GetSecretVersionAsync(SecretVersionName name, CancellationToken cancellationToken)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameSecretVersionName

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretVersionName name = SecretVersionName.FromProjectSecretSecretVersion("[PROJECT]", "[SECRET]", "[SECRET_VERSION]");
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(name);

GetSecretVersionAsync(String, CallSettings)

public virtual Task<SecretVersion> GetSecretVersionAsync(string name, CallSettings callSettings = null)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(name);

GetSecretVersionAsync(String, CancellationToken)

public virtual Task<SecretVersion> GetSecretVersionAsync(string name, CancellationToken cancellationToken)

Gets metadata for a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
NameDescription
nameString

Required. The resource name of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the latest [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<SecretVersion>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/secrets/[SECRET]/versions/[SECRET_VERSION]";
// Make the request
SecretVersion response = await secretManagerServiceClient.GetSecretVersionAsync(name);

ListSecrets(ProjectName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListSecretsResponse, Secret> ListSecrets(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentProjectName

Required. The resource name of the project associated with the [Secrets][google.cloud.secretmanager.v1.Secret], in the format projects/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretsResponse, Secret>

A pageable sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecrets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Secret item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecrets(ListSecretsRequest, CallSettings)

public virtual PagedEnumerable<ListSecretsResponse, Secret> ListSecrets(ListSecretsRequest request, CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestListSecretsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretsResponse, Secret>

A pageable sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
ListSecretsRequest request = new ListSecretsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecrets(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Secret item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecrets(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListSecretsResponse, Secret> ListSecrets(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentString

Required. The resource name of the project associated with the [Secrets][google.cloud.secretmanager.v1.Secret], in the format projects/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretsResponse, Secret>

A pageable sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecrets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Secret item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretsAsync(ProjectName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretsResponse, Secret> ListSecretsAsync(ProjectName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentProjectName

Required. The resource name of the project associated with the [Secrets][google.cloud.secretmanager.v1.Secret], in the format projects/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretsResponse, Secret>

A pageable asynchronous sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecretsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Secret item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretsAsync(ListSecretsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretsResponse, Secret> ListSecretsAsync(ListSecretsRequest request, CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestListSecretsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretsResponse, Secret>

A pageable asynchronous sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
ListSecretsRequest request = new ListSecretsRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecretsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Secret item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretsResponse, Secret> ListSecretsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [Secrets][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
parentString

Required. The resource name of the project associated with the [Secrets][google.cloud.secretmanager.v1.Secret], in the format projects/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretsResponse, Secret>

A pageable asynchronous sequence of Secret resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListSecretsResponse, Secret> response = secretManagerServiceClient.ListSecretsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Secret item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Secret item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Secret> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Secret item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersions(ListSecretVersionsRequest, CallSettings)

public virtual PagedEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersions(ListSecretVersionsRequest request, CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
requestListSecretVersionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
ListSecretVersionsRequest request = new ListSecretVersionsRequest
{
    ParentAsSecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
PagedEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersions(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (SecretVersion item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretVersionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersions(SecretName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersions(SecretName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
parentSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] associated with the [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] to list, in the format projects/*/secrets/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SecretName parent = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
PagedEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SecretVersion item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretVersionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersions(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersions(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
parentString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] associated with the [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] to list, in the format projects/*/secrets/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
PagedEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (SecretVersion item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSecretVersionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersionsAsync(ListSecretVersionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersionsAsync(ListSecretVersionsRequest request, CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
requestListSecretVersionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable asynchronous sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
ListSecretVersionsRequest request = new ListSecretVersionsRequest
{
    ParentAsSecretName = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]"),
};
// Make the request
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SecretVersion item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersionsAsync(SecretName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersionsAsync(SecretName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
parentSecretName

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] associated with the [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] to list, in the format projects/*/secrets/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable asynchronous sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SecretName parent = SecretName.FromProjectSecret("[PROJECT]", "[SECRET]");
// Make the request
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SecretVersion item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSecretVersionsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> ListSecretVersionsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. This call does not return secret data.

Parameters
NameDescription
parentString

Required. The resource name of the [Secret][google.cloud.secretmanager.v1.Secret] associated with the [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] to list, in the format projects/*/secrets/*.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion>

A pageable asynchronous sequence of SecretVersion resources.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/secrets/[SECRET]";
// Make the request
PagedAsyncEnumerable<ListSecretVersionsResponse, SecretVersion> response = secretManagerServiceClient.ListSecretVersionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((SecretVersion item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSecretVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (SecretVersion item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<SecretVersion> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (SecretVersion item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified secret. Replaces any existing policy.

Permissions on [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = secretManagerServiceClient.SetIamPolicy(request);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified secret. Replaces any existing policy.

Permissions on [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await secretManagerServiceClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the access control policy on the specified secret. Replaces any existing policy.

Permissions on [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await secretManagerServiceClient.SetIamPolicyAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.TestIamPermissionsResponse

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = secretManagerServiceClient.TestIamPermissions(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await secretManagerServiceClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has for the specified secret. If the secret does not exist, this call returns an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await secretManagerServiceClient.TestIamPermissionsAsync(request);

UpdateSecret(Secret, FieldMask, CallSettings)

public virtual Secret UpdateSecret(Secret secret, FieldMask updateMask, CallSettings callSettings = null)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
secretSecret

Required. [Secret][google.cloud.secretmanager.v1.Secret] with updated field values.

updateMaskFieldMask

Required. Specifies the fields to be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
Secret secret = new Secret();
FieldMask updateMask = new FieldMask();
// Make the request
Secret response = secretManagerServiceClient.UpdateSecret(secret, updateMask);

UpdateSecret(UpdateSecretRequest, CallSettings)

public virtual Secret UpdateSecret(UpdateSecretRequest request, CallSettings callSettings = null)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestUpdateSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Secret

The RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = SecretManagerServiceClient.Create();
// Initialize request argument(s)
UpdateSecretRequest request = new UpdateSecretRequest
{
    Secret = new Secret(),
    UpdateMask = new FieldMask(),
};
// Make the request
Secret response = secretManagerServiceClient.UpdateSecret(request);

UpdateSecretAsync(Secret, FieldMask, CallSettings)

public virtual Task<Secret> UpdateSecretAsync(Secret secret, FieldMask updateMask, CallSettings callSettings = null)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
secretSecret

Required. [Secret][google.cloud.secretmanager.v1.Secret] with updated field values.

updateMaskFieldMask

Required. Specifies the fields to be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
Secret secret = new Secret();
FieldMask updateMask = new FieldMask();
// Make the request
Secret response = await secretManagerServiceClient.UpdateSecretAsync(secret, updateMask);

UpdateSecretAsync(Secret, FieldMask, CancellationToken)

public virtual Task<Secret> UpdateSecretAsync(Secret secret, FieldMask updateMask, CancellationToken cancellationToken)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
secretSecret

Required. [Secret][google.cloud.secretmanager.v1.Secret] with updated field values.

updateMaskFieldMask

Required. Specifies the fields to be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
Secret secret = new Secret();
FieldMask updateMask = new FieldMask();
// Make the request
Secret response = await secretManagerServiceClient.UpdateSecretAsync(secret, updateMask);

UpdateSecretAsync(UpdateSecretRequest, CallSettings)

public virtual Task<Secret> UpdateSecretAsync(UpdateSecretRequest request, CallSettings callSettings = null)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestUpdateSecretRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSecretRequest request = new UpdateSecretRequest
{
    Secret = new Secret(),
    UpdateMask = new FieldMask(),
};
// Make the request
Secret response = await secretManagerServiceClient.UpdateSecretAsync(request);

UpdateSecretAsync(UpdateSecretRequest, CancellationToken)

public virtual Task<Secret> UpdateSecretAsync(UpdateSecretRequest request, CancellationToken cancellationToken)

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1.Secret].

Parameters
NameDescription
requestUpdateSecretRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Secret>

A Task containing the RPC response.

Example
// Create client
SecretManagerServiceClient secretManagerServiceClient = await SecretManagerServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSecretRequest request = new UpdateSecretRequest
{
    Secret = new Secret(),
    UpdateMask = new FieldMask(),
};
// Make the request
Secret response = await secretManagerServiceClient.UpdateSecretAsync(request);