or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
golangpkg:golang/cloud.google.com/go/secretmanager@v1.16.0

docs

client.mdiam.mdindex.mdsecrets.mdtypes.mdversions.md
tile.json

tessl/golang-cloud-google-com--go--secretmanager

tessl install tessl/golang-cloud-google-com--go--secretmanager@1.16.1

Go Client Library for Google Cloud Secret Manager API - stores sensitive data such as API keys, passwords, and certificates

types.mddocs/

Request and Response Types

This document provides complete type definitions for all Secret Manager API operations, including core types, request/response structures, and enumerations.

Core Types

Secret

type Secret struct {
    Name                      string
    Replication               *Replication
    CreateTime                *timestamppb.Timestamp
    Labels                    map[string]string
    Topics                    []*Topic
    Expiration                isSecret_Expiration
    Etag                      string
    Rotation                  *Rotation
    VersionAliases            map[string]int64
    Annotations               map[string]string
    VersionDestroyTtl         *durationpb.Duration
    CustomerManagedEncryption *CustomerManagedEncryption
    Tags                      map[string]string
}

A Secret is a logical secret whose value and versions can be accessed.

Fields:

  • Name - Output only. The resource name in format projects/*/secrets/*
  • Replication - Optional. Immutable. The replication policy of the secret data
  • CreateTime - Output only. The time at which the Secret was created
  • Labels - The labels assigned to this Secret (max 64)
  • Topics - Optional. A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions
  • Expiration - Optional. Expiration policy (oneof field, see below)
  • Etag - Optional. Etag of the currently stored Secret
  • Rotation - Optional. Rotation policy
  • VersionAliases - Optional. Mapping from version alias to version name (max 50)
  • Annotations - Optional. Custom metadata (max 16 KiB total size)
  • VersionDestroyTtl - Optional. Secret Version TTL after destruction request
  • CustomerManagedEncryption - Optional. Customer-managed encryption configuration for regionalized secrets
  • Tags - Optional. Input only. Immutable. Tag key/values attached to resources

Expiration Oneof:

The Expiration field is a oneof with two possible types:

type Secret_ExpireTime struct {
    ExpireTime *timestamppb.Timestamp
}

type Secret_Ttl struct {
    Ttl *durationpb.Duration
}

Methods:

func (x *Secret) GetAnnotations() map[string]string
func (x *Secret) GetCreateTime() *timestamppb.Timestamp
func (x *Secret) GetCustomerManagedEncryption() *CustomerManagedEncryption
func (x *Secret) GetEtag() string
func (m *Secret) GetExpiration() isSecret_Expiration
func (x *Secret) GetExpireTime() *timestamppb.Timestamp
func (x *Secret) GetLabels() map[string]string
func (x *Secret) GetName() string
func (x *Secret) GetReplication() *Replication
func (x *Secret) GetRotation() *Rotation
func (x *Secret) GetTags() map[string]string
func (x *Secret) GetTopics() []*Topic
func (x *Secret) GetTtl() *durationpb.Duration
func (x *Secret) GetVersionAliases() map[string]int64
func (x *Secret) GetVersionDestroyTtl() *durationpb.Duration
func (x *Secret) ProtoReflect() protoreflect.Message
func (x *Secret) Reset()
func (x *Secret) String() string
func (*Secret) ProtoMessage()

SecretVersion

type SecretVersion struct {
    Name                           string
    CreateTime                     *timestamppb.Timestamp
    DestroyTime                    *timestamppb.Timestamp
    State                          SecretVersion_State
    ReplicationStatus              *ReplicationStatus
    Etag                           string
    ClientSpecifiedPayloadChecksum bool
    ScheduledDestroyTime           *timestamppb.Timestamp
    CustomerManagedEncryption      *CustomerManagedEncryptionStatus
}

A secret version resource in the Secret Manager API.

Fields:

  • Name - Output only. The resource name in format projects/*/secrets/*/versions/*
  • CreateTime - Output only. The time at which the SecretVersion was created
  • DestroyTime - Output only. The time this SecretVersion was destroyed (only present if state is DESTROYED)
  • State - Output only. The current state of the SecretVersion
  • ReplicationStatus - The replication status of the SecretVersion
  • Etag - Output only. Etag of the currently stored SecretVersion
  • ClientSpecifiedPayloadChecksum - Output only. True if a client-specified payload checksum was received on creation
  • ScheduledDestroyTime - Optional. Output only. Scheduled destroy time if a destroy request has been made
  • CustomerManagedEncryption - Output only. Customer-managed encryption status (for regionalized secrets)

Methods:

func (x *SecretVersion) GetClientSpecifiedPayloadChecksum() bool
func (x *SecretVersion) GetCreateTime() *timestamppb.Timestamp
func (x *SecretVersion) GetCustomerManagedEncryption() *CustomerManagedEncryptionStatus
func (x *SecretVersion) GetDestroyTime() *timestamppb.Timestamp
func (x *SecretVersion) GetEtag() string
func (x *SecretVersion) GetName() string
func (x *SecretVersion) GetReplicationStatus() *ReplicationStatus
func (x *SecretVersion) GetScheduledDestroyTime() *timestamppb.Timestamp
func (x *SecretVersion) GetState() SecretVersion_State
func (x *SecretVersion) ProtoReflect() protoreflect.Message
func (x *SecretVersion) Reset()
func (x *SecretVersion) String() string
func (*SecretVersion) ProtoMessage()

SecretPayload

type SecretPayload struct {
    Data       []byte
    DataCrc32C *int64
}

A secret payload resource containing the sensitive secret data.

Fields:

  • Data - The secret data (must be no larger than 64 KiB)
  • DataCrc32C - Optional. CRC32C checksum of the data. If specified, Secret Manager will verify the integrity of the received data on creation

Methods:

func (x *SecretPayload) GetData() []byte
func (x *SecretPayload) GetDataCrc32C() int64
func (x *SecretPayload) ProtoReflect() protoreflect.Message
func (x *SecretPayload) Reset()
func (x *SecretPayload) String() string
func (*SecretPayload) ProtoMessage()

Replication Types

Replication

type Replication struct {
    Replication isReplication_Replication
}

A policy that defines the replication and encryption configuration of data.

Oneof Types:

type Replication_Automatic_ struct {
    Automatic *Replication_Automatic
}

type Replication_UserManaged_ struct {
    UserManaged *Replication_UserManaged
}

Methods:

func (x *Replication) GetAutomatic() *Replication_Automatic
func (m *Replication) GetReplication() isReplication_Replication
func (x *Replication) GetUserManaged() *Replication_UserManaged
func (x *Replication) ProtoReflect() protoreflect.Message
func (x *Replication) Reset()
func (x *Replication) String() string
func (*Replication) ProtoMessage()

Replication_Automatic

type Replication_Automatic struct {
    CustomerManagedEncryption *CustomerManagedEncryption
}

A replication policy that replicates the Secret payload without any restrictions.

Fields:

  • CustomerManagedEncryption - Optional. The customer-managed encryption configuration of the Secret

Methods:

func (x *Replication_Automatic) GetCustomerManagedEncryption() *CustomerManagedEncryption
func (x *Replication_Automatic) ProtoReflect() protoreflect.Message
func (x *Replication_Automatic) Reset()
func (x *Replication_Automatic) String() string
func (*Replication_Automatic) ProtoMessage()

Replication_UserManaged

type Replication_UserManaged struct {
    Replicas []*Replication_UserManaged_Replica
}

A replication policy that replicates the Secret payload into the locations specified in Secret.replication.user_managed.replicas.

Fields:

  • Replicas - Required. The list of Replicas for this Secret (cannot be empty)

Methods:

func (x *Replication_UserManaged) GetReplicas() []*Replication_UserManaged_Replica
func (x *Replication_UserManaged) ProtoReflect() protoreflect.Message
func (x *Replication_UserManaged) Reset()
func (x *Replication_UserManaged) String() string
func (*Replication_UserManaged) ProtoMessage()

Replication_UserManaged_Replica

type Replication_UserManaged_Replica struct {
    Location                  string
    CustomerManagedEncryption *CustomerManagedEncryption
}

Represents a Replica for this Secret.

Fields:

  • Location - The canonical IDs of the location to replicate data (e.g., "us-east1")
  • CustomerManagedEncryption - Optional. The customer-managed encryption configuration of the User-Managed Replica

Methods:

func (x *Replication_UserManaged_Replica) GetCustomerManagedEncryption() *CustomerManagedEncryption
func (x *Replication_UserManaged_Replica) GetLocation() string
func (x *Replication_UserManaged_Replica) ProtoReflect() protoreflect.Message
func (x *Replication_UserManaged_Replica) Reset()
func (x *Replication_UserManaged_Replica) String() string
func (*Replication_UserManaged_Replica) ProtoMessage()

ReplicationStatus

type ReplicationStatus struct {
    ReplicationStatus isReplicationStatus_ReplicationStatus
}

The replication status of a SecretVersion.

Oneof Types:

type ReplicationStatus_Automatic struct {
    Automatic *ReplicationStatus_AutomaticStatus
}

type ReplicationStatus_UserManaged struct {
    UserManaged *ReplicationStatus_UserManagedStatus
}

Methods:

func (x *ReplicationStatus) GetAutomatic() *ReplicationStatus_AutomaticStatus
func (m *ReplicationStatus) GetReplicationStatus() isReplicationStatus_ReplicationStatus
func (x *ReplicationStatus) GetUserManaged() *ReplicationStatus_UserManagedStatus
func (x *ReplicationStatus) ProtoReflect() protoreflect.Message
func (x *ReplicationStatus) Reset()
func (x *ReplicationStatus) String() string
func (*ReplicationStatus) ProtoMessage()

ReplicationStatus_AutomaticStatus

type ReplicationStatus_AutomaticStatus struct {
    CustomerManagedEncryption *CustomerManagedEncryptionStatus
}

The replication status of a SecretVersion using automatic replication.

Fields:

  • CustomerManagedEncryption - Output only. The customer-managed encryption status of the SecretVersion

Methods:

func (x *ReplicationStatus_AutomaticStatus) GetCustomerManagedEncryption() *CustomerManagedEncryptionStatus
func (x *ReplicationStatus_AutomaticStatus) ProtoReflect() protoreflect.Message
func (x *ReplicationStatus_AutomaticStatus) Reset()
func (x *ReplicationStatus_AutomaticStatus) String() string
func (*ReplicationStatus_AutomaticStatus) ProtoMessage()

ReplicationStatus_UserManagedStatus

type ReplicationStatus_UserManagedStatus struct {
    Replicas []*ReplicationStatus_UserManagedStatus_ReplicaStatus
}

The replication status of a SecretVersion using user-managed replication.

Fields:

  • Replicas - Output only. The list of replica statuses for the SecretVersion

Methods:

func (x *ReplicationStatus_UserManagedStatus) GetReplicas() []*ReplicationStatus_UserManagedStatus_ReplicaStatus
func (x *ReplicationStatus_UserManagedStatus) ProtoReflect() protoreflect.Message
func (x *ReplicationStatus_UserManagedStatus) Reset()
func (x *ReplicationStatus_UserManagedStatus) String() string
func (*ReplicationStatus_UserManagedStatus) ProtoMessage()

ReplicationStatus_UserManagedStatus_ReplicaStatus

type ReplicationStatus_UserManagedStatus_ReplicaStatus struct {
    Location                  string
    CustomerManagedEncryption *CustomerManagedEncryptionStatus
}

Describes the status of a user-managed replica for the SecretVersion.

Fields:

  • Location - Output only. The canonical ID of the replica location (e.g., "us-east1")
  • CustomerManagedEncryption - Output only. The customer-managed encryption status of the SecretVersion

Methods:

func (x *ReplicationStatus_UserManagedStatus_ReplicaStatus) GetCustomerManagedEncryption() *CustomerManagedEncryptionStatus
func (x *ReplicationStatus_UserManagedStatus_ReplicaStatus) GetLocation() string
func (x *ReplicationStatus_UserManagedStatus_ReplicaStatus) ProtoReflect() protoreflect.Message
func (x *ReplicationStatus_UserManagedStatus_ReplicaStatus) Reset()
func (x *ReplicationStatus_UserManagedStatus_ReplicaStatus) String() string
func (*ReplicationStatus_UserManagedStatus_ReplicaStatus) ProtoMessage()

Encryption Types

CustomerManagedEncryption

type CustomerManagedEncryption struct {
    KmsKeyName string
}

Configuration for encrypting secret payloads using customer-managed encryption keys (CMEK).

Fields:

  • KmsKeyName - Required. The resource name of the Cloud KMS CryptoKey in format projects/*/locations/*/keyRings/*/cryptoKeys/*

Methods:

func (x *CustomerManagedEncryption) GetKmsKeyName() string
func (x *CustomerManagedEncryption) ProtoReflect() protoreflect.Message
func (x *CustomerManagedEncryption) Reset()
func (x *CustomerManagedEncryption) String() string
func (*CustomerManagedEncryption) ProtoMessage()

CustomerManagedEncryptionStatus

type CustomerManagedEncryptionStatus struct {
    KmsKeyVersionName string
}

Describes the status of customer-managed encryption.

Fields:

  • KmsKeyVersionName - Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the secret payload in format projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*

Methods:

func (x *CustomerManagedEncryptionStatus) GetKmsKeyVersionName() string
func (x *CustomerManagedEncryptionStatus) ProtoReflect() protoreflect.Message
func (x *CustomerManagedEncryptionStatus) Reset()
func (x *CustomerManagedEncryptionStatus) String() string
func (*CustomerManagedEncryptionStatus) ProtoMessage()

Rotation Types

Rotation

type Rotation struct {
    NextRotationTime *timestamppb.Timestamp
    RotationPeriod   *durationpb.Duration
}

The rotation time and period for a Secret.

Fields:

  • NextRotationTime - Optional. Timestamp in UTC when the Secret is scheduled to rotate (must be in the future, between 5 minutes and 100 years)
  • RotationPeriod - Input only. The Duration between rotation notifications (must be between 1 hour and 100 years)

Methods:

func (x *Rotation) GetNextRotationTime() *timestamppb.Timestamp
func (x *Rotation) GetRotationPeriod() *durationpb.Duration
func (x *Rotation) ProtoReflect() protoreflect.Message
func (x *Rotation) Reset()
func (x *Rotation) String() string
func (*Rotation) ProtoMessage()

Topic Type

Topic

type Topic struct {
    Name string
}

A Pub/Sub topic which Secret Manager will publish to when control plane events occur on this secret.

Fields:

  • Name - Identifier. The resource name of the Pub/Sub topic in format projects/*/topics/*

Methods:

func (x *Topic) GetName() string
func (x *Topic) ProtoReflect() protoreflect.Message
func (x *Topic) Reset()
func (x *Topic) String() string
func (*Topic) ProtoMessage()

Request Types

CreateSecretRequest

type CreateSecretRequest struct {
    Parent   string
    SecretId string
    Secret   *Secret
}

Request message for CreateSecret.

Fields:

  • Parent - Required. The resource name of the project in format projects/* or projects/*/locations/*
  • SecretId - Required. Unique identifier within the project (max 255 chars, alphanumeric, -, _)
  • Secret - Required. A Secret with initial field values

Methods:

func (x *CreateSecretRequest) GetParent() string
func (x *CreateSecretRequest) GetSecret() *Secret
func (x *CreateSecretRequest) GetSecretId() string
func (x *CreateSecretRequest) ProtoReflect() protoreflect.Message
func (x *CreateSecretRequest) Reset()
func (x *CreateSecretRequest) String() string
func (*CreateSecretRequest) ProtoMessage()

GetSecretRequest

type GetSecretRequest struct {
    Name string
}

Request message for GetSecret.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/* or projects/*/locations/*/secrets/*

Methods:

func (x *GetSecretRequest) GetName() string
func (x *GetSecretRequest) ProtoReflect() protoreflect.Message
func (x *GetSecretRequest) Reset()
func (x *GetSecretRequest) String() string
func (*GetSecretRequest) ProtoMessage()

UpdateSecretRequest

type UpdateSecretRequest struct {
    Secret     *Secret
    UpdateMask *fieldmaskpb.FieldMask
}

Request message for UpdateSecret.

Fields:

  • Secret - Required. Secret with updated field values
  • UpdateMask - Required. Specifies the fields to be updated

Methods:

func (x *UpdateSecretRequest) GetSecret() *Secret
func (x *UpdateSecretRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (x *UpdateSecretRequest) ProtoReflect() protoreflect.Message
func (x *UpdateSecretRequest) Reset()
func (x *UpdateSecretRequest) String() string
func (*UpdateSecretRequest) ProtoMessage()

DeleteSecretRequest

type DeleteSecretRequest struct {
    Name string
    Etag string
}

Request message for DeleteSecret.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/*
  • Etag - Optional. Etag of the Secret for optimistic concurrency control

Methods:

func (x *DeleteSecretRequest) GetEtag() string
func (x *DeleteSecretRequest) GetName() string
func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message
func (x *DeleteSecretRequest) Reset()
func (x *DeleteSecretRequest) String() string
func (*DeleteSecretRequest) ProtoMessage()

ListSecretsRequest

type ListSecretsRequest struct {
    Parent    string
    PageSize  int32
    PageToken string
    Filter    string
}

Request message for ListSecrets.

Fields:

  • Parent - Required. The resource name in format projects/* or projects/*/locations/*
  • PageSize - Optional. Maximum number of results per page (max 25000)
  • PageToken - Optional. Token from a previous request to retrieve the next page
  • Filter - Optional. Filter string for matching secrets

Methods:

func (x *ListSecretsRequest) GetFilter() string
func (x *ListSecretsRequest) GetPageSize() int32
func (x *ListSecretsRequest) GetPageToken() string
func (x *ListSecretsRequest) GetParent() string
func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message
func (x *ListSecretsRequest) Reset()
func (x *ListSecretsRequest) String() string
func (*ListSecretsRequest) ProtoMessage()

ListSecretsResponse

type ListSecretsResponse struct {
    Secrets       []*Secret
    NextPageToken string
    TotalSize     int32
}

Response message for ListSecrets.

Fields:

  • Secrets - The list of Secrets sorted in reverse by create_time
  • NextPageToken - Token to retrieve the next page
  • TotalSize - Total number of Secrets (0 when filter is set)

Methods:

func (x *ListSecretsResponse) GetNextPageToken() string
func (x *ListSecretsResponse) GetSecrets() []*Secret
func (x *ListSecretsResponse) GetTotalSize() int32
func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message
func (x *ListSecretsResponse) Reset()
func (x *ListSecretsResponse) String() string
func (*ListSecretsResponse) ProtoMessage()

AddSecretVersionRequest

type AddSecretVersionRequest struct {
    Parent  string
    Payload *SecretPayload
}

Request message for AddSecretVersion.

Fields:

  • Parent - Required. The resource name of the Secret in format projects/*/secrets/* or projects/*/locations/*/secrets/*
  • Payload - Required. The secret payload of the SecretVersion

Methods:

func (x *AddSecretVersionRequest) GetParent() string
func (x *AddSecretVersionRequest) GetPayload() *SecretPayload
func (x *AddSecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *AddSecretVersionRequest) Reset()
func (x *AddSecretVersionRequest) String() string
func (*AddSecretVersionRequest) ProtoMessage()

AccessSecretVersionRequest

type AccessSecretVersionRequest struct {
    Name string
}

Request message for AccessSecretVersion.

Fields:

  • Name - Required. The resource name of the SecretVersion in format projects/*/secrets/*/versions/* or projects/*/locations/*/secrets/*/versions/*

Methods:

func (x *AccessSecretVersionRequest) GetName() string
func (x *AccessSecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *AccessSecretVersionRequest) Reset()
func (x *AccessSecretVersionRequest) String() string
func (*AccessSecretVersionRequest) ProtoMessage()

AccessSecretVersionResponse

type AccessSecretVersionResponse struct {
    Name    string
    Payload *SecretPayload
}

Response message for AccessSecretVersion.

Fields:

  • Name - The resource name of the SecretVersion
  • Payload - Secret payload containing the data

Methods:

func (x *AccessSecretVersionResponse) GetName() string
func (x *AccessSecretVersionResponse) GetPayload() *SecretPayload
func (x *AccessSecretVersionResponse) ProtoReflect() protoreflect.Message
func (x *AccessSecretVersionResponse) Reset()
func (x *AccessSecretVersionResponse) String() string
func (*AccessSecretVersionResponse) ProtoMessage()

GetSecretVersionRequest

type GetSecretVersionRequest struct {
    Name string
}

Request message for GetSecretVersion.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/*/versions/* or projects/*/locations/*/secrets/*/versions/*

Methods:

func (x *GetSecretVersionRequest) GetName() string
func (x *GetSecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *GetSecretVersionRequest) Reset()
func (x *GetSecretVersionRequest) String() string
func (*GetSecretVersionRequest) ProtoMessage()

ListSecretVersionsRequest

type ListSecretVersionsRequest struct {
    Parent    string
    PageSize  int32
    PageToken string
    Filter    string
}

Request message for ListSecretVersions.

Fields:

  • Parent - Required. The resource name in format projects/*/secrets/* or projects/*/locations/*/secrets/*
  • PageSize - Optional. Maximum number of results per page (max 25000)
  • PageToken - Optional. Token from a previous request to retrieve the next page
  • Filter - Optional. Filter string for matching secret versions

Methods:

func (x *ListSecretVersionsRequest) GetFilter() string
func (x *ListSecretVersionsRequest) GetPageSize() int32
func (x *ListSecretVersionsRequest) GetPageToken() string
func (x *ListSecretVersionsRequest) GetParent() string
func (x *ListSecretVersionsRequest) ProtoReflect() protoreflect.Message
func (x *ListSecretVersionsRequest) Reset()
func (x *ListSecretVersionsRequest) String() string
func (*ListSecretVersionsRequest) ProtoMessage()

ListSecretVersionsResponse

type ListSecretVersionsResponse struct {
    Versions      []*SecretVersion
    NextPageToken string
    TotalSize     int32
}

Response message for ListSecretVersions.

Fields:

  • Versions - The list of SecretVersions sorted in reverse by create_time
  • NextPageToken - Token to retrieve the next page
  • TotalSize - Total number of SecretVersions (0 when filter is set)

Methods:

func (x *ListSecretVersionsResponse) GetNextPageToken() string
func (x *ListSecretVersionsResponse) GetTotalSize() int32
func (x *ListSecretVersionsResponse) GetVersions() []*SecretVersion
func (x *ListSecretVersionsResponse) ProtoReflect() protoreflect.Message
func (x *ListSecretVersionsResponse) Reset()
func (x *ListSecretVersionsResponse) String() string
func (*ListSecretVersionsResponse) ProtoMessage()

EnableSecretVersionRequest

type EnableSecretVersionRequest struct {
    Name string
    Etag string
}

Request message for EnableSecretVersion.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/*/versions/* or projects/*/locations/*/secrets/*/versions/*
  • Etag - Optional. Etag of the SecretVersion for optimistic concurrency control

Methods:

func (x *EnableSecretVersionRequest) GetEtag() string
func (x *EnableSecretVersionRequest) GetName() string
func (x *EnableSecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *EnableSecretVersionRequest) Reset()
func (x *EnableSecretVersionRequest) String() string
func (*EnableSecretVersionRequest) ProtoMessage()

DisableSecretVersionRequest

type DisableSecretVersionRequest struct {
    Name string
    Etag string
}

Request message for DisableSecretVersion.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/*/versions/* or projects/*/locations/*/secrets/*/versions/*
  • Etag - Optional. Etag of the SecretVersion for optimistic concurrency control

Methods:

func (x *DisableSecretVersionRequest) GetEtag() string
func (x *DisableSecretVersionRequest) GetName() string
func (x *DisableSecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *DisableSecretVersionRequest) Reset()
func (x *DisableSecretVersionRequest) String() string
func (*DisableSecretVersionRequest) ProtoMessage()

DestroySecretVersionRequest

type DestroySecretVersionRequest struct {
    Name string
    Etag string
}

Request message for DestroySecretVersion.

Fields:

  • Name - Required. The resource name in format projects/*/secrets/*/versions/* or projects/*/locations/*/secrets/*/versions/*
  • Etag - Optional. Etag of the SecretVersion for optimistic concurrency control

Methods:

func (x *DestroySecretVersionRequest) GetEtag() string
func (x *DestroySecretVersionRequest) GetName() string
func (x *DestroySecretVersionRequest) ProtoReflect() protoreflect.Message
func (x *DestroySecretVersionRequest) Reset()
func (x *DestroySecretVersionRequest) String() string
func (*DestroySecretVersionRequest) ProtoMessage()

Enumerations

SecretVersion_State

type SecretVersion_State int32

The state of a SecretVersion, indicating if it can be accessed.

Constants:

const (
    SecretVersion_STATE_UNSPECIFIED SecretVersion_State = 0
    SecretVersion_ENABLED           SecretVersion_State = 1
    SecretVersion_DISABLED          SecretVersion_State = 2
    SecretVersion_DESTROYED         SecretVersion_State = 3
)

Constant Descriptions:

  • STATE_UNSPECIFIED - Not specified (unused/invalid)
  • ENABLED - The SecretVersion may be accessed
  • DISABLED - The SecretVersion may not be accessed, but can be re-enabled
  • DESTROYED - The SecretVersion is destroyed and cannot be recovered

Methods:

func (SecretVersion_State) Descriptor() protoreflect.EnumDescriptor
func (x SecretVersion_State) Enum() *SecretVersion_State
func (x SecretVersion_State) Number() protoreflect.EnumNumber
func (x SecretVersion_State) String() string
func (SecretVersion_State) Type() protoreflect.EnumType

Iterator Types

SecretIterator

type SecretIterator struct {
    Response      interface{}
    InternalFetch func(pageSize int, pageToken string) (results []*secretmanagerpb.Secret, nextPageToken string, err error)
}

Manages a stream of Secret resources.

Methods:

func (it *SecretIterator) Next() (*secretmanagerpb.Secret, error)
func (it *SecretIterator) PageInfo() *iterator.PageInfo
func (it *SecretIterator) All() iter.Seq2[*secretmanagerpb.Secret, error]

SecretVersionIterator

type SecretVersionIterator struct {
    Response      interface{}
    InternalFetch func(pageSize int, pageToken string) (results []*secretmanagerpb.SecretVersion, nextPageToken string, err error)
}

Manages a stream of SecretVersion resources.

Methods:

func (it *SecretVersionIterator) Next() (*secretmanagerpb.SecretVersion, error)
func (it *SecretVersionIterator) PageInfo() *iterator.PageInfo
func (it *SecretVersionIterator) All() iter.Seq2[*secretmanagerpb.SecretVersion, error]

LocationIterator

type LocationIterator struct {
    Response      interface{}
    InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
}

Manages a stream of Location resources.

Methods:

func (it *LocationIterator) Next() (*locationpb.Location, error)
func (it *LocationIterator) PageInfo() *iterator.PageInfo
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]

gRPC Service Types

SecretManagerServiceClient

type SecretManagerServiceClient interface {
    ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error)
    CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*Secret, error)
    AddSecretVersion(ctx context.Context, in *AddSecretVersionRequest, opts ...grpc.CallOption) (*SecretVersion, error)
    GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*Secret, error)
    UpdateSecret(ctx context.Context, in *UpdateSecretRequest, opts ...grpc.CallOption) (*Secret, error)
    DeleteSecret(ctx context.Context, in *DeleteSecretRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    ListSecretVersions(ctx context.Context, in *ListSecretVersionsRequest, opts ...grpc.CallOption) (*ListSecretVersionsResponse, error)
    GetSecretVersion(ctx context.Context, in *GetSecretVersionRequest, opts ...grpc.CallOption) (*SecretVersion, error)
    AccessSecretVersion(ctx context.Context, in *AccessSecretVersionRequest, opts ...grpc.CallOption) (*AccessSecretVersionResponse, error)
    DisableSecretVersion(ctx context.Context, in *DisableSecretVersionRequest, opts ...grpc.CallOption) (*SecretVersion, error)
    EnableSecretVersion(ctx context.Context, in *EnableSecretVersionRequest, opts ...grpc.CallOption) (*SecretVersion, error)
    DestroySecretVersion(ctx context.Context, in *DestroySecretVersionRequest, opts ...grpc.CallOption) (*SecretVersion, error)
    SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error)
    GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error)
    TestIamPermissions(ctx context.Context, in *iampb.TestIamPermissionsRequest, opts ...grpc.CallOption) (*iampb.TestIamPermissionsResponse, error)
}

Client API for SecretManagerService service.

Constructor:

func NewSecretManagerServiceClient(cc grpc.ClientConnInterface) SecretManagerServiceClient

SecretManagerServiceServer

type SecretManagerServiceServer interface {
    ListSecrets(context.Context, *ListSecretsRequest) (*ListSecretsResponse, error)
    CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
    AddSecretVersion(context.Context, *AddSecretVersionRequest) (*SecretVersion, error)
    GetSecret(context.Context, *GetSecretRequest) (*Secret, error)
    UpdateSecret(context.Context, *UpdateSecretRequest) (*Secret, error)
    DeleteSecret(context.Context, *DeleteSecretRequest) (*emptypb.Empty, error)
    ListSecretVersions(context.Context, *ListSecretVersionsRequest) (*ListSecretVersionsResponse, error)
    GetSecretVersion(context.Context, *GetSecretVersionRequest) (*SecretVersion, error)
    AccessSecretVersion(context.Context, *AccessSecretVersionRequest) (*AccessSecretVersionResponse, error)
    DisableSecretVersion(context.Context, *DisableSecretVersionRequest) (*SecretVersion, error)
    EnableSecretVersion(context.Context, *EnableSecretVersionRequest) (*SecretVersion, error)
    DestroySecretVersion(context.Context, *DestroySecretVersionRequest) (*SecretVersion, error)
    SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error)
    GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error)
    TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error)
}

Server API for SecretManagerService service.

Registration Function:

func RegisterSecretManagerServiceServer(s grpc.ServiceRegistrar, srv SecretManagerServiceServer)

UnimplementedSecretManagerServiceServer

type UnimplementedSecretManagerServiceServer struct{}

Should be embedded to have forward compatible implementations of the gRPC service interface.

Methods:

func (UnimplementedSecretManagerServiceServer) AccessSecretVersion(context.Context, *AccessSecretVersionRequest) (*AccessSecretVersionResponse, error)
func (UnimplementedSecretManagerServiceServer) AddSecretVersion(context.Context, *AddSecretVersionRequest) (*SecretVersion, error)
func (UnimplementedSecretManagerServiceServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
func (UnimplementedSecretManagerServiceServer) DeleteSecret(context.Context, *DeleteSecretRequest) (*emptypb.Empty, error)
func (UnimplementedSecretManagerServiceServer) DestroySecretVersion(context.Context, *DestroySecretVersionRequest) (*SecretVersion, error)
func (UnimplementedSecretManagerServiceServer) DisableSecretVersion(context.Context, *DisableSecretVersionRequest) (*SecretVersion, error)
func (UnimplementedSecretManagerServiceServer) EnableSecretVersion(context.Context, *EnableSecretVersionRequest) (*SecretVersion, error)
func (UnimplementedSecretManagerServiceServer) GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error)
func (UnimplementedSecretManagerServiceServer) GetSecret(context.Context, *GetSecretRequest) (*Secret, error)
func (UnimplementedSecretManagerServiceServer) GetSecretVersion(context.Context, *GetSecretVersionRequest) (*SecretVersion, error)
func (UnimplementedSecretManagerServiceServer) ListSecretVersions(context.Context, *ListSecretVersionsRequest) (*ListSecretVersionsResponse, error)
func (UnimplementedSecretManagerServiceServer) ListSecrets(context.Context, *ListSecretsRequest) (*ListSecretsResponse, error)
func (UnimplementedSecretManagerServiceServer) SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error)
func (UnimplementedSecretManagerServiceServer) TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error)
func (UnimplementedSecretManagerServiceServer) UpdateSecret(context.Context, *UpdateSecretRequest) (*Secret, error)

Constants

Full Method Names

const (
    SecretManagerService_ListSecrets_FullMethodName          = "/google.cloud.secretmanager.v1.SecretManagerService/ListSecrets"
    SecretManagerService_CreateSecret_FullMethodName         = "/google.cloud.secretmanager.v1.SecretManagerService/CreateSecret"
    SecretManagerService_AddSecretVersion_FullMethodName     = "/google.cloud.secretmanager.v1.SecretManagerService/AddSecretVersion"
    SecretManagerService_GetSecret_FullMethodName            = "/google.cloud.secretmanager.v1.SecretManagerService/GetSecret"
    SecretManagerService_UpdateSecret_FullMethodName         = "/google.cloud.secretmanager.v1.SecretManagerService/UpdateSecret"
    SecretManagerService_DeleteSecret_FullMethodName         = "/google.cloud.secretmanager.v1.SecretManagerService/DeleteSecret"
    SecretManagerService_ListSecretVersions_FullMethodName   = "/google.cloud.secretmanager.v1.SecretManagerService/ListSecretVersions"
    SecretManagerService_GetSecretVersion_FullMethodName     = "/google.cloud.secretmanager.v1.SecretManagerService/GetSecretVersion"
    SecretManagerService_AccessSecretVersion_FullMethodName  = "/google.cloud.secretmanager.v1.SecretManagerService/AccessSecretVersion"
    SecretManagerService_DisableSecretVersion_FullMethodName = "/google.cloud.secretmanager.v1.SecretManagerService/DisableSecretVersion"
    SecretManagerService_EnableSecretVersion_FullMethodName  = "/google.cloud.secretmanager.v1.SecretManagerService/EnableSecretVersion"
    SecretManagerService_DestroySecretVersion_FullMethodName = "/google.cloud.secretmanager.v1.SecretManagerService/DestroySecretVersion"
    SecretManagerService_SetIamPolicy_FullMethodName         = "/google.cloud.secretmanager.v1.SecretManagerService/SetIamPolicy"
    SecretManagerService_GetIamPolicy_FullMethodName         = "/google.cloud.secretmanager.v1.SecretManagerService/GetIamPolicy"
    SecretManagerService_TestIamPermissions_FullMethodName   = "/google.cloud.secretmanager.v1.SecretManagerService/TestIamPermissions"
)

These constants represent the full gRPC method names for the Secret Manager service.

Variables

Enum Value Maps

var (
    SecretVersion_State_name = map[int32]string{
        0: "STATE_UNSPECIFIED",
        1: "ENABLED",
        2: "DISABLED",
        3: "DESTROYED",
    }
    SecretVersion_State_value = map[string]int32{
        "STATE_UNSPECIFIED": 0,
        "ENABLED":           1,
        "DISABLED":          2,
        "DESTROYED":         3,
    }
)

Maps for converting between SecretVersion_State enum values and their string representations.