Secret Manager v1beta2 API - Class SecretManagerServiceClientImpl (1.0.0-beta01)

public sealed class SecretManagerServiceClientImpl : SecretManagerServiceClient

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

SecretManagerService client wrapper implementation, for convenient use.

Inheritance

object > SecretManagerServiceClient > SecretManagerServiceClientImpl

Namespace

Google.Cloud.SecretManager.V1Beta2

Assembly

Google.Cloud.SecretManager.V1Beta2.dll

Remarks

Secret Manager Service

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

  • [Secret][google.cloud.secretmanager.v1beta2.Secret]
  • [SecretVersion][google.cloud.secretmanager.v1beta2.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
NameDescription
grpcClientSecretManagerServiceSecretManagerServiceClient

The underlying gRPC client.

settingsSecretManagerServiceSettings

The base SecretManagerServiceSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override SecretManagerService.SecretManagerServiceClient GrpcClient { get; }

The underlying gRPC SecretManagerService client

Property Value
TypeDescription
SecretManagerServiceSecretManagerServiceClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient
Overrides

Methods

AccessSecretVersion(AccessSecretVersionRequest, CallSettings)

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

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

projects/*/secrets/*/versions/latest is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.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.

Overrides

AccessSecretVersionAsync(AccessSecretVersionRequest, CallSettings)

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

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

projects/*/secrets/*/versions/latest is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.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
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.v1beta2.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1beta2.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.

Overrides

AddSecretVersionAsync(AddSecretVersionRequest, CallSettings)

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

Creates a new [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] containing secret data and attaches it to an existing [Secret][google.cloud.secretmanager.v1beta2.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
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.v1beta2.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1beta2.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.

Overrides

CreateSecretAsync(CreateSecretRequest, CallSettings)

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

Creates a new [Secret][google.cloud.secretmanager.v1beta2.Secret] containing no [SecretVersions][google.cloud.secretmanager.v1beta2.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
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.v1beta2.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.

Overrides

DeleteSecretAsync(DeleteSecretRequest, CallSettings)

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

Deletes a [Secret][google.cloud.secretmanager.v1beta2.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.

Overrides

DestroySecretVersion(DestroySecretVersionRequest, CallSettings)

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

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

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1beta2.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.

Overrides

DestroySecretVersionAsync(DestroySecretVersionRequest, CallSettings)

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

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

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DESTROYED][google.cloud.secretmanager.v1beta2.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
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.v1beta2.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1beta2.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.

Overrides

DisableSecretVersionAsync(DisableSecretVersionRequest, CallSettings)

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

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

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [DISABLED][google.cloud.secretmanager.v1beta2.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
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.v1beta2.SecretVersion].

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1beta2.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.

Overrides

EnableSecretVersionAsync(EnableSecretVersionRequest, CallSettings)

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

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

Sets the [state][google.cloud.secretmanager.v1beta2.SecretVersion.state] of the [SecretVersion][google.cloud.secretmanager.v1beta2.SecretVersion] to [ENABLED][google.cloud.secretmanager.v1beta2.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
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
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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.v1beta2.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.

Overrides

GetSecretAsync(GetSecretRequest, CallSettings)

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

Gets metadata for a given [Secret][google.cloud.secretmanager.v1beta2.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
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.v1beta2.SecretVersion].

projects/*/secrets/*/versions/latest is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.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.

Overrides

GetSecretVersionAsync(GetSecretVersionRequest, CallSettings)

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

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

projects/*/secrets/*/versions/latest is an alias to the most recently created [SecretVersion][google.cloud.secretmanager.v1beta2.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
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.v1beta2.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
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.v1beta2.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
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.v1beta2.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
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.v1beta2.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
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.v1beta2.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1beta2.Secret].

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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.v1beta2.SecretVersion] are enforced according to the policy set on the associated [Secret][google.cloud.secretmanager.v1beta2.Secret].

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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.v1beta2.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.

Overrides

UpdateSecretAsync(UpdateSecretRequest, CallSettings)

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

Updates metadata of an existing [Secret][google.cloud.secretmanager.v1beta2.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
TaskSecret

A Task containing the RPC response.

Overrides