Class: Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb

Overview

REST client for the ArtifactRegistry service.

The Artifact Registry API service.

Artifact Registry is an artifact management system for storing artifacts from different package management systems.

The resources managed by this API are:

  • Repositories, which group packages and their data.
  • Packages, which group versions and their tags.
  • Versions, which are specific forms of a package.
  • Tags, which represent alternative names for versions.
  • Files, which contain content and are optionally associated with a Package or Version.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#attachment_path, #docker_image_path, #file_path, #location_path, #maven_artifact_path, #npm_package_path, #package_path, #project_settings_path, #python_package_path, #repository_path, #rule_path, #secret_version_path, #tag_path, #version_path, #vpcsc_config_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ArtifactRegistry REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the ArtifactRegistry client.

Yield Parameters:



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 141

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @artifact_registry_stub = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @artifact_registry_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @artifact_registry_stub.endpoint
    config.universe_domain = @artifact_registry_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @artifact_registry_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


211
212
213
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 211

def location_client
  @location_client
end

#operations_client::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Operations (readonly)

Get the associated client for long-running operations.



204
205
206
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 204

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ArtifactRegistry Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ArtifactRegistry clients
::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 77

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ArtifactRegistry", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#batch_delete_versions(request, options = nil) ⇒ ::Gapic::Operation #batch_delete_versions(parent: nil, names: nil, validate_only: nil) ⇒ ::Gapic::Operation

Deletes multiple versions across a repository. The returned operation will complete once the versions have been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest.new

# Call the batch_delete_versions method.
result = client.batch_delete_versions request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #batch_delete_versions(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to batch_delete_versions via a request object, either of type BatchDeleteVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #batch_delete_versions(parent: nil, names: nil, validate_only: nil) ⇒ ::Gapic::Operation

    Pass arguments to batch_delete_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the repository holding all requested versions.

    • names (::Array<::String>) (defaults to: nil)

      Required. The names of the versions to delete. The maximum number of versions deleted per batch is determined by the service and is dependent on the available resources in the region.

    • validate_only (::Boolean) (defaults to: nil)

      If true, the request is performed without deleting data, following AIP-163.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2199

def batch_delete_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::BatchDeleteVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.batch_delete_versions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.batch_delete_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.batch_delete_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.batch_delete_versions request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the ArtifactRegistry Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



111
112
113
114
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 111

def configure
  yield @config if block_given?
  @config
end

#create_attachment(request, options = nil) ⇒ ::Gapic::Operation #create_attachment(parent: nil, attachment_id: nil, attachment: nil) ⇒ ::Gapic::Operation

Creates an attachment. The returned Operation will finish once the attachment has been created. Its response will be the created attachment.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateAttachmentRequest.new

# Call the create_attachment method.
result = client.create_attachment request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_attachment(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_attachment via a request object, either of type CreateAttachmentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateAttachmentRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_attachment(parent: nil, attachment_id: nil, attachment: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_attachment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource where the attachment will be created.

    • attachment_id (::String) (defaults to: nil)

      Required. The attachment id to use for this attachment.

    • attachment (::Google::Cloud::ArtifactRegistry::V1::Attachment, ::Hash) (defaults to: nil)

      Required. The attachment to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4440

def create_attachment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateAttachmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_attachment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_attachment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_attachment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.create_attachment request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_repository(request, options = nil) ⇒ ::Gapic::Operation #create_repository(parent: nil, repository_id: nil, repository: nil) ⇒ ::Gapic::Operation

Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new

# Call the create_repository method.
result = client.create_repository request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_repository(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_repository via a request object, either of type CreateRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_repository(parent: nil, repository_id: nil, repository: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource where the repository will be created.

    • repository_id (::String) (defaults to: nil)

      Required. The repository id to use for this repository.

    • repository (::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash) (defaults to: nil)

      Required. The repository to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1323

def create_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_repository..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.create_repository request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_rule(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule #create_rule(parent: nil, rule_id: nil, rule: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

Creates a rule.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateRuleRequest.new

# Call the create_rule method.
result = client.create_rule request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Rule.
p result

Overloads:

  • #create_rule(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

    Pass arguments to create_rule via a request object, either of type CreateRuleRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateRuleRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_rule(parent: nil, rule_id: nil, rule: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

    Pass arguments to create_rule via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource where the rule will be created.

    • rule_id (::String) (defaults to: nil)

      The rule id to use for this repository.

    • rule (::Google::Cloud::ArtifactRegistry::V1::Rule, ::Hash) (defaults to: nil)

      The rule to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3194

def create_rule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateRuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_rule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_rule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_rule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.create_rule request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #create_tag(parent: nil, tag_id: nil, tag: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Creates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new

# Call the create_tag method.
result = client.create_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

  • #create_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to create_tag via a request object, either of type CreateTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_tag(parent: nil, tag_id: nil, tag: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to create_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent resource where the tag will be created.

    • tag_id (::String) (defaults to: nil)

      The tag id to use for this repository.

    • tag (::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash) (defaults to: nil)

      The tag to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2952

def create_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_tag..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.create_tag request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_attachment(request, options = nil) ⇒ ::Gapic::Operation #delete_attachment(name: nil) ⇒ ::Gapic::Operation

Deletes an attachment. The returned Operation will finish once the attachments has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteAttachmentRequest.new

# Call the delete_attachment method.
result = client.delete_attachment request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_attachment(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_attachment via a request object, either of type DeleteAttachmentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteAttachmentRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_attachment(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_attachment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the attachment to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4529

def delete_attachment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteAttachmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_attachment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_attachment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_attachment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_attachment request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_file(request, options = nil) ⇒ ::Gapic::Operation #delete_file(name: nil) ⇒ ::Gapic::Operation

Deletes a file and all of its content. It is only allowed on generic repositories. The returned operation will complete once the file has been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteFileRequest.new

# Call the delete_file method.
result = client.delete_file request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_file(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_file via a request object, either of type DeleteFileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteFileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_file(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_file via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the file to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2590

def delete_file request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteFileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_file..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_file.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_file.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_file request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_package(request, options = nil) ⇒ ::Gapic::Operation #delete_package(name: nil) ⇒ ::Gapic::Operation

Deletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new

# Call the delete_package method.
result = client.delete_package request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_package(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_package via a request object, either of type DeletePackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_package(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the package to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1796

def delete_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_package..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_package request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_repository(request, options = nil) ⇒ ::Gapic::Operation #delete_repository(name: nil) ⇒ ::Gapic::Operation

Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new

# Call the delete_repository method.
result = client.delete_repository request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_repository(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_repository via a request object, either of type DeleteRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_repository(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the repository to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1494

def delete_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_repository..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_repository request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_rule(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_rule(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a rule.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteRuleRequest.new

# Call the delete_rule method.
result = client.delete_rule request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_rule(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_rule via a request object, either of type DeleteRuleRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteRuleRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_rule(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_rule via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the rule to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3522

def delete_rule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteRuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_rule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_rule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_rule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_rule request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new

# Call the delete_tag method.
result = client.delete_tag request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_tag(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag via a request object, either of type DeleteTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_tag(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the tag to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3112

def delete_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_tag..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_tag request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_version(request, options = nil) ⇒ ::Gapic::Operation #delete_version(name: nil, force: nil) ⇒ ::Gapic::Operation

Deletes a version and all of its content. The returned operation will complete once the version has been deleted.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new

# Call the delete_version method.
result = client.delete_version request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_version(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_version via a request object, either of type DeleteVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_version(name: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the version to delete.

    • force (::Boolean) (defaults to: nil)

      By default, a version that is tagged may not be deleted. If force=true, the version and any tags pointing to the version are deleted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2105

def delete_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.delete_version request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_artifact(request, options = nil) ⇒ ::Gapic::Operation #export_artifact(source_version: nil, source_tag: nil, gcs_path: nil, repository: nil) ⇒ ::Gapic::Operation

Exports an artifact.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ExportArtifactRequest.new

# Call the export_artifact method.
result = client.export_artifact request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #export_artifact(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to export_artifact via a request object, either of type ExportArtifactRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ExportArtifactRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #export_artifact(source_version: nil, source_tag: nil, gcs_path: nil, repository: nil) ⇒ ::Gapic::Operation

    Pass arguments to export_artifact via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • source_version (::String) (defaults to: nil)

      The artifact version to export. Format: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}

      Note: The following parameters are mutually exclusive: source_version, source_tag. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • source_tag (::String) (defaults to: nil)

      The artifact tag to export. Format:projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}

      Note: The following parameters are mutually exclusive: source_tag, source_version. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • gcs_path (::String) (defaults to: nil)

      The Cloud Storage path to export the artifact to. Should start with the bucket name, and optionally have a directory path. Examples: dst_bucket, dst_bucket/sub_dir. Existing objects with the same path will be overwritten.

    • repository (::String) (defaults to: nil)

      Required. The repository of the artifact to export. Format: projects/{project}/locations/{location}/repositories/{repository}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4633

def export_artifact request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ExportArtifactRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.export_artifact..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.export_artifact.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.export_artifact.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.export_artifact request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_attachment(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Attachment #get_attachment(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Attachment

Gets an attachment.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetAttachmentRequest.new

# Call the get_attachment method.
result = client.get_attachment request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Attachment.
p result

Overloads:

  • #get_attachment(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Attachment

    Pass arguments to get_attachment via a request object, either of type GetAttachmentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetAttachmentRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_attachment(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Attachment

    Pass arguments to get_attachment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the attachment to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4349

def get_attachment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetAttachmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_attachment..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_attachment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_attachment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_attachment request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_docker_image(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage #get_docker_image(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

Gets a docker image.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new

# Call the get_docker_image method.
result = client.get_docker_image request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage.
p result

Overloads:

  • #get_docker_image(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

    Pass arguments to get_docker_image via a request object, either of type GetDockerImageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_docker_image(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::DockerImage

    Pass arguments to get_docker_image via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the docker images.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 358

def get_docker_image request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_docker_image..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_docker_image.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_docker_image.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_docker_image request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File #get_file(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

Gets a file.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new

# Call the get_file method.
result = client.get_file request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::File.
p result

Overloads:

  • #get_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

    Pass arguments to get_file via a request object, either of type GetFileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetFileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_file(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

    Pass arguments to get_file via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the file to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2503

def get_file request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetFileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_file..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_file.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_file.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_file request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

Gets the IAM policy for a given resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

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

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3694

def get_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_maven_artifact(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact #get_maven_artifact(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

Gets a maven artifact.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest.new

# Call the get_maven_artifact method.
result = client.get_maven_artifact request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::MavenArtifact.
p result

Overloads:

  • #get_maven_artifact(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

    Pass arguments to get_maven_artifact via a request object, either of type GetMavenArtifactRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_maven_artifact(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact

    Pass arguments to get_maven_artifact via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the maven artifact.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 525

def get_maven_artifact request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetMavenArtifactRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_maven_artifact..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_maven_artifact.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_maven_artifact.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_maven_artifact request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_npm_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage #get_npm_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

Gets a npm package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest.new

# Call the get_npm_package method.
result = client.get_npm_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::NpmPackage.
p result

Overloads:

  • #get_npm_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

    Pass arguments to get_npm_package via a request object, either of type GetNpmPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_npm_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::NpmPackage

    Pass arguments to get_npm_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the npm package.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 692

def get_npm_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetNpmPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_npm_package..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_npm_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_npm_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_npm_package request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package #get_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

Gets a package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new

# Call the get_package method.
result = client.get_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package.
p result

Overloads:

  • #get_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

    Pass arguments to get_package via a request object, either of type GetPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

    Pass arguments to get_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the package to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1710

def get_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_package..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_package request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings #get_project_settings(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

Retrieves the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new

# Call the get_project_settings method.
result = client.get_project_settings request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
p result

Overloads:

  • #get_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

    Pass arguments to get_project_settings via a request object, either of type GetProjectSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_project_settings(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

    Pass arguments to get_project_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the projectSettings resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3856

def get_project_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_project_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_project_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_project_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_project_settings request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_python_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage #get_python_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

Gets a python package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest.new

# Call the get_python_package method.
result = client.get_python_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::PythonPackage.
p result

Overloads:

  • #get_python_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

    Pass arguments to get_python_package via a request object, either of type GetPythonPackageRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_python_package(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::PythonPackage

    Pass arguments to get_python_package via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the python package.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 859

def get_python_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPythonPackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_python_package..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_python_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_python_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_python_package request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository #get_repository(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

Gets a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new

# Call the get_repository method.
result = client.get_repository request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
p result

Overloads:

  • #get_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

    Pass arguments to get_repository via a request object, either of type GetRepositoryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_repository(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

    Pass arguments to get_repository via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the repository to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1232

def get_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_repository..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_repository request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_rule(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule #get_rule(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

Gets a rule.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetRuleRequest.new

# Call the get_rule method.
result = client.get_rule request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Rule.
p result

Overloads:

  • #get_rule(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

    Pass arguments to get_rule via a request object, either of type GetRuleRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetRuleRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_rule(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

    Pass arguments to get_rule via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the rule to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3362

def get_rule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_rule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_rule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_rule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_rule request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #get_tag(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Gets a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new

# Call the get_tag method.
result = client.get_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

  • #get_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to get_tag via a request object, either of type GetTagRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetTagRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_tag(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

    Pass arguments to get_tag via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The name of the tag to retrieve.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2870

def get_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_tag..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_tag request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_version(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version #get_version(name: nil, view: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

Gets a version

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new

# Call the get_version method.
result = client.get_version request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version.
p result

Overloads:

  • #get_version(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

    Pass arguments to get_version via a request object, either of type GetVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_version(name: nil, view: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

    Pass arguments to get_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2016

def get_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig #get_vpcsc_config(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

Retrieves the VPCSC Config for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest.new

# Call the get_vpcsc_config method.
result = client.get_vpcsc_config request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::VPCSCConfig.
p result

Overloads:

  • #get_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

    Pass arguments to get_vpcsc_config via a request object, either of type GetVPCSCConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_vpcsc_config(name: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

    Pass arguments to get_vpcsc_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the VPCSCConfig resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4014

def get_vpcsc_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVPCSCConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_vpcsc_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_vpcsc_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_vpcsc_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.get_vpcsc_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_apt_artifacts(request, options = nil) ⇒ ::Gapic::Operation #import_apt_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

Imports Apt artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new

# Call the import_apt_artifacts method.
result = client.import_apt_artifacts request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_apt_artifacts(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_apt_artifacts via a request object, either of type ImportAptArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #import_apt_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_apt_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 949

def import_apt_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_apt_artifacts..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.import_apt_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_apt_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.import_apt_artifacts request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_yum_artifacts(request, options = nil) ⇒ ::Gapic::Operation #import_yum_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

Imports Yum (RPM) artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new

# Call the import_yum_artifacts method.
result = client.import_yum_artifacts request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #import_yum_artifacts(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_yum_artifacts via a request object, either of type ImportYumArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #import_yum_artifacts(gcs_source: nil, parent: nil) ⇒ ::Gapic::Operation

    Pass arguments to import_yum_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1041

def import_yum_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_yum_artifacts..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.import_yum_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_yum_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.import_yum_artifacts request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_attachments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Attachment> #list_attachments(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Attachment>

Lists attachments.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListAttachmentsRequest.new

# Call the list_attachments method.
result = client.list_attachments request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Attachment.
  p item
end

Overloads:

  • #list_attachments(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Attachment>

    Pass arguments to list_attachments via a request object, either of type ListAttachmentsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListAttachmentsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_attachments(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Attachment>

    Pass arguments to list_attachments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose attachments will be listed.

    • filter (::String) (defaults to: nil)

      Optional. An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • target
      • type
      • attachment_namespace
    • page_size (::Integer) (defaults to: nil)

      The maximum number of attachments to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4269

def list_attachments request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListAttachmentsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_attachments..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_attachments.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_attachments.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_attachments request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_attachments, "attachments", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_docker_images(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage> #list_docker_images(parent: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

Lists docker images.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new

# Call the list_docker_images method.
result = client.list_docker_images request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage.
  p item
end

Overloads:

  • #list_docker_images(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

    Pass arguments to list_docker_images via a request object, either of type ListDockerImagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_docker_images(parent: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>

    Pass arguments to list_docker_images via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose docker images will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • order_by (::String) (defaults to: nil)

      The field to order the results by.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 278

def list_docker_images request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_docker_images..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_docker_images.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_docker_images.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_docker_images request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, "docker_images", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_files(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File> #list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

Lists files.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new

# Call the list_files method.
result = client.list_files request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File.
  p item
end

Overloads:

  • #list_files(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

    Pass arguments to list_files via a request object, either of type ListFilesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>

    Pass arguments to list_files via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the repository whose files will be listed. For example: "projects/p1/locations/us-central1/repositories/repo1

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name
      • owner
      • annotations

      Examples of using a filter:

      To filter the results of your request to files with the name my_file.txt in project my-project in the us-central region, in repository my-repo, append the following filter expression to your request:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"

      You can also use wildcards to match any number of characters before or after the value:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"

      To filter the results of your request to files owned by the version 1.0 in package pkg1, append the following filter expression to your request:

      • owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"

      To filter the results of your request to files with the annotation key-value pair [external_link: external_link_value], append the following filter expression to your request:

      • "annotations.external_link:external_link_value"

      To filter just for a specific annotation key external_link, append the following filter expression to your request:

      • "annotations.external_link"

      If the annotation key or value contains special characters, you can escape them by surrounding the value with backticks. For example, to filter the results of your request to files with the annotation key-value pair [external.link:https://example.com/my-file], append the following filter expression to your request:

      • "annotations.`external.link`:`https://example.com/my-file`"

      You can also filter with annotations with a wildcard to match any number of characters before or after the value:

      • "annotations.*_link:`*example.com*`"
    • page_size (::Integer) (defaults to: nil)

      The maximum number of files to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • order_by (::String) (defaults to: nil)

      The field to order the results by.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2423

def list_files request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_files..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_files.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_files.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_files request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_files, "files", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_maven_artifacts(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact> #list_maven_artifacts(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

Lists maven artifacts.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest.new

# Call the list_maven_artifacts method.
result = client.list_maven_artifacts request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::MavenArtifact.
  p item
end

Overloads:

  • #list_maven_artifacts(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

    Pass arguments to list_maven_artifacts via a request object, either of type ListMavenArtifactsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_maven_artifacts(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::MavenArtifact>

    Pass arguments to list_maven_artifacts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose maven artifacts will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 445

def list_maven_artifacts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListMavenArtifactsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_maven_artifacts..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_maven_artifacts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_maven_artifacts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_maven_artifacts request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_maven_artifacts, "maven_artifacts", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_npm_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage> #list_npm_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

Lists npm packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest.new

# Call the list_npm_packages method.
result = client.list_npm_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::NpmPackage.
  p item
end

Overloads:

  • #list_npm_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

    Pass arguments to list_npm_packages via a request object, either of type ListNpmPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_npm_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::NpmPackage>

    Pass arguments to list_npm_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose npm packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 612

def list_npm_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListNpmPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_npm_packages..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_npm_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_npm_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_npm_packages request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_npm_packages, "npm_packages", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package> #list_packages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

Lists packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new

# Call the list_packages method.
result = client.list_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package.
  p item
end

Overloads:

  • #list_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

    Pass arguments to list_packages via a request object, either of type ListPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_packages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>

    Pass arguments to list_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of packages to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • filter (::String) (defaults to: nil)

      Optional. An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name
      • annotations

      Examples of using a filter:

      To filter the results of your request to packages with the name my-package in project my-project in the us-central region, in repository my-repo, append the following filter expression to your request:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"

      You can also use wildcards to match any number of characters before or after the value:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"

      To filter the results of your request to packages with the annotation key-value pair [external_link: external_link_value], append the following filter expression to your request":

      • "annotations.external_link:external_link_value"

      To filter the results just for a specific annotation key external_link, append the following filter expression to your request:

      • "annotations.external_link"

      If the annotation key or value contains special characters, you can escape them by surrounding the value with backticks. For example, to filter the results of your request to packages with the annotation key-value pair [external.link:https://example.com/my-package], append the following filter expression to your request:

      • "annotations.`external.link`:`https://example.com/my-package`"

      You can also filter with annotations with a wildcard to match any number of characters before or after the value:

      • "annotations.*_link:`*example.com*`"
    • order_by (::String) (defaults to: nil)

      Optional. The field to order the results by.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1630

def list_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_packages..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_packages request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_packages, "packages", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_python_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage> #list_python_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

Lists python packages.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest.new

# Call the list_python_packages method.
result = client.list_python_packages request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::PythonPackage.
  p item
end

Overloads:

  • #list_python_packages(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

    Pass arguments to list_python_packages via a request object, either of type ListPythonPackagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_python_packages(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::PythonPackage>

    Pass arguments to list_python_packages via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose python packages will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of artifacts to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 779

def list_python_packages request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPythonPackagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_python_packages..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_python_packages.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_python_packages.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_python_packages request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_python_packages, "python_packages", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_repositories(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository> #list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

Lists repositories.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new

# Call the list_repositories method.
result = client.list_repositories request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository.
  p item
end

Overloads:

  • #list_repositories(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

    Pass arguments to list_repositories via a request object, either of type ListRepositoriesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_repositories(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>

    Pass arguments to list_repositories via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource whose repositories will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of repositories to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • filter (::String) (defaults to: nil)

      Optional. An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name

      Examples of using a filter:

      To filter the results of your request to repositories with the name my-repo in project my-project in the us-central region, append the following filter expression to your request:

      • name="projects/my-project/locations/us-central1/repositories/my-repo"

      You can also use wildcards to match any number of characters before or after the value:

      • name="projects/my-project/locations/us-central1/repositories/my-*"
      • name="projects/my-project/locations/us-central1/repositories/*repo"
      • name="projects/my-project/locations/us-central1/repositories/*repo*"
    • order_by (::String) (defaults to: nil)

      Optional. The field to order the results by.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1152

def list_repositories request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_repositories..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_repositories.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_repositories.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_repositories request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_repositories, "repositories", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_rules(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Rule> #list_rules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Rule>

Lists rules.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListRulesRequest.new

# Call the list_rules method.
result = client.list_rules request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Rule.
  p item
end

Overloads:

  • #list_rules(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Rule>

    Pass arguments to list_rules via a request object, either of type ListRulesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListRulesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_rules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Rule>

    Pass arguments to list_rules via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent repository whose rules will be listed. For example: projects/p1/locations/us-central1/repositories/repo1.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of rules to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3282

def list_rules request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRulesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_rules..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_rules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_rules.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_rules request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_rules, "rules", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_tags(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag> #list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

Lists tags.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new

# Call the list_tags method.
result = client.list_tags request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag.
  p item
end

Overloads:

  • #list_tags(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

    Pass arguments to list_tags via a request object, either of type ListTagsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>

    Pass arguments to list_tags via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent package whose tags will be listed. For example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1.

    • filter (::String) (defaults to: nil)

      An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name
      • version

      Examples of using a filter:

      To filter the results of your request to tags with the name my-tag in package my-package in repository my-repo in project "y-project in the us-central region, append the following filter expression to your request:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"

      You can also use wildcards to match any number of characters before or after the value:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"

      To filter the results of your request to tags applied to the version 1.0 in package my-package, append the following filter expression to your request:

      • version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"
    • page_size (::Integer) (defaults to: nil)

      The maximum number of tags to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2790

def list_tags request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_tags..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_tags.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_tags.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_tags request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_tags, "tags", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_versions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version> #list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

Lists versions.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new

# Call the list_versions method.
result = client.list_versions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version.
  p item
end

Overloads:

  • #list_versions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

    Pass arguments to list_versions via a request object, either of type ListVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>

    Pass arguments to list_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      The name of the parent resource whose versions will be listed.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of versions to return. Maximum page size is 1,000.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous list request, if any.

    • view (::Google::Cloud::ArtifactRegistry::V1::VersionView) (defaults to: nil)

      The view that should be returned in the response.

    • order_by (::String) (defaults to: nil)

      Optional. The field to order the results by.

    • filter (::String) (defaults to: nil)

      Optional. An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

      • name
      • annotations

      Examples of using a filter:

      To filter the results of your request to versions with the name my-version in project my-project in the us-central region, in repository my-repo, append the following filter expression to your request:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"

      You can also use wildcards to match any number of characters before or after the value:

      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"
      • name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"

      To filter the results of your request to versions with the annotation key-value pair [external_link: external_link_value], append the following filter expression to your request:

      • "annotations.external_link:external_link_value"

      To filter just for a specific annotation key external_link, append the following filter expression to your request:

      • "annotations.external_link"

      If the annotation key or value contains special characters, you can escape them by surrounding the value with backticks. For example, to filter the results of your request to versions with the annotation key-value pair [external.link:https://example.com/my-version], append the following filter expression to your request:

      • "annotations.`external.link`:`https://example.com/my-version`"

      You can also filter with annotations with a wildcard to match any number of characters before or after the value:

      • "annotations.*_link:`*example.com*`"

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1934

def list_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_versions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.list_versions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @artifact_registry_stub, :list_versions, "versions", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


218
219
220
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 218

def logger
  @artifact_registry_stub.logger
end

#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

Updates the IAM policy for a given resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

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

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

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

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3612

def set_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.set_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

Tests if the caller has a list of permissions on a resource.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

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

    • permissions (::Array<::String>) (defaults to: nil)

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3778

def test_iam_permissions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.test_iam_permissions request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


121
122
123
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 121

def universe_domain
  @artifact_registry_stub.universe_domain
end

#update_file(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File #update_file(file: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::File

Updates a file.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateFileRequest.new

# Call the update_file method.
result = client.update_file request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::File.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2674

def update_file request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateFileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_file..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_file.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_file.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_file request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_package(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package #update_package(package: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Package

Updates a package.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdatePackageRequest.new

# Call the update_package method.
result = client.update_package request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4176

def update_package request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdatePackageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_package..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_package.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_package.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_package request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_project_settings(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings #update_project_settings(project_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::ProjectSettings

Updates the Settings for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new

# Call the update_project_settings method.
result = client.update_project_settings request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3936

def update_project_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_project_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_project_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_project_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_project_settings request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_repository(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository #update_repository(repository: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Repository

Updates a repository.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new

# Call the update_repository method.
result = client.update_repository request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 1407

def update_repository request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_repository..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_repository.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_repository.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_repository request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_rule(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule #update_rule(rule: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Rule

Updates a rule.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateRuleRequest.new

# Call the update_rule method.
result = client.update_rule request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Rule.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3444

def update_rule request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateRuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_rule..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_rule.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_rule.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_rule request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_tag(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag #update_tag(tag: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Tag

Updates a tag.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new

# Call the update_tag method.
result = client.update_tag request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 3034

def update_tag request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_tag..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_tag.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_tag.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_tag request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_version(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version #update_version(version: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::Version

Updates a version.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateVersionRequest.new

# Call the update_version method.
result = client.update_version request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 2283

def update_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_vpcsc_config(request, options = nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig #update_vpcsc_config(vpcsc_config: nil, update_mask: nil) ⇒ ::Google::Cloud::ArtifactRegistry::V1::VPCSCConfig

Updates the VPCSC Config for the Project.

Examples:

Basic example

require "google/cloud/artifact_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ArtifactRegistry::V1::UpdateVPCSCConfigRequest.new

# Call the update_vpcsc_config method.
result = client.update_vpcsc_config request

# The returned object is of type Google::Cloud::ArtifactRegistry::V1::VPCSCConfig.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
# File 'lib/google/cloud/artifact_registry/v1/artifact_registry/rest/client.rb', line 4094

def update_vpcsc_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateVPCSCConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_vpcsc_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_vpcsc_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_vpcsc_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @artifact_registry_stub.update_vpcsc_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end