Class google::cloud::secretmanager_v1::SecretManagerServiceClient (2.10.1)

Secret Manager Service.

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

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

SecretManagerServiceClient

Parameter
Name Description
SecretManagerServiceClient const &

SecretManagerServiceClient

Parameter
Name Description
SecretManagerServiceClient &&

SecretManagerServiceClient

Parameters
Name Description
connection std::shared_ptr< SecretManagerServiceConnection >
opts Options

~SecretManagerServiceClient

Operators

operator=

Parameter
Name Description
SecretManagerServiceClient const &
Returns
Type Description
SecretManagerServiceClient &

operator=

Parameter
Name Description
SecretManagerServiceClient &&
Returns
Type Description
SecretManagerServiceClient &

Functions

ListSecrets

Lists Secrets.

Parameters
Name Description
parent std::string const &

Required. The resource name of the project associated with the Secrets, in the format projects/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

ListSecrets

Lists Secrets.

Parameters
Name Description
request google::cloud::secretmanager::v1::ListSecretsRequest

google::cloud::secretmanager::v1::ListSecretsRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

CreateSecret

Creates a new Secret containing no SecretVersions.

Parameters
Name Description
parent std::string const &

Required. The resource name of the project to associate with the Secret, in the format projects/*.

secret_id std::string const &

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.

secret google::cloud::secretmanager::v1::Secret const &

Required. A Secret with initial field values.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

CreateSecret

Creates a new Secret containing no SecretVersions.

Parameters
Name Description
request google::cloud::secretmanager::v1::CreateSecretRequest const &

google::cloud::secretmanager::v1::CreateSecretRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

AddSecretVersion

Creates a new SecretVersion containing secret data and attaches it to an existing Secret.

Parameters
Name Description
parent std::string const &

Required. The resource name of the Secret to associate with the SecretVersion in the format projects/*/secrets/*.

payload google::cloud::secretmanager::v1::SecretPayload const &

Required. The secret payload of the SecretVersion.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

AddSecretVersion

Creates a new SecretVersion containing secret data and attaches it to an existing Secret.

Parameters
Name Description
request google::cloud::secretmanager::v1::AddSecretVersionRequest const &

google::cloud::secretmanager::v1::AddSecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

GetSecret

Gets metadata for a given Secret.

Parameters
Name Description
name std::string const &

Required. The resource name of the Secret, in the format projects/*/secrets/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

GetSecret

Gets metadata for a given Secret.

Parameters
Name Description
request google::cloud::secretmanager::v1::GetSecretRequest const &

google::cloud::secretmanager::v1::GetSecretRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

UpdateSecret

Updates metadata of an existing Secret.

Parameters
Name Description
secret google::cloud::secretmanager::v1::Secret const &

Required. Secret with updated field values.

update_mask google::protobuf::FieldMask const &

Required. Specifies the fields to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

UpdateSecret

Updates metadata of an existing Secret.

Parameters
Name Description
request google::cloud::secretmanager::v1::UpdateSecretRequest const &

google::cloud::secretmanager::v1::UpdateSecretRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::Secret > [`google::cloud::secretmanager::v1::Secret`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L40)

DeleteSecret

Deletes a Secret.

Parameters
Name Description
name std::string const &

Required. The resource name of the Secret to delete in the format projects/*/secrets/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

DeleteSecret

Deletes a Secret.

Parameters
Name Description
request google::cloud::secretmanager::v1::DeleteSecretRequest const &

google::cloud::secretmanager::v1::DeleteSecretRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

ListSecretVersions

This call does not return secret data.

Parameters
Name Description
parent std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

ListSecretVersions

This call does not return secret data.

Parameters
Name Description
request google::cloud::secretmanager::v1::ListSecretVersionsRequest

google::cloud::secretmanager::v1::ListSecretVersionsRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

GetSecretVersion

Gets metadata for a SecretVersion.

projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters
Name Description
name std::string const &

Required. The resource name of the SecretVersion in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

GetSecretVersion

Gets metadata for a SecretVersion.

projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters
Name Description
request google::cloud::secretmanager::v1::GetSecretVersionRequest const &

google::cloud::secretmanager::v1::GetSecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

AccessSecretVersion

Accesses a SecretVersion.

This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters
Name Description
name std::string const &

Required. The resource name of the SecretVersion in the format projects/*/secrets/*/versions/*. projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse > [`google::cloud::secretmanager::v1::AccessSecretVersionResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/service.proto#L378)

AccessSecretVersion

Accesses a SecretVersion.

This call returns the secret data.

projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters
Name Description
request google::cloud::secretmanager::v1::AccessSecretVersionRequest const &

google::cloud::secretmanager::v1::AccessSecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::AccessSecretVersionResponse > [`google::cloud::secretmanager::v1::AccessSecretVersionResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/service.proto#L378)

DisableSecretVersion

Disables a SecretVersion.

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

Parameters
Name Description
name std::string const &

Required. The resource name of the SecretVersion to disable in the format projects/*/secrets/*/versions/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

DisableSecretVersion

Disables a SecretVersion.

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

Parameters
Name Description
request google::cloud::secretmanager::v1::DisableSecretVersionRequest const &

google::cloud::secretmanager::v1::DisableSecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

EnableSecretVersion

Enables a SecretVersion.

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

Parameters
Name Description
name std::string const &

Required. The resource name of the SecretVersion to enable in the format projects/*/secrets/*/versions/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

EnableSecretVersion

Enables a SecretVersion.

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

Parameters
Name Description
request google::cloud::secretmanager::v1::EnableSecretVersionRequest const &

google::cloud::secretmanager::v1::EnableSecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

DestroySecretVersion

Destroys a SecretVersion.

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

Parameters
Name Description
name std::string const &

Required. The resource name of the SecretVersion to destroy in the format projects/*/secrets/*/versions/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

DestroySecretVersion

Destroys a SecretVersion.

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

Parameters
Name Description
request google::cloud::secretmanager::v1::DestroySecretVersionRequest const &

google::cloud::secretmanager::v1::DestroySecretVersionRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::secretmanager::v1::SecretVersion > [`google::cloud::secretmanager::v1::SecretVersion`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/cloud/secretmanager/v1/resources.proto#L144)

SetIamPolicy

Sets the access control policy on the specified secret.

Replaces any existing policy.

Permissions on SecretVersions are enforced according to the policy set on the associated Secret.

Parameters
Name Description
request google::iam::v1::SetIamPolicyRequest const &

google::iam::v1::SetIamPolicyRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy > [`google::iam::v1::Policy`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/policy.proto#L98)

GetIamPolicy

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 google::iam::v1::GetIamPolicyRequest const &

google::iam::v1::GetIamPolicyRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy > [`google::iam::v1::Policy`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/policy.proto#L98)

TestIamPermissions

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 google::iam::v1::TestIamPermissionsRequest const &

google::iam::v1::TestIamPermissionsRequest

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse > [`google::iam::v1::TestIamPermissionsResponse`](https://github.com/googleapis/googleapis/blob/2da477b6a72168c65fdb4245530cfa702cc4b029/google/iam/v1/iam_policy.proto#L151)