On January 1, 2020 this library will no longer support Python 2 on the latest released version. Previously released library versions will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Secret Manager API Client

class google.cloud.secretmanager_v1beta1.types.AccessSecretVersionRequest

Request message for [SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].

name

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

name

Field google.cloud.secrets.v1beta1.AccessSecretVersionRequest.name

class google.cloud.secretmanager_v1beta1.types.AccessSecretVersionResponse

Response message for [SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].

name

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

payload

Secret payload

name

Field google.cloud.secrets.v1beta1.AccessSecretVersionResponse.name

payload

Field google.cloud.secrets.v1beta1.AccessSecretVersionResponse.payload

class google.cloud.secretmanager_v1beta1.types.AddSecretVersionRequest

Request message for [SecretManagerService.AddSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersion].

parent

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

payload

Required. The secret payload of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].

parent

Field google.cloud.secrets.v1beta1.AddSecretVersionRequest.parent

payload

Field google.cloud.secrets.v1beta1.AddSecretVersionRequest.payload

class google.cloud.secretmanager_v1beta1.types.AuditConfigDelta

One delta entry for AuditConfig. Each individual change (only one exempted_member in each entry) to a AuditConfig will be a separate entry.

action

The action that was performed on an audit configuration in a policy. Required

service

Specifies a service that was configured for Cloud Audit Logging. For example, storage.googleapis.com, cloudsql.googleapis.com. allServices is a special value that covers all services. Required

exempted_member

A single identity that is exempted from “data access” audit logging for the service specified above. Follows the same format of Binding.members.

log_type

Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always enabled, and cannot be configured. Required

action

Field google.iam.v1.AuditConfigDelta.action

exempted_member

Field google.iam.v1.AuditConfigDelta.exempted_member

log_type

Field google.iam.v1.AuditConfigDelta.log_type

service

Field google.iam.v1.AuditConfigDelta.service

class google.cloud.secretmanager_v1beta1.types.Binding

Associates members with a role.

role

Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner.

members

Specifies the identities requesting access for a Cloud Platform resource. members can have the following values: - allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. - allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. - user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com . - serviceAccount:{emailid}: An email address that represents a service account. For example, my-other- app@appspot.gserviceaccount.com. - group:{emailid}: An email address that represents a Google group. For example, admins@example.com. - domain:{domain}: The G Suite domain (primary) that represents all the users of that domain. For example, google.com or example.com.

condition

The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.

condition

Field google.iam.v1.Binding.condition

members

Field google.iam.v1.Binding.members

role

Field google.iam.v1.Binding.role

class google.cloud.secretmanager_v1beta1.types.BindingDelta

One delta entry for Binding. Each individual change (only one member in each entry) to a binding will be a separate entry.

action

The action that was performed on a Binding. Required

role

Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner. Required

member

A single identity requesting access for a Cloud Platform resource. Follows the same format of Binding.members. Required

condition

Unimplemented. The condition that is associated with this binding. This field is logged only for Cloud Audit Logging.

action

Field google.iam.v1.BindingDelta.action

condition

Field google.iam.v1.BindingDelta.condition

member

Field google.iam.v1.BindingDelta.member

role

Field google.iam.v1.BindingDelta.role

class google.cloud.secretmanager_v1beta1.types.CreateSecretRequest

Request message for [SecretManagerService.CreateSecret][google.cloud.secrets.v1beta1.SecretManagerService.CreateSecret].

parent

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

secret_id

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

A [Secret][google.cloud.secrets.v1beta1.Secret] with initial field values.

parent

Field google.cloud.secrets.v1beta1.CreateSecretRequest.parent

secret

Field google.cloud.secrets.v1beta1.CreateSecretRequest.secret

secret_id

Field google.cloud.secrets.v1beta1.CreateSecretRequest.secret_id

class google.cloud.secretmanager_v1beta1.types.DeleteSecretRequest

Request message for [SecretManagerService.DeleteSecret][google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecret].

name

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

name

Field google.cloud.secrets.v1beta1.DeleteSecretRequest.name

class google.cloud.secretmanager_v1beta1.types.DestroySecretVersionRequest

Request message for [SecretManagerService.DestroySecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersion].

name

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

name

Field google.cloud.secrets.v1beta1.DestroySecretVersionRequest.name

class google.cloud.secretmanager_v1beta1.types.DisableSecretVersionRequest

Request message for [SecretManagerService.DisableSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersion].

name

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

name

Field google.cloud.secrets.v1beta1.DisableSecretVersionRequest.name

class google.cloud.secretmanager_v1beta1.types.Empty
class google.cloud.secretmanager_v1beta1.types.EnableSecretVersionRequest

Request message for [SecretManagerService.EnableSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersion].

name

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

name

Field google.cloud.secrets.v1beta1.EnableSecretVersionRequest.name

class google.cloud.secretmanager_v1beta1.types.Expr
description

Field google.type.Expr.description

expression

Field google.type.Expr.expression

location

Field google.type.Expr.location

title

Field google.type.Expr.title

class google.cloud.secretmanager_v1beta1.types.FieldMask
paths

Field google.protobuf.FieldMask.paths

class google.cloud.secretmanager_v1beta1.types.GetIamPolicyRequest

Request message for GetIamPolicy method.

resource

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

options

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy. This field is only used by Cloud IAM.

options

Field google.iam.v1.GetIamPolicyRequest.options

resource

Field google.iam.v1.GetIamPolicyRequest.resource

class google.cloud.secretmanager_v1beta1.types.GetPolicyOptions

Encapsulates settings provided to GetIamPolicy.

requested_policy_version

Optional. The policy format version to be returned. Acceptable values are 0 and 1. If the value is 0, or the field is omitted, policy format version 1 will be returned.

requested_policy_version

Field google.iam.v1.GetPolicyOptions.requested_policy_version

class google.cloud.secretmanager_v1beta1.types.GetSecretRequest

Request message for [SecretManagerService.GetSecret][google.cloud.secrets.v1beta1.SecretManagerService.GetSecret].

name

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

name

Field google.cloud.secrets.v1beta1.GetSecretRequest.name

class google.cloud.secretmanager_v1beta1.types.GetSecretVersionRequest

Request message for [SecretManagerService.GetSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersion].

name

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

name

Field google.cloud.secrets.v1beta1.GetSecretVersionRequest.name

class google.cloud.secretmanager_v1beta1.types.ListSecretVersionsRequest

Request message for [SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].

parent

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

page_size

Optional. The maximum number of results to be returned in a single page. If set to 0, the server decides the number of results to return. If the number is greater than 25000, it is capped at 25000.

page_token

Optional. Pagination token, returned earlier via ListSecretVersionsResponse.next_page_token][].

page_size

Field google.cloud.secrets.v1beta1.ListSecretVersionsRequest.page_size

page_token

Field google.cloud.secrets.v1beta1.ListSecretVersionsRequest.page_token

parent

Field google.cloud.secrets.v1beta1.ListSecretVersionsRequest.parent

class google.cloud.secretmanager_v1beta1.types.ListSecretVersionsResponse

Response message for [SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].

versions

The list of [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] sorted in reverse by create_time (newest first).

next_page_token

A token to retrieve the next page of results. Pass this value in [ListSecretVersionsRequest.page_token][google.cloud.secrets .v1beta1.ListSecretVersionsRequest.page_token] to retrieve the next page.

total_size

The total number of [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion].

next_page_token

Field google.cloud.secrets.v1beta1.ListSecretVersionsResponse.next_page_token

total_size

Field google.cloud.secrets.v1beta1.ListSecretVersionsResponse.total_size

versions

Field google.cloud.secrets.v1beta1.ListSecretVersionsResponse.versions

class google.cloud.secretmanager_v1beta1.types.ListSecretsRequest

Request message for [SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].

parent

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

page_size

Optional. The maximum number of results to be returned in a single page. If set to 0, the server decides the number of results to return. If the number is greater than 25000, it is capped at 25000.

page_token

Optional. Pagination token, returned earlier via [ListSecretsR esponse.next_page_token][google.cloud.secrets.v1beta1.ListSecr etsResponse.next_page_token].

page_size

Field google.cloud.secrets.v1beta1.ListSecretsRequest.page_size

page_token

Field google.cloud.secrets.v1beta1.ListSecretsRequest.page_token

parent

Field google.cloud.secrets.v1beta1.ListSecretsRequest.parent

class google.cloud.secretmanager_v1beta1.types.ListSecretsResponse

Response message for [SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].

secrets

The list of [Secrets][google.cloud.secrets.v1beta1.Secret] sorted in reverse by create_time (newest first).

next_page_token

A token to retrieve the next page of results. Pass this value in [ListSecretsRequest.page_token][google.cloud.secrets.v1beta 1.ListSecretsRequest.page_token] to retrieve the next page.

total_size

The total number of [Secrets][google.cloud.secrets.v1beta1.Secret].

next_page_token

Field google.cloud.secrets.v1beta1.ListSecretsResponse.next_page_token

secrets

Field google.cloud.secrets.v1beta1.ListSecretsResponse.secrets

total_size

Field google.cloud.secrets.v1beta1.ListSecretsResponse.total_size

class google.cloud.secretmanager_v1beta1.types.Policy

Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.

A Policy consists of a list of bindings. A binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.

JSON Example

{
  "bindings": [
    {
      "role": "roles/owner",
      "members": [
        "user:mike@example.com",
        "group:admins@example.com",
        "domain:google.com",
        "serviceAccount:my-other-app@appspot.gserviceaccount.com"
      ]
    },
    {
      "role": "roles/viewer",
      "members": ["user:sean@example.com"]
    }
  ]
}

YAML Example

bindings:
- members:
  - user:mike@example.com
  - group:admins@example.com
  - domain:google.com
  - serviceAccount:my-other-app@appspot.gserviceaccount.com
  role: roles/owner
- members:
  - user:sean@example.com
  role: roles/viewer

For a description of IAM and its features, see the IAM developer’s guide.

version

Deprecated.

bindings

Associates a list of members to a role. bindings with no members will result in an error.

etag

etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly.

bindings

Field google.iam.v1.Policy.bindings

etag

Field google.iam.v1.Policy.etag

version

Field google.iam.v1.Policy.version

class google.cloud.secretmanager_v1beta1.types.PolicyDelta

The difference delta between two policies.

binding_deltas

The delta for Bindings between two policies.

audit_config_deltas

The delta for AuditConfigs between two policies.

audit_config_deltas

Field google.iam.v1.PolicyDelta.audit_config_deltas

binding_deltas

Field google.iam.v1.PolicyDelta.binding_deltas

class google.cloud.secretmanager_v1beta1.types.Replication

A policy that defines the replication configuration of data.

replication

The replication policy for this secret.

automatic

The [Secret][google.cloud.secrets.v1beta1.Secret] will automatically be replicated without any restrictions.

user_managed

The [Secret][google.cloud.secrets.v1beta1.Secret] will only be replicated into the locations specified.

class Automatic

A replication policy that replicates the [Secret][google.cloud.secrets.v1beta1.Secret] payload without any restrictions.

class UserManaged

A replication policy that replicates the [Secret][google.cloud.secrets.v1beta1.Secret] payload into the locations specified in [Secret.replication.user_managed.replicas][]

replicas

Required. The list of Replicas for this [Secret][google.cloud.secrets.v1beta1.Secret]. Cannot be empty.

class Replica

Represents a Replica for this [Secret][google.cloud.secrets.v1beta1.Secret].

location

The canonical IDs of the location to replicate data. For example: "us-east1".

location

Field google.cloud.secrets.v1beta1.Replication.UserManaged.Replica.location

replicas

Field google.cloud.secrets.v1beta1.Replication.UserManaged.replicas

automatic

Field google.cloud.secrets.v1beta1.Replication.automatic

user_managed

Field google.cloud.secrets.v1beta1.Replication.user_managed

class google.cloud.secretmanager_v1beta1.types.Secret

A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose value and versions can be accessed.

A [Secret][google.cloud.secrets.v1beta1.Secret] is made up of zero or more [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] that represent the secret data.

name

Output only. The resource name of the [Secret][google.cloud.secrets.v1beta1.Secret] in the format projects/*/secrets/*.

replication

Required. Immutable. The replication policy of the secret data attached to the [Secret][google.cloud.secrets.v1beta1.Secret]. The replication policy cannot be changed after the Secret has been created.

create_time

Output only. The time at which the [Secret][google.cloud.secrets.v1beta1.Secret] was created.

labels

The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given resource.

class LabelsEntry
key

Field google.cloud.secrets.v1beta1.Secret.LabelsEntry.key

value

Field google.cloud.secrets.v1beta1.Secret.LabelsEntry.value

create_time

Field google.cloud.secrets.v1beta1.Secret.create_time

labels

Field google.cloud.secrets.v1beta1.Secret.labels

name

Field google.cloud.secrets.v1beta1.Secret.name

replication

Field google.cloud.secrets.v1beta1.Secret.replication

class google.cloud.secretmanager_v1beta1.types.SecretPayload

A secret payload resource in the Secret Manager API. This contains the sensitive secret data that is associated with a [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].

data

The secret data. Must be no larger than 64KiB.

data

Field google.cloud.secrets.v1beta1.SecretPayload.data

class google.cloud.secretmanager_v1beta1.types.SecretVersion

A secret version resource in the Secret Manager API.

name

Output only. The resource name of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] in the format projects/*/secrets/*/versions/*. [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] IDs in a [Secret][google.cloud.secrets.v1beta1.Secret] start at 1 and are incremented for each subsequent version of the secret.

create_time

Output only. The time at which the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] was created.

destroy_time

Output only. The time this [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion] was destroyed. Only present if [state][google.cloud.secrets.v1beta1.SecretVersion.state] is [ DESTROYED][google.cloud.secrets.v1beta1.SecretVersion.State.DE STROYED].

state

Output only. The current state of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].

create_time

Field google.cloud.secrets.v1beta1.SecretVersion.create_time

destroy_time

Field google.cloud.secrets.v1beta1.SecretVersion.destroy_time

name

Field google.cloud.secrets.v1beta1.SecretVersion.name

state

Field google.cloud.secrets.v1beta1.SecretVersion.state

class google.cloud.secretmanager_v1beta1.types.SetIamPolicyRequest

Request message for SetIamPolicy method.

resource

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

policy

Field google.iam.v1.SetIamPolicyRequest.policy

resource

Field google.iam.v1.SetIamPolicyRequest.resource

class google.cloud.secretmanager_v1beta1.types.TestIamPermissionsRequest

Request message for TestIamPermissions method.

resource

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions

The set of permissions to check for the resource. Permissions with wildcards (such as ‘*’ or ’storage.*’) are not allowed. For more information see IAM Overview.

permissions

Field google.iam.v1.TestIamPermissionsRequest.permissions

resource

Field google.iam.v1.TestIamPermissionsRequest.resource

class google.cloud.secretmanager_v1beta1.types.TestIamPermissionsResponse

Response message for TestIamPermissions method.

permissions

A subset of TestPermissionsRequest.permissions that the caller is allowed.

permissions

Field google.iam.v1.TestIamPermissionsResponse.permissions

class google.cloud.secretmanager_v1beta1.types.Timestamp
nanos

Field google.protobuf.Timestamp.nanos

seconds

Field google.protobuf.Timestamp.seconds

class google.cloud.secretmanager_v1beta1.types.UpdateSecretRequest

Request message for [SecretManagerService.UpdateSecret][google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecret].

secret

Required. [Secret][google.cloud.secrets.v1beta1.Secret] with updated field values.

update_mask

Required. Specifies the fields to be updated.

secret

Field google.cloud.secrets.v1beta1.UpdateSecretRequest.secret

update_mask

Field google.cloud.secrets.v1beta1.UpdateSecretRequest.update_mask