Secret Manager v1 API - Class SecretManagerServiceClientImpl (2.5.0)

public sealed class SecretManagerServiceClientImpl : SecretManagerServiceClient

Reference documentation and code samples for the Secret Manager v1 API class SecretManagerServiceClientImpl.

SecretManagerService client wrapper implementation, for convenient use.

Inheritance

object > SecretManagerServiceClient > SecretManagerServiceClientImpl

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]

Constructors

SecretManagerServiceClientImpl(SecretManagerServiceClient, SecretManagerServiceSettings, ILogger)

public SecretManagerServiceClientImpl(SecretManagerService.SecretManagerServiceClient grpcClient, SecretManagerServiceSettings settings, ILogger logger)

Constructs a client wrapper for the SecretManagerService service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient SecretManagerServiceSecretManagerServiceClient

The underlying gRPC client.

settings SecretManagerServiceSettings

The base SecretManagerServiceSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override SecretManagerService.SecretManagerServiceClient GrpcClient { get; }

The underlying gRPC SecretManagerService client

Property Value
Type Description
SecretManagerServiceSecretManagerServiceClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient
Overrides

Methods

AccessSecretVersion(AccessSecretVersionRequest, CallSettings)

public override 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 most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
Name Description
request AccessSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AccessSecretVersionResponse

The RPC response.

Overrides

AccessSecretVersionAsync(AccessSecretVersionRequest, CallSettings)

public override 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 most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
Name Description
request AccessSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAccessSecretVersionResponse

A Task containing the RPC response.

Overrides

AddSecretVersion(AddSecretVersionRequest, CallSettings)

public override 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
Name Description
request AddSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecretVersion

The RPC response.

Overrides

AddSecretVersionAsync(AddSecretVersionRequest, CallSettings)

public override 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
Name Description
request AddSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecretVersion

A Task containing the RPC response.

Overrides

CreateSecret(CreateSecretRequest, CallSettings)

public override 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
Name Description
request CreateSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Secret

The RPC response.

Overrides

CreateSecretAsync(CreateSecretRequest, CallSettings)

public override 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
Name Description
request CreateSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecret

A Task containing the RPC response.

Overrides

DeleteSecret(DeleteSecretRequest, CallSettings)

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

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

Parameters
Name Description
request DeleteSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteSecretAsync(DeleteSecretRequest, CallSettings)

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

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

Parameters
Name Description
request DeleteSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

DestroySecretVersion(DestroySecretVersionRequest, CallSettings)

public override 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
Name Description
request DestroySecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecretVersion

The RPC response.

Overrides

DestroySecretVersionAsync(DestroySecretVersionRequest, CallSettings)

public override 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
Name Description
request DestroySecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecretVersion

A Task containing the RPC response.

Overrides

DisableSecretVersion(DisableSecretVersionRequest, CallSettings)

public override 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
Name Description
request DisableSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecretVersion

The RPC response.

Overrides

DisableSecretVersionAsync(DisableSecretVersionRequest, CallSettings)

public override 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
Name Description
request DisableSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecretVersion

A Task containing the RPC response.

Overrides

EnableSecretVersion(EnableSecretVersionRequest, CallSettings)

public override 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
Name Description
request EnableSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecretVersion

The RPC response.

Overrides

EnableSecretVersionAsync(EnableSecretVersionRequest, CallSettings)

public override 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
Name Description
request EnableSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecretVersion

A Task containing the RPC response.

Overrides

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public override 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
Name Description
request GetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Overrides

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public override 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
Name Description
request GetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Overrides

GetSecret(GetSecretRequest, CallSettings)

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

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

Parameters
Name Description
request GetSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Secret

The RPC response.

Overrides

GetSecretAsync(GetSecretRequest, CallSettings)

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

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

Parameters
Name Description
request GetSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecret

A Task containing the RPC response.

Overrides

GetSecretVersion(GetSecretVersionRequest, CallSettings)

public override 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 most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
Name Description
request GetSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SecretVersion

The RPC response.

Overrides

GetSecretVersionAsync(GetSecretVersionRequest, CallSettings)

public override 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 most recently created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].

Parameters
Name Description
request GetSecretVersionRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecretVersion

A Task containing the RPC response.

Overrides

ListSecretVersions(ListSecretVersionsRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecretVersionsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSecretVersionsResponseSecretVersion

A pageable sequence of SecretVersion resources.

Overrides

ListSecretVersionsAsync(ListSecretVersionsRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecretVersionsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSecretVersionsResponseSecretVersion

A pageable asynchronous sequence of SecretVersion resources.

Overrides

ListSecrets(ListSecretsRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecretsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSecretsResponseSecret

A pageable sequence of Secret resources.

Overrides

ListSecretsAsync(ListSecretsRequest, CallSettings)

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

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

Parameters
Name Description
request ListSecretsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSecretsResponseSecret

A pageable asynchronous sequence of Secret resources.

Overrides

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public override 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
Name Description
request SetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Overrides

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public override 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
Name Description
request SetIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Overrides

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public override 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
Name Description
request TestIamPermissionsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TestIamPermissionsResponse

The RPC response.

Overrides

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public override 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
Name Description
request TestIamPermissionsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Overrides

UpdateSecret(UpdateSecretRequest, CallSettings)

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

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

Parameters
Name Description
request UpdateSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Secret

The RPC response.

Overrides

UpdateSecretAsync(UpdateSecretRequest, CallSettings)

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

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

Parameters
Name Description
request UpdateSecretRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSecret

A Task containing the RPC response.

Overrides