Class: Google::Apis::SecretmanagerV1beta2::SecretManagerService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/secretmanager_v1beta2/service.rb

Overview

Secret Manager API

Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security.

Examples:

require 'google/apis/secretmanager_v1beta2'

Secretmanager = Google::Apis::SecretmanagerV1beta2 # Alias the module
service = Secretmanager::SecretManagerService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://secretmanager.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSecretManagerService

Returns a new instance of SecretManagerService.



48
49
50
51
52
53
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-secretmanager_v1beta2',
        client_version: Google::Apis::SecretmanagerV1beta2::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#access_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse

Accesses a SecretVersion. This call returns the secret data. projects/*/ secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



497
498
499
500
501
502
503
504
505
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 497

def access_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}:access', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#access_project_secret_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse

Accesses a SecretVersion. This call returns the secret data. projects/*/ secrets/*/versions/latest is an alias to the most recently created SecretVersion.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1063
1064
1065
1066
1067
1068
1069
1070
1071
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1063

def access_project_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}:access', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::AccessSecretVersionResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#add_project_location_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

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

Parameters:

  • parent (String)

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

  • add_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



151
152
153
154
155
156
157
158
159
160
161
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 151

def add_project_location_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+parent}:addVersion', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest::Representation
  command.request_object = add_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#add_project_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

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

Parameters:

  • parent (String)

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

  • add_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



717
718
719
720
721
722
723
724
725
726
727
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 717

def add_project_secret_version(parent, add_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+parent}:addVersion', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::AddSecretVersionRequest::Representation
  command.request_object = add_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_location_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Creates a new Secret containing no SecretVersions.

Parameters:

  • parent (String)

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

  • secret_object (Google::Apis::SecretmanagerV1beta2::Secret) (defaults to: nil)
  • secret_id (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 189

def create_project_location_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+parent}/secrets', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.request_object = secret_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['parent'] = parent unless parent.nil?
  command.query['secretId'] = secret_id unless secret_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Creates a new Secret containing no SecretVersions.

Parameters:

  • parent (String)

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

  • secret_object (Google::Apis::SecretmanagerV1beta2::Secret) (defaults to: nil)
  • secret_id (String) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



755
756
757
758
759
760
761
762
763
764
765
766
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 755

def create_project_secret(parent, secret_object = nil, secret_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+parent}/secrets', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.request_object = secret_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['parent'] = parent unless parent.nil?
  command.query['secretId'] = secret_id unless secret_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_location_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Empty

Deletes a Secret.

Parameters:

  • name (String)

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

  • etag (String) (defaults to: nil)

    Optional. Etag of the Secret. The request succeeds if it matches the etag of the currently stored secret object. If the etag is omitted, the request succeeds.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



227
228
229
230
231
232
233
234
235
236
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 227

def delete_project_location_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Empty::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Empty
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Empty

Deletes a Secret.

Parameters:

  • name (String)

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

  • etag (String) (defaults to: nil)

    Optional. Etag of the Secret. The request succeeds if it matches the etag of the currently stored secret object. If the etag is omitted, the request succeeds.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



793
794
795
796
797
798
799
800
801
802
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 793

def delete_project_secret(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Empty::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Empty
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#destroy_project_location_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.

Parameters:

  • name (String)

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

  • destroy_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



531
532
533
534
535
536
537
538
539
540
541
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 531

def destroy_project_location_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:destroy', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest::Representation
  command.request_object = destroy_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#destroy_project_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.

Parameters:

  • name (String)

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

  • destroy_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1097

def destroy_project_secret_version(name, destroy_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:destroy', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::DestroySecretVersionRequest::Representation
  command.request_object = destroy_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#disable_project_location_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED.

Parameters:

  • name (String)

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

  • disable_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



566
567
568
569
570
571
572
573
574
575
576
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 566

def disable_project_location_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:disable', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest::Representation
  command.request_object = disable_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#disable_project_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED.

Parameters:

  • name (String)

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

  • disable_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1132

def disable_project_secret_version(name, disable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:disable', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::DisableSecretVersionRequest::Representation
  command.request_object = disable_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#enable_project_location_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED.

Parameters:

  • name (String)

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

  • enable_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



601
602
603
604
605
606
607
608
609
610
611
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 601

def enable_project_location_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:enable', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest::Representation
  command.request_object = enable_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#enable_project_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED.

Parameters:

  • name (String)

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

  • enable_secret_version_request_object (Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1167

def enable_project_secret_version(name, enable_secret_version_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+name}:enable', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::EnableSecretVersionRequest::Representation
  command.request_object = enable_secret_version_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Location

Gets information about a location.

Parameters:

  • name (String)

    Resource name for the location.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



75
76
77
78
79
80
81
82
83
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 75

def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Location::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Location
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_secret(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Gets metadata for a given Secret.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



259
260
261
262
263
264
265
266
267
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 259

def get_project_location_secret(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Policy

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.

Parameters:

  • resource (String)

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

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the IAM documentation.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



303
304
305
306
307
308
309
310
311
312
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 303

def get_project_location_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

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

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



637
638
639
640
641
642
643
644
645
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 637

def get_project_location_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_secret(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Gets metadata for a given Secret.

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



825
826
827
828
829
830
831
832
833
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 825

def get_project_secret(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Policy

Gets the access control policy for a secret. Returns empty policy if the secret exists and does not have a policy set.

Parameters:

  • resource (String)

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

  • options_requested_policy_version (Fixnum) (defaults to: nil)

    Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the IAM documentation.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



869
870
871
872
873
874
875
876
877
878
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 869

def get_project_secret_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+resource}:getIamPolicy', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_secret_version(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::SecretVersion

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

Parameters:

  • name (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1203

def get_project_secret_version(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::SecretVersion::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::SecretVersion
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse

Lists SecretVersions. This call does not return secret data.

Parameters:

  • parent (String)

    Required. The resource name of the Secret associated with the SecretVersions to list, in the format projects/*/secrets/* or projects/*/locations/*/ secrets/*.

  • filter (String) (defaults to: nil)

    Optional. Filter string, adhering to the rules in List-operation filtering. List only secret versions matching the filter. If filter is empty, all secret versions are listed.

  • page_size (Fixnum) (defaults to: nil)

    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 (String) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 681

def list_project_location_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+parent}/versions', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::ListSecretsResponse

Lists Secrets.

Parameters:

  • parent (String)

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

  • filter (String) (defaults to: nil)

    Optional. Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.

  • page_size (Fixnum) (defaults to: nil)

    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 (String) (defaults to: nil)

    Optional. Pagination token, returned earlier via ListSecretsResponse. next_page_token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 346

def list_project_location_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+parent}/secrets', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::ListLocationsResponse

Lists information about the supported locations for this service.

Parameters:

  • name (String)

    The resource that owns the locations collection, if applicable.

  • filter (String) (defaults to: nil)

    A filter to narrow down results to a preferred subset. The filtering language accepts strings like "displayName=tokyo", and is documented in more detail in AIP-160.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of results to return. If not set, the service selects a default.

  • page_token (String) (defaults to: nil)

    A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 115

def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+name}/locations', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::ListLocationsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::ListLocationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse

Lists SecretVersions. This call does not return secret data.

Parameters:

  • parent (String)

    Required. The resource name of the Secret associated with the SecretVersions to list, in the format projects/*/secrets/* or projects/*/locations/*/ secrets/*.

  • filter (String) (defaults to: nil)

    Optional. Filter string, adhering to the rules in List-operation filtering. List only secret versions matching the filter. If filter is empty, all secret versions are listed.

  • page_size (Fixnum) (defaults to: nil)

    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 (String) (defaults to: nil)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1247

def list_project_secret_versions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+parent}/versions', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretVersionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::ListSecretsResponse

Lists Secrets.

Parameters:

  • parent (String)

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

  • filter (String) (defaults to: nil)

    Optional. Filter string, adhering to the rules in List-operation filtering. List only secrets matching the filter. If filter is empty, all secrets are listed.

  • page_size (Fixnum) (defaults to: nil)

    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 (String) (defaults to: nil)

    Optional. Pagination token, returned earlier via ListSecretsResponse. next_page_token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 912

def list_project_secrets(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta2/{+parent}/secrets', options)
  command.response_representation = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::ListSecretsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_location_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Updates metadata of an existing Secret.

Parameters:

  • name (String)

    Output only. The resource name of the Secret in the format projects/*/secrets/ *.

  • secret_object (Google::Apis::SecretmanagerV1beta2::Secret) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. Specifies the fields to be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 383

def patch_project_location_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1beta2/{+name}', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.request_object = secret_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Secret

Updates metadata of an existing Secret.

Parameters:

  • name (String)

    Output only. The resource name of the Secret in the format projects/*/secrets/ *.

  • secret_object (Google::Apis::SecretmanagerV1beta2::Secret) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. Specifies the fields to be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



949
950
951
952
953
954
955
956
957
958
959
960
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 949

def patch_project_secret(name, secret_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1beta2/{+name}', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.request_object = secret_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Secret::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Secret
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_project_location_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Policy

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:

  • resource (String)

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

  • set_iam_policy_request_object (Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



421
422
423
424
425
426
427
428
429
430
431
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 421

def set_project_location_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_project_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::Policy

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:

  • resource (String)

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

  • set_iam_policy_request_object (Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



987
988
989
990
991
992
993
994
995
996
997
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 987

def set_project_secret_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+resource}:setIamPolicy', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::SetIamPolicyRequest::Representation
  command.request_object = set_iam_policy_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::Policy::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::Policy
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_project_location_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse

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:

  • resource (String)

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

  • test_iam_permissions_request_object (Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



460
461
462
463
464
465
466
467
468
469
470
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 460

def test_project_location_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#test_project_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse

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:

  • resource (String)

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

  • test_iam_permissions_request_object (Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
# File 'lib/google/apis/secretmanager_v1beta2/service.rb', line 1026

def test_project_secret_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta2/{+resource}:testIamPermissions', options)
  command.request_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsRequest::Representation
  command.request_object = test_iam_permissions_request_object
  command.response_representation = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse::Representation
  command.response_class = Google::Apis::SecretmanagerV1beta2::TestIamPermissionsResponse
  command.params['resource'] = resource unless resource.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end