google-cloud-artifact_registry-v1 0.2.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -6
  3. data/lib/google/cloud/artifact_registry/v1/artifact_registry/client.rb +2494 -91
  4. data/lib/google/cloud/artifact_registry/v1/artifact_registry/operations.rb +770 -0
  5. data/lib/google/cloud/artifact_registry/v1/artifact_registry/paths.rb +58 -0
  6. data/lib/google/cloud/artifact_registry/v1/artifact_registry.rb +1 -0
  7. data/lib/google/cloud/artifact_registry/v1/version.rb +1 -1
  8. data/lib/google/cloud/artifact_registry/v1.rb +2 -0
  9. data/lib/google/devtools/artifactregistry/v1/apt_artifact_pb.rb +64 -0
  10. data/lib/google/devtools/artifactregistry/v1/artifact_pb.rb +6 -2
  11. data/lib/google/devtools/artifactregistry/v1/file_pb.rb +58 -0
  12. data/lib/google/devtools/artifactregistry/v1/package_pb.rb +48 -0
  13. data/lib/google/devtools/artifactregistry/v1/repository_pb.rb +32 -2
  14. data/lib/google/devtools/artifactregistry/v1/service_pb.rb +15 -1
  15. data/lib/google/devtools/artifactregistry/v1/service_services_pb.rb +59 -0
  16. data/lib/google/devtools/artifactregistry/v1/settings_pb.rb +43 -0
  17. data/lib/google/devtools/artifactregistry/v1/tag_pb.rb +57 -0
  18. data/lib/google/devtools/artifactregistry/v1/version_pb.rb +62 -0
  19. data/lib/google/devtools/artifactregistry/v1/yum_artifact_pb.rb +62 -0
  20. data/proto_docs/google/devtools/artifactregistry/v1/apt_artifact.rb +118 -0
  21. data/proto_docs/google/devtools/artifactregistry/v1/artifact.rb +9 -0
  22. data/proto_docs/google/devtools/artifactregistry/v1/file.rb +131 -0
  23. data/proto_docs/google/devtools/artifactregistry/v1/package.rb +93 -0
  24. data/proto_docs/google/devtools/artifactregistry/v1/repository.rb +73 -2
  25. data/proto_docs/google/devtools/artifactregistry/v1/service.rb +32 -0
  26. data/proto_docs/google/devtools/artifactregistry/v1/settings.rb +80 -0
  27. data/proto_docs/google/devtools/artifactregistry/v1/tag.rb +132 -0
  28. data/proto_docs/google/devtools/artifactregistry/v1/version.rb +132 -0
  29. data/proto_docs/google/devtools/artifactregistry/v1/yum_artifact.rb +110 -0
  30. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  31. data/proto_docs/google/iam/v1/options.rb +50 -0
  32. data/proto_docs/google/iam/v1/policy.rb +208 -38
  33. data/proto_docs/google/longrunning/operations.rb +164 -0
  34. data/proto_docs/google/protobuf/any.rb +141 -0
  35. data/proto_docs/google/protobuf/duration.rb +98 -0
  36. data/proto_docs/google/protobuf/empty.rb +36 -0
  37. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  38. data/proto_docs/google/protobuf/struct.rb +96 -0
  39. data/proto_docs/google/rpc/status.rb +46 -0
  40. metadata +41 -22
@@ -147,6 +147,12 @@ module Google
147
147
  @quota_project_id = @config.quota_project
148
148
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
149
 
150
+ @operations_client = Operations.new do |config|
151
+ config.credentials = credentials
152
+ config.quota_project = @quota_project_id
153
+ config.endpoint = @config.endpoint
154
+ end
155
+
150
156
  @artifact_registry_stub = ::Gapic::ServiceStub.new(
151
157
  ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Stub,
152
158
  credentials: credentials,
@@ -156,38 +162,2192 @@ module Google
156
162
  )
157
163
  end
158
164
 
159
- # Service calls
165
+ ##
166
+ # Get the associated client for long-running operations.
167
+ #
168
+ # @return [::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Operations]
169
+ #
170
+ attr_reader :operations_client
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # Lists docker images.
176
+ #
177
+ # @overload list_docker_images(request, options = nil)
178
+ # Pass arguments to `list_docker_images` via a request object, either of type
179
+ # {::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [::Gapic::CallOptions, ::Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
186
+ #
187
+ # @overload list_docker_images(parent: nil, page_size: nil, page_token: nil)
188
+ # Pass arguments to `list_docker_images` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param parent [::String]
193
+ # Required. The name of the parent resource whose docker images will be listed.
194
+ # @param page_size [::Integer]
195
+ # The maximum number of artifacts to return.
196
+ # @param page_token [::String]
197
+ # The next_page_token value returned from a previous list request, if any.
198
+ #
199
+ # @yield [response, operation] Access the result along with the RPC operation
200
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
201
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
202
+ #
203
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
204
+ #
205
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
206
+ #
207
+ # @example Basic example
208
+ # require "google/cloud/artifact_registry/v1"
209
+ #
210
+ # # Create a client object. The client can be reused for multiple calls.
211
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
212
+ #
213
+ # # Create a request. To set request fields, pass in keyword arguments.
214
+ # request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new
215
+ #
216
+ # # Call the list_docker_images method.
217
+ # result = client.list_docker_images request
218
+ #
219
+ # # The returned object is of type Gapic::PagedEnumerable. You can
220
+ # # iterate over all elements by calling #each, and the enumerable
221
+ # # will lazily make API calls to fetch subsequent pages. Other
222
+ # # methods are also available for managing paging directly.
223
+ # result.each do |response|
224
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage.
225
+ # p response
226
+ # end
227
+ #
228
+ def list_docker_images request, options = nil
229
+ raise ::ArgumentError, "request must be provided" if request.nil?
230
+
231
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest
232
+
233
+ # Converts hash and nil to an options object
234
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
235
+
236
+ # Customize the options with defaults
237
+ metadata = @config.rpcs.list_docker_images.metadata.to_h
238
+
239
+ # Set x-goog-api-client and x-goog-user-project headers
240
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
241
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
242
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
243
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
+
245
+ header_params = {}
246
+ if request.parent
247
+ header_params["parent"] = request.parent
248
+ end
249
+
250
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
251
+ metadata[:"x-goog-request-params"] ||= request_params_header
252
+
253
+ options.apply_defaults timeout: @config.rpcs.list_docker_images.timeout,
254
+ metadata: metadata,
255
+ retry_policy: @config.rpcs.list_docker_images.retry_policy
256
+
257
+ options.apply_defaults timeout: @config.timeout,
258
+ metadata: @config.metadata,
259
+ retry_policy: @config.retry_policy
260
+
261
+ @artifact_registry_stub.call_rpc :list_docker_images, request, options: options do |response, operation|
262
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
263
+ yield response, operation if block_given?
264
+ return response
265
+ end
266
+ rescue ::GRPC::BadStatus => e
267
+ raise ::Google::Cloud::Error.from_error(e)
268
+ end
269
+
270
+ ##
271
+ # Gets a docker image.
272
+ #
273
+ # @overload get_docker_image(request, options = nil)
274
+ # Pass arguments to `get_docker_image` via a request object, either of type
275
+ # {::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest, ::Hash]
278
+ # A request object representing the call parameters. Required. To specify no
279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
280
+ # @param options [::Gapic::CallOptions, ::Hash]
281
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
282
+ #
283
+ # @overload get_docker_image(name: nil)
284
+ # Pass arguments to `get_docker_image` via keyword arguments. Note that at
285
+ # least one keyword argument is required. To specify no parameters, or to keep all
286
+ # the default parameter values, pass an empty Hash as a request object (see above).
287
+ #
288
+ # @param name [::String]
289
+ # Required. The name of the docker images.
290
+ #
291
+ # @yield [response, operation] Access the result along with the RPC operation
292
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::DockerImage]
293
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
294
+ #
295
+ # @return [::Google::Cloud::ArtifactRegistry::V1::DockerImage]
296
+ #
297
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
298
+ #
299
+ # @example Basic example
300
+ # require "google/cloud/artifact_registry/v1"
301
+ #
302
+ # # Create a client object. The client can be reused for multiple calls.
303
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
304
+ #
305
+ # # Create a request. To set request fields, pass in keyword arguments.
306
+ # request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new
307
+ #
308
+ # # Call the get_docker_image method.
309
+ # result = client.get_docker_image request
310
+ #
311
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage.
312
+ # p result
313
+ #
314
+ def get_docker_image request, options = nil
315
+ raise ::ArgumentError, "request must be provided" if request.nil?
316
+
317
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest
318
+
319
+ # Converts hash and nil to an options object
320
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
321
+
322
+ # Customize the options with defaults
323
+ metadata = @config.rpcs.get_docker_image.metadata.to_h
324
+
325
+ # Set x-goog-api-client and x-goog-user-project headers
326
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
327
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
328
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
329
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
330
+
331
+ header_params = {}
332
+ if request.name
333
+ header_params["name"] = request.name
334
+ end
335
+
336
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
337
+ metadata[:"x-goog-request-params"] ||= request_params_header
338
+
339
+ options.apply_defaults timeout: @config.rpcs.get_docker_image.timeout,
340
+ metadata: metadata,
341
+ retry_policy: @config.rpcs.get_docker_image.retry_policy
342
+
343
+ options.apply_defaults timeout: @config.timeout,
344
+ metadata: @config.metadata,
345
+ retry_policy: @config.retry_policy
346
+
347
+ @artifact_registry_stub.call_rpc :get_docker_image, request, options: options do |response, operation|
348
+ yield response, operation if block_given?
349
+ return response
350
+ end
351
+ rescue ::GRPC::BadStatus => e
352
+ raise ::Google::Cloud::Error.from_error(e)
353
+ end
354
+
355
+ ##
356
+ # Imports Apt artifacts. The returned Operation will complete once the
357
+ # resources are imported. Package, Version, and File resources are created
358
+ # based on the imported artifacts. Imported artifacts that conflict with
359
+ # existing resources are ignored.
360
+ #
361
+ # @overload import_apt_artifacts(request, options = nil)
362
+ # Pass arguments to `import_apt_artifacts` via a request object, either of type
363
+ # {::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest} or an equivalent Hash.
364
+ #
365
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest, ::Hash]
366
+ # A request object representing the call parameters. Required. To specify no
367
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
368
+ # @param options [::Gapic::CallOptions, ::Hash]
369
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
370
+ #
371
+ # @overload import_apt_artifacts(gcs_source: nil, parent: nil)
372
+ # Pass arguments to `import_apt_artifacts` via keyword arguments. Note that at
373
+ # least one keyword argument is required. To specify no parameters, or to keep all
374
+ # the default parameter values, pass an empty Hash as a request object (see above).
375
+ #
376
+ # @param gcs_source [::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsGcsSource, ::Hash]
377
+ # Google Cloud Storage location where input content is located.
378
+ # @param parent [::String]
379
+ # The name of the parent resource where the artifacts will be imported.
380
+ #
381
+ # @yield [response, operation] Access the result along with the RPC operation
382
+ # @yieldparam response [::Gapic::Operation]
383
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
384
+ #
385
+ # @return [::Gapic::Operation]
386
+ #
387
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
388
+ #
389
+ # @example Basic example
390
+ # require "google/cloud/artifact_registry/v1"
391
+ #
392
+ # # Create a client object. The client can be reused for multiple calls.
393
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
394
+ #
395
+ # # Create a request. To set request fields, pass in keyword arguments.
396
+ # request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new
397
+ #
398
+ # # Call the import_apt_artifacts method.
399
+ # result = client.import_apt_artifacts request
400
+ #
401
+ # # The returned object is of type Gapic::Operation. You can use this
402
+ # # object to check the status of an operation, cancel it, or wait
403
+ # # for results. Here is how to block until completion:
404
+ # result.wait_until_done! timeout: 60
405
+ # if result.response?
406
+ # p result.response
407
+ # else
408
+ # puts "Error!"
409
+ # end
410
+ #
411
+ def import_apt_artifacts request, options = nil
412
+ raise ::ArgumentError, "request must be provided" if request.nil?
413
+
414
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest
415
+
416
+ # Converts hash and nil to an options object
417
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
418
+
419
+ # Customize the options with defaults
420
+ metadata = @config.rpcs.import_apt_artifacts.metadata.to_h
421
+
422
+ # Set x-goog-api-client and x-goog-user-project headers
423
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
424
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
425
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
426
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
427
+
428
+ header_params = {}
429
+ if request.parent
430
+ header_params["parent"] = request.parent
431
+ end
432
+
433
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
434
+ metadata[:"x-goog-request-params"] ||= request_params_header
435
+
436
+ options.apply_defaults timeout: @config.rpcs.import_apt_artifacts.timeout,
437
+ metadata: metadata,
438
+ retry_policy: @config.rpcs.import_apt_artifacts.retry_policy
439
+
440
+ options.apply_defaults timeout: @config.timeout,
441
+ metadata: @config.metadata,
442
+ retry_policy: @config.retry_policy
443
+
444
+ @artifact_registry_stub.call_rpc :import_apt_artifacts, request, options: options do |response, operation|
445
+ response = ::Gapic::Operation.new response, @operations_client, options: options
446
+ yield response, operation if block_given?
447
+ return response
448
+ end
449
+ rescue ::GRPC::BadStatus => e
450
+ raise ::Google::Cloud::Error.from_error(e)
451
+ end
452
+
453
+ ##
454
+ # Imports Yum (RPM) artifacts. The returned Operation will complete once the
455
+ # resources are imported. Package, Version, and File resources are created
456
+ # based on the imported artifacts. Imported artifacts that conflict with
457
+ # existing resources are ignored.
458
+ #
459
+ # @overload import_yum_artifacts(request, options = nil)
460
+ # Pass arguments to `import_yum_artifacts` via a request object, either of type
461
+ # {::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest} or an equivalent Hash.
462
+ #
463
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest, ::Hash]
464
+ # A request object representing the call parameters. Required. To specify no
465
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
466
+ # @param options [::Gapic::CallOptions, ::Hash]
467
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
468
+ #
469
+ # @overload import_yum_artifacts(gcs_source: nil, parent: nil)
470
+ # Pass arguments to `import_yum_artifacts` via keyword arguments. Note that at
471
+ # least one keyword argument is required. To specify no parameters, or to keep all
472
+ # the default parameter values, pass an empty Hash as a request object (see above).
473
+ #
474
+ # @param gcs_source [::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsGcsSource, ::Hash]
475
+ # Google Cloud Storage location where input content is located.
476
+ # @param parent [::String]
477
+ # The name of the parent resource where the artifacts will be imported.
478
+ #
479
+ # @yield [response, operation] Access the result along with the RPC operation
480
+ # @yieldparam response [::Gapic::Operation]
481
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
482
+ #
483
+ # @return [::Gapic::Operation]
484
+ #
485
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
486
+ #
487
+ # @example Basic example
488
+ # require "google/cloud/artifact_registry/v1"
489
+ #
490
+ # # Create a client object. The client can be reused for multiple calls.
491
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
492
+ #
493
+ # # Create a request. To set request fields, pass in keyword arguments.
494
+ # request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new
495
+ #
496
+ # # Call the import_yum_artifacts method.
497
+ # result = client.import_yum_artifacts request
498
+ #
499
+ # # The returned object is of type Gapic::Operation. You can use this
500
+ # # object to check the status of an operation, cancel it, or wait
501
+ # # for results. Here is how to block until completion:
502
+ # result.wait_until_done! timeout: 60
503
+ # if result.response?
504
+ # p result.response
505
+ # else
506
+ # puts "Error!"
507
+ # end
508
+ #
509
+ def import_yum_artifacts request, options = nil
510
+ raise ::ArgumentError, "request must be provided" if request.nil?
511
+
512
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest
513
+
514
+ # Converts hash and nil to an options object
515
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
516
+
517
+ # Customize the options with defaults
518
+ metadata = @config.rpcs.import_yum_artifacts.metadata.to_h
519
+
520
+ # Set x-goog-api-client and x-goog-user-project headers
521
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
522
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
523
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
524
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
525
+
526
+ header_params = {}
527
+ if request.parent
528
+ header_params["parent"] = request.parent
529
+ end
530
+
531
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
532
+ metadata[:"x-goog-request-params"] ||= request_params_header
533
+
534
+ options.apply_defaults timeout: @config.rpcs.import_yum_artifacts.timeout,
535
+ metadata: metadata,
536
+ retry_policy: @config.rpcs.import_yum_artifacts.retry_policy
537
+
538
+ options.apply_defaults timeout: @config.timeout,
539
+ metadata: @config.metadata,
540
+ retry_policy: @config.retry_policy
541
+
542
+ @artifact_registry_stub.call_rpc :import_yum_artifacts, request, options: options do |response, operation|
543
+ response = ::Gapic::Operation.new response, @operations_client, options: options
544
+ yield response, operation if block_given?
545
+ return response
546
+ end
547
+ rescue ::GRPC::BadStatus => e
548
+ raise ::Google::Cloud::Error.from_error(e)
549
+ end
550
+
551
+ ##
552
+ # Lists repositories.
553
+ #
554
+ # @overload list_repositories(request, options = nil)
555
+ # Pass arguments to `list_repositories` via a request object, either of type
556
+ # {::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest} or an equivalent Hash.
557
+ #
558
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash]
559
+ # A request object representing the call parameters. Required. To specify no
560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
561
+ # @param options [::Gapic::CallOptions, ::Hash]
562
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
563
+ #
564
+ # @overload list_repositories(parent: nil, page_size: nil, page_token: nil)
565
+ # Pass arguments to `list_repositories` via keyword arguments. Note that at
566
+ # least one keyword argument is required. To specify no parameters, or to keep all
567
+ # the default parameter values, pass an empty Hash as a request object (see above).
568
+ #
569
+ # @param parent [::String]
570
+ # Required. The name of the parent resource whose repositories will be listed.
571
+ # @param page_size [::Integer]
572
+ # The maximum number of repositories to return. Maximum page size is 1,000.
573
+ # @param page_token [::String]
574
+ # The next_page_token value returned from a previous list request, if any.
575
+ #
576
+ # @yield [response, operation] Access the result along with the RPC operation
577
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
578
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
579
+ #
580
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
581
+ #
582
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
583
+ #
584
+ # @example Basic example
585
+ # require "google/cloud/artifact_registry/v1"
586
+ #
587
+ # # Create a client object. The client can be reused for multiple calls.
588
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
589
+ #
590
+ # # Create a request. To set request fields, pass in keyword arguments.
591
+ # request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new
592
+ #
593
+ # # Call the list_repositories method.
594
+ # result = client.list_repositories request
595
+ #
596
+ # # The returned object is of type Gapic::PagedEnumerable. You can
597
+ # # iterate over all elements by calling #each, and the enumerable
598
+ # # will lazily make API calls to fetch subsequent pages. Other
599
+ # # methods are also available for managing paging directly.
600
+ # result.each do |response|
601
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository.
602
+ # p response
603
+ # end
604
+ #
605
+ def list_repositories request, options = nil
606
+ raise ::ArgumentError, "request must be provided" if request.nil?
607
+
608
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest
609
+
610
+ # Converts hash and nil to an options object
611
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
612
+
613
+ # Customize the options with defaults
614
+ metadata = @config.rpcs.list_repositories.metadata.to_h
615
+
616
+ # Set x-goog-api-client and x-goog-user-project headers
617
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
618
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
619
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
620
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
621
+
622
+ header_params = {}
623
+ if request.parent
624
+ header_params["parent"] = request.parent
625
+ end
626
+
627
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
628
+ metadata[:"x-goog-request-params"] ||= request_params_header
629
+
630
+ options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
631
+ metadata: metadata,
632
+ retry_policy: @config.rpcs.list_repositories.retry_policy
633
+
634
+ options.apply_defaults timeout: @config.timeout,
635
+ metadata: @config.metadata,
636
+ retry_policy: @config.retry_policy
637
+
638
+ @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
639
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
640
+ yield response, operation if block_given?
641
+ return response
642
+ end
643
+ rescue ::GRPC::BadStatus => e
644
+ raise ::Google::Cloud::Error.from_error(e)
645
+ end
646
+
647
+ ##
648
+ # Gets a repository.
649
+ #
650
+ # @overload get_repository(request, options = nil)
651
+ # Pass arguments to `get_repository` via a request object, either of type
652
+ # {::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest} or an equivalent Hash.
653
+ #
654
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash]
655
+ # A request object representing the call parameters. Required. To specify no
656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
657
+ # @param options [::Gapic::CallOptions, ::Hash]
658
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
659
+ #
660
+ # @overload get_repository(name: nil)
661
+ # Pass arguments to `get_repository` via keyword arguments. Note that at
662
+ # least one keyword argument is required. To specify no parameters, or to keep all
663
+ # the default parameter values, pass an empty Hash as a request object (see above).
664
+ #
665
+ # @param name [::String]
666
+ # Required. The name of the repository to retrieve.
667
+ #
668
+ # @yield [response, operation] Access the result along with the RPC operation
669
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
670
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
671
+ #
672
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
673
+ #
674
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
675
+ #
676
+ # @example Basic example
677
+ # require "google/cloud/artifact_registry/v1"
678
+ #
679
+ # # Create a client object. The client can be reused for multiple calls.
680
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
681
+ #
682
+ # # Create a request. To set request fields, pass in keyword arguments.
683
+ # request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new
684
+ #
685
+ # # Call the get_repository method.
686
+ # result = client.get_repository request
687
+ #
688
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
689
+ # p result
690
+ #
691
+ def get_repository request, options = nil
692
+ raise ::ArgumentError, "request must be provided" if request.nil?
693
+
694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest
695
+
696
+ # Converts hash and nil to an options object
697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
698
+
699
+ # Customize the options with defaults
700
+ metadata = @config.rpcs.get_repository.metadata.to_h
701
+
702
+ # Set x-goog-api-client and x-goog-user-project headers
703
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
705
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
706
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
707
+
708
+ header_params = {}
709
+ if request.name
710
+ header_params["name"] = request.name
711
+ end
712
+
713
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
714
+ metadata[:"x-goog-request-params"] ||= request_params_header
715
+
716
+ options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
717
+ metadata: metadata,
718
+ retry_policy: @config.rpcs.get_repository.retry_policy
719
+
720
+ options.apply_defaults timeout: @config.timeout,
721
+ metadata: @config.metadata,
722
+ retry_policy: @config.retry_policy
723
+
724
+ @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
725
+ yield response, operation if block_given?
726
+ return response
727
+ end
728
+ rescue ::GRPC::BadStatus => e
729
+ raise ::Google::Cloud::Error.from_error(e)
730
+ end
731
+
732
+ ##
733
+ # Creates a repository. The returned Operation will finish once the
734
+ # repository has been created. Its response will be the created Repository.
735
+ #
736
+ # @overload create_repository(request, options = nil)
737
+ # Pass arguments to `create_repository` via a request object, either of type
738
+ # {::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest} or an equivalent Hash.
739
+ #
740
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest, ::Hash]
741
+ # A request object representing the call parameters. Required. To specify no
742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
743
+ # @param options [::Gapic::CallOptions, ::Hash]
744
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
745
+ #
746
+ # @overload create_repository(parent: nil, repository_id: nil, repository: nil)
747
+ # Pass arguments to `create_repository` via keyword arguments. Note that at
748
+ # least one keyword argument is required. To specify no parameters, or to keep all
749
+ # the default parameter values, pass an empty Hash as a request object (see above).
750
+ #
751
+ # @param parent [::String]
752
+ # Required. The name of the parent resource where the repository will be created.
753
+ # @param repository_id [::String]
754
+ # The repository id to use for this repository.
755
+ # @param repository [::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash]
756
+ # The repository to be created.
757
+ #
758
+ # @yield [response, operation] Access the result along with the RPC operation
759
+ # @yieldparam response [::Gapic::Operation]
760
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
761
+ #
762
+ # @return [::Gapic::Operation]
763
+ #
764
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
765
+ #
766
+ # @example Basic example
767
+ # require "google/cloud/artifact_registry/v1"
768
+ #
769
+ # # Create a client object. The client can be reused for multiple calls.
770
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
771
+ #
772
+ # # Create a request. To set request fields, pass in keyword arguments.
773
+ # request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new
774
+ #
775
+ # # Call the create_repository method.
776
+ # result = client.create_repository request
777
+ #
778
+ # # The returned object is of type Gapic::Operation. You can use this
779
+ # # object to check the status of an operation, cancel it, or wait
780
+ # # for results. Here is how to block until completion:
781
+ # result.wait_until_done! timeout: 60
782
+ # if result.response?
783
+ # p result.response
784
+ # else
785
+ # puts "Error!"
786
+ # end
787
+ #
788
+ def create_repository request, options = nil
789
+ raise ::ArgumentError, "request must be provided" if request.nil?
790
+
791
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest
792
+
793
+ # Converts hash and nil to an options object
794
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
795
+
796
+ # Customize the options with defaults
797
+ metadata = @config.rpcs.create_repository.metadata.to_h
798
+
799
+ # Set x-goog-api-client and x-goog-user-project headers
800
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
801
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
802
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
803
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
+
805
+ header_params = {}
806
+ if request.parent
807
+ header_params["parent"] = request.parent
808
+ end
809
+
810
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
811
+ metadata[:"x-goog-request-params"] ||= request_params_header
812
+
813
+ options.apply_defaults timeout: @config.rpcs.create_repository.timeout,
814
+ metadata: metadata,
815
+ retry_policy: @config.rpcs.create_repository.retry_policy
816
+
817
+ options.apply_defaults timeout: @config.timeout,
818
+ metadata: @config.metadata,
819
+ retry_policy: @config.retry_policy
820
+
821
+ @artifact_registry_stub.call_rpc :create_repository, request, options: options do |response, operation|
822
+ response = ::Gapic::Operation.new response, @operations_client, options: options
823
+ yield response, operation if block_given?
824
+ return response
825
+ end
826
+ rescue ::GRPC::BadStatus => e
827
+ raise ::Google::Cloud::Error.from_error(e)
828
+ end
829
+
830
+ ##
831
+ # Updates a repository.
832
+ #
833
+ # @overload update_repository(request, options = nil)
834
+ # Pass arguments to `update_repository` via a request object, either of type
835
+ # {::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest} or an equivalent Hash.
836
+ #
837
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest, ::Hash]
838
+ # A request object representing the call parameters. Required. To specify no
839
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
840
+ # @param options [::Gapic::CallOptions, ::Hash]
841
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
842
+ #
843
+ # @overload update_repository(repository: nil, update_mask: nil)
844
+ # Pass arguments to `update_repository` via keyword arguments. Note that at
845
+ # least one keyword argument is required. To specify no parameters, or to keep all
846
+ # the default parameter values, pass an empty Hash as a request object (see above).
847
+ #
848
+ # @param repository [::Google::Cloud::ArtifactRegistry::V1::Repository, ::Hash]
849
+ # The repository that replaces the resource on the server.
850
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
851
+ # The update mask applies to the resource. For the `FieldMask` definition,
852
+ # see
853
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
854
+ #
855
+ # @yield [response, operation] Access the result along with the RPC operation
856
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
857
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
858
+ #
859
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
860
+ #
861
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
862
+ #
863
+ # @example Basic example
864
+ # require "google/cloud/artifact_registry/v1"
865
+ #
866
+ # # Create a client object. The client can be reused for multiple calls.
867
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
868
+ #
869
+ # # Create a request. To set request fields, pass in keyword arguments.
870
+ # request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new
871
+ #
872
+ # # Call the update_repository method.
873
+ # result = client.update_repository request
874
+ #
875
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
876
+ # p result
877
+ #
878
+ def update_repository request, options = nil
879
+ raise ::ArgumentError, "request must be provided" if request.nil?
880
+
881
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest
882
+
883
+ # Converts hash and nil to an options object
884
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
885
+
886
+ # Customize the options with defaults
887
+ metadata = @config.rpcs.update_repository.metadata.to_h
888
+
889
+ # Set x-goog-api-client and x-goog-user-project headers
890
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
891
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
892
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
893
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
894
+
895
+ header_params = {}
896
+ if request.repository&.name
897
+ header_params["repository.name"] = request.repository.name
898
+ end
899
+
900
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
901
+ metadata[:"x-goog-request-params"] ||= request_params_header
902
+
903
+ options.apply_defaults timeout: @config.rpcs.update_repository.timeout,
904
+ metadata: metadata,
905
+ retry_policy: @config.rpcs.update_repository.retry_policy
906
+
907
+ options.apply_defaults timeout: @config.timeout,
908
+ metadata: @config.metadata,
909
+ retry_policy: @config.retry_policy
910
+
911
+ @artifact_registry_stub.call_rpc :update_repository, request, options: options do |response, operation|
912
+ yield response, operation if block_given?
913
+ return response
914
+ end
915
+ rescue ::GRPC::BadStatus => e
916
+ raise ::Google::Cloud::Error.from_error(e)
917
+ end
918
+
919
+ ##
920
+ # Deletes a repository and all of its contents. The returned Operation will
921
+ # finish once the repository has been deleted. It will not have any Operation
922
+ # metadata and will return a google.protobuf.Empty response.
923
+ #
924
+ # @overload delete_repository(request, options = nil)
925
+ # Pass arguments to `delete_repository` via a request object, either of type
926
+ # {::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest} or an equivalent Hash.
927
+ #
928
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest, ::Hash]
929
+ # A request object representing the call parameters. Required. To specify no
930
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
931
+ # @param options [::Gapic::CallOptions, ::Hash]
932
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
933
+ #
934
+ # @overload delete_repository(name: nil)
935
+ # Pass arguments to `delete_repository` via keyword arguments. Note that at
936
+ # least one keyword argument is required. To specify no parameters, or to keep all
937
+ # the default parameter values, pass an empty Hash as a request object (see above).
938
+ #
939
+ # @param name [::String]
940
+ # Required. The name of the repository to delete.
941
+ #
942
+ # @yield [response, operation] Access the result along with the RPC operation
943
+ # @yieldparam response [::Gapic::Operation]
944
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
945
+ #
946
+ # @return [::Gapic::Operation]
947
+ #
948
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
949
+ #
950
+ # @example Basic example
951
+ # require "google/cloud/artifact_registry/v1"
952
+ #
953
+ # # Create a client object. The client can be reused for multiple calls.
954
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
955
+ #
956
+ # # Create a request. To set request fields, pass in keyword arguments.
957
+ # request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new
958
+ #
959
+ # # Call the delete_repository method.
960
+ # result = client.delete_repository request
961
+ #
962
+ # # The returned object is of type Gapic::Operation. You can use this
963
+ # # object to check the status of an operation, cancel it, or wait
964
+ # # for results. Here is how to block until completion:
965
+ # result.wait_until_done! timeout: 60
966
+ # if result.response?
967
+ # p result.response
968
+ # else
969
+ # puts "Error!"
970
+ # end
971
+ #
972
+ def delete_repository request, options = nil
973
+ raise ::ArgumentError, "request must be provided" if request.nil?
974
+
975
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest
976
+
977
+ # Converts hash and nil to an options object
978
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
979
+
980
+ # Customize the options with defaults
981
+ metadata = @config.rpcs.delete_repository.metadata.to_h
982
+
983
+ # Set x-goog-api-client and x-goog-user-project headers
984
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
985
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
986
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
987
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
988
+
989
+ header_params = {}
990
+ if request.name
991
+ header_params["name"] = request.name
992
+ end
993
+
994
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
995
+ metadata[:"x-goog-request-params"] ||= request_params_header
996
+
997
+ options.apply_defaults timeout: @config.rpcs.delete_repository.timeout,
998
+ metadata: metadata,
999
+ retry_policy: @config.rpcs.delete_repository.retry_policy
1000
+
1001
+ options.apply_defaults timeout: @config.timeout,
1002
+ metadata: @config.metadata,
1003
+ retry_policy: @config.retry_policy
1004
+
1005
+ @artifact_registry_stub.call_rpc :delete_repository, request, options: options do |response, operation|
1006
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1007
+ yield response, operation if block_given?
1008
+ return response
1009
+ end
1010
+ rescue ::GRPC::BadStatus => e
1011
+ raise ::Google::Cloud::Error.from_error(e)
1012
+ end
1013
+
1014
+ ##
1015
+ # Lists packages.
1016
+ #
1017
+ # @overload list_packages(request, options = nil)
1018
+ # Pass arguments to `list_packages` via a request object, either of type
1019
+ # {::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest} or an equivalent Hash.
1020
+ #
1021
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest, ::Hash]
1022
+ # A request object representing the call parameters. Required. To specify no
1023
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1024
+ # @param options [::Gapic::CallOptions, ::Hash]
1025
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1026
+ #
1027
+ # @overload list_packages(parent: nil, page_size: nil, page_token: nil)
1028
+ # Pass arguments to `list_packages` via keyword arguments. Note that at
1029
+ # least one keyword argument is required. To specify no parameters, or to keep all
1030
+ # the default parameter values, pass an empty Hash as a request object (see above).
1031
+ #
1032
+ # @param parent [::String]
1033
+ # Required. The name of the parent resource whose packages will be listed.
1034
+ # @param page_size [::Integer]
1035
+ # The maximum number of packages to return. Maximum page size is 1,000.
1036
+ # @param page_token [::String]
1037
+ # The next_page_token value returned from a previous list request, if any.
1038
+ #
1039
+ # @yield [response, operation] Access the result along with the RPC operation
1040
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>]
1041
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1042
+ #
1043
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Package>]
1044
+ #
1045
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1046
+ #
1047
+ # @example Basic example
1048
+ # require "google/cloud/artifact_registry/v1"
1049
+ #
1050
+ # # Create a client object. The client can be reused for multiple calls.
1051
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1052
+ #
1053
+ # # Create a request. To set request fields, pass in keyword arguments.
1054
+ # request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new
1055
+ #
1056
+ # # Call the list_packages method.
1057
+ # result = client.list_packages request
1058
+ #
1059
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1060
+ # # iterate over all elements by calling #each, and the enumerable
1061
+ # # will lazily make API calls to fetch subsequent pages. Other
1062
+ # # methods are also available for managing paging directly.
1063
+ # result.each do |response|
1064
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package.
1065
+ # p response
1066
+ # end
1067
+ #
1068
+ def list_packages request, options = nil
1069
+ raise ::ArgumentError, "request must be provided" if request.nil?
1070
+
1071
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest
1072
+
1073
+ # Converts hash and nil to an options object
1074
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1075
+
1076
+ # Customize the options with defaults
1077
+ metadata = @config.rpcs.list_packages.metadata.to_h
1078
+
1079
+ # Set x-goog-api-client and x-goog-user-project headers
1080
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1081
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1082
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1083
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1084
+
1085
+ header_params = {}
1086
+ if request.parent
1087
+ header_params["parent"] = request.parent
1088
+ end
1089
+
1090
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1091
+ metadata[:"x-goog-request-params"] ||= request_params_header
1092
+
1093
+ options.apply_defaults timeout: @config.rpcs.list_packages.timeout,
1094
+ metadata: metadata,
1095
+ retry_policy: @config.rpcs.list_packages.retry_policy
1096
+
1097
+ options.apply_defaults timeout: @config.timeout,
1098
+ metadata: @config.metadata,
1099
+ retry_policy: @config.retry_policy
1100
+
1101
+ @artifact_registry_stub.call_rpc :list_packages, request, options: options do |response, operation|
1102
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_packages, request, response, operation, options
1103
+ yield response, operation if block_given?
1104
+ return response
1105
+ end
1106
+ rescue ::GRPC::BadStatus => e
1107
+ raise ::Google::Cloud::Error.from_error(e)
1108
+ end
1109
+
1110
+ ##
1111
+ # Gets a package.
1112
+ #
1113
+ # @overload get_package(request, options = nil)
1114
+ # Pass arguments to `get_package` via a request object, either of type
1115
+ # {::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest} or an equivalent Hash.
1116
+ #
1117
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest, ::Hash]
1118
+ # A request object representing the call parameters. Required. To specify no
1119
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1120
+ # @param options [::Gapic::CallOptions, ::Hash]
1121
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1122
+ #
1123
+ # @overload get_package(name: nil)
1124
+ # Pass arguments to `get_package` via keyword arguments. Note that at
1125
+ # least one keyword argument is required. To specify no parameters, or to keep all
1126
+ # the default parameter values, pass an empty Hash as a request object (see above).
1127
+ #
1128
+ # @param name [::String]
1129
+ # Required. The name of the package to retrieve.
1130
+ #
1131
+ # @yield [response, operation] Access the result along with the RPC operation
1132
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Package]
1133
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1134
+ #
1135
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Package]
1136
+ #
1137
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1138
+ #
1139
+ # @example Basic example
1140
+ # require "google/cloud/artifact_registry/v1"
1141
+ #
1142
+ # # Create a client object. The client can be reused for multiple calls.
1143
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1144
+ #
1145
+ # # Create a request. To set request fields, pass in keyword arguments.
1146
+ # request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new
1147
+ #
1148
+ # # Call the get_package method.
1149
+ # result = client.get_package request
1150
+ #
1151
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package.
1152
+ # p result
1153
+ #
1154
+ def get_package request, options = nil
1155
+ raise ::ArgumentError, "request must be provided" if request.nil?
1156
+
1157
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetPackageRequest
1158
+
1159
+ # Converts hash and nil to an options object
1160
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1161
+
1162
+ # Customize the options with defaults
1163
+ metadata = @config.rpcs.get_package.metadata.to_h
1164
+
1165
+ # Set x-goog-api-client and x-goog-user-project headers
1166
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1167
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1168
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1169
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1170
+
1171
+ header_params = {}
1172
+ if request.name
1173
+ header_params["name"] = request.name
1174
+ end
1175
+
1176
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1177
+ metadata[:"x-goog-request-params"] ||= request_params_header
1178
+
1179
+ options.apply_defaults timeout: @config.rpcs.get_package.timeout,
1180
+ metadata: metadata,
1181
+ retry_policy: @config.rpcs.get_package.retry_policy
1182
+
1183
+ options.apply_defaults timeout: @config.timeout,
1184
+ metadata: @config.metadata,
1185
+ retry_policy: @config.retry_policy
1186
+
1187
+ @artifact_registry_stub.call_rpc :get_package, request, options: options do |response, operation|
1188
+ yield response, operation if block_given?
1189
+ return response
1190
+ end
1191
+ rescue ::GRPC::BadStatus => e
1192
+ raise ::Google::Cloud::Error.from_error(e)
1193
+ end
1194
+
1195
+ ##
1196
+ # Deletes a package and all of its versions and tags. The returned operation
1197
+ # will complete once the package has been deleted.
1198
+ #
1199
+ # @overload delete_package(request, options = nil)
1200
+ # Pass arguments to `delete_package` via a request object, either of type
1201
+ # {::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest} or an equivalent Hash.
1202
+ #
1203
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest, ::Hash]
1204
+ # A request object representing the call parameters. Required. To specify no
1205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1206
+ # @param options [::Gapic::CallOptions, ::Hash]
1207
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1208
+ #
1209
+ # @overload delete_package(name: nil)
1210
+ # Pass arguments to `delete_package` via keyword arguments. Note that at
1211
+ # least one keyword argument is required. To specify no parameters, or to keep all
1212
+ # the default parameter values, pass an empty Hash as a request object (see above).
1213
+ #
1214
+ # @param name [::String]
1215
+ # Required. The name of the package to delete.
1216
+ #
1217
+ # @yield [response, operation] Access the result along with the RPC operation
1218
+ # @yieldparam response [::Gapic::Operation]
1219
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1220
+ #
1221
+ # @return [::Gapic::Operation]
1222
+ #
1223
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1224
+ #
1225
+ # @example Basic example
1226
+ # require "google/cloud/artifact_registry/v1"
1227
+ #
1228
+ # # Create a client object. The client can be reused for multiple calls.
1229
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1230
+ #
1231
+ # # Create a request. To set request fields, pass in keyword arguments.
1232
+ # request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new
1233
+ #
1234
+ # # Call the delete_package method.
1235
+ # result = client.delete_package request
1236
+ #
1237
+ # # The returned object is of type Gapic::Operation. You can use this
1238
+ # # object to check the status of an operation, cancel it, or wait
1239
+ # # for results. Here is how to block until completion:
1240
+ # result.wait_until_done! timeout: 60
1241
+ # if result.response?
1242
+ # p result.response
1243
+ # else
1244
+ # puts "Error!"
1245
+ # end
1246
+ #
1247
+ def delete_package request, options = nil
1248
+ raise ::ArgumentError, "request must be provided" if request.nil?
1249
+
1250
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest
1251
+
1252
+ # Converts hash and nil to an options object
1253
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1254
+
1255
+ # Customize the options with defaults
1256
+ metadata = @config.rpcs.delete_package.metadata.to_h
1257
+
1258
+ # Set x-goog-api-client and x-goog-user-project headers
1259
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1260
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1261
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1262
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1263
+
1264
+ header_params = {}
1265
+ if request.name
1266
+ header_params["name"] = request.name
1267
+ end
1268
+
1269
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1270
+ metadata[:"x-goog-request-params"] ||= request_params_header
1271
+
1272
+ options.apply_defaults timeout: @config.rpcs.delete_package.timeout,
1273
+ metadata: metadata,
1274
+ retry_policy: @config.rpcs.delete_package.retry_policy
1275
+
1276
+ options.apply_defaults timeout: @config.timeout,
1277
+ metadata: @config.metadata,
1278
+ retry_policy: @config.retry_policy
1279
+
1280
+ @artifact_registry_stub.call_rpc :delete_package, request, options: options do |response, operation|
1281
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1282
+ yield response, operation if block_given?
1283
+ return response
1284
+ end
1285
+ rescue ::GRPC::BadStatus => e
1286
+ raise ::Google::Cloud::Error.from_error(e)
1287
+ end
1288
+
1289
+ ##
1290
+ # Lists versions.
1291
+ #
1292
+ # @overload list_versions(request, options = nil)
1293
+ # Pass arguments to `list_versions` via a request object, either of type
1294
+ # {::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest} or an equivalent Hash.
1295
+ #
1296
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest, ::Hash]
1297
+ # A request object representing the call parameters. Required. To specify no
1298
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1299
+ # @param options [::Gapic::CallOptions, ::Hash]
1300
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1301
+ #
1302
+ # @overload list_versions(parent: nil, page_size: nil, page_token: nil, view: nil, order_by: nil)
1303
+ # Pass arguments to `list_versions` via keyword arguments. Note that at
1304
+ # least one keyword argument is required. To specify no parameters, or to keep all
1305
+ # the default parameter values, pass an empty Hash as a request object (see above).
1306
+ #
1307
+ # @param parent [::String]
1308
+ # The name of the parent resource whose versions will be listed.
1309
+ # @param page_size [::Integer]
1310
+ # The maximum number of versions to return. Maximum page size is 1,000.
1311
+ # @param page_token [::String]
1312
+ # The next_page_token value returned from a previous list request, if any.
1313
+ # @param view [::Google::Cloud::ArtifactRegistry::V1::VersionView]
1314
+ # The view that should be returned in the response.
1315
+ # @param order_by [::String]
1316
+ # Optional. The field to order the results by.
1317
+ #
1318
+ # @yield [response, operation] Access the result along with the RPC operation
1319
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>]
1320
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1321
+ #
1322
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Version>]
1323
+ #
1324
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1325
+ #
1326
+ # @example Basic example
1327
+ # require "google/cloud/artifact_registry/v1"
1328
+ #
1329
+ # # Create a client object. The client can be reused for multiple calls.
1330
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1331
+ #
1332
+ # # Create a request. To set request fields, pass in keyword arguments.
1333
+ # request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new
1334
+ #
1335
+ # # Call the list_versions method.
1336
+ # result = client.list_versions request
1337
+ #
1338
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1339
+ # # iterate over all elements by calling #each, and the enumerable
1340
+ # # will lazily make API calls to fetch subsequent pages. Other
1341
+ # # methods are also available for managing paging directly.
1342
+ # result.each do |response|
1343
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version.
1344
+ # p response
1345
+ # end
1346
+ #
1347
+ def list_versions request, options = nil
1348
+ raise ::ArgumentError, "request must be provided" if request.nil?
1349
+
1350
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest
1351
+
1352
+ # Converts hash and nil to an options object
1353
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1354
+
1355
+ # Customize the options with defaults
1356
+ metadata = @config.rpcs.list_versions.metadata.to_h
1357
+
1358
+ # Set x-goog-api-client and x-goog-user-project headers
1359
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1360
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1361
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1362
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1363
+
1364
+ header_params = {}
1365
+ if request.parent
1366
+ header_params["parent"] = request.parent
1367
+ end
1368
+
1369
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1370
+ metadata[:"x-goog-request-params"] ||= request_params_header
1371
+
1372
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
1373
+ metadata: metadata,
1374
+ retry_policy: @config.rpcs.list_versions.retry_policy
1375
+
1376
+ options.apply_defaults timeout: @config.timeout,
1377
+ metadata: @config.metadata,
1378
+ retry_policy: @config.retry_policy
1379
+
1380
+ @artifact_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
1381
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_versions, request, response, operation, options
1382
+ yield response, operation if block_given?
1383
+ return response
1384
+ end
1385
+ rescue ::GRPC::BadStatus => e
1386
+ raise ::Google::Cloud::Error.from_error(e)
1387
+ end
1388
+
1389
+ ##
1390
+ # Gets a version
1391
+ #
1392
+ # @overload get_version(request, options = nil)
1393
+ # Pass arguments to `get_version` via a request object, either of type
1394
+ # {::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest} or an equivalent Hash.
1395
+ #
1396
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest, ::Hash]
1397
+ # A request object representing the call parameters. Required. To specify no
1398
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1399
+ # @param options [::Gapic::CallOptions, ::Hash]
1400
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1401
+ #
1402
+ # @overload get_version(name: nil, view: nil)
1403
+ # Pass arguments to `get_version` via keyword arguments. Note that at
1404
+ # least one keyword argument is required. To specify no parameters, or to keep all
1405
+ # the default parameter values, pass an empty Hash as a request object (see above).
1406
+ #
1407
+ # @param name [::String]
1408
+ # The name of the version to retrieve.
1409
+ # @param view [::Google::Cloud::ArtifactRegistry::V1::VersionView]
1410
+ # The view that should be returned in the response.
1411
+ #
1412
+ # @yield [response, operation] Access the result along with the RPC operation
1413
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Version]
1414
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1415
+ #
1416
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Version]
1417
+ #
1418
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1419
+ #
1420
+ # @example Basic example
1421
+ # require "google/cloud/artifact_registry/v1"
1422
+ #
1423
+ # # Create a client object. The client can be reused for multiple calls.
1424
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1425
+ #
1426
+ # # Create a request. To set request fields, pass in keyword arguments.
1427
+ # request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new
1428
+ #
1429
+ # # Call the get_version method.
1430
+ # result = client.get_version request
1431
+ #
1432
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version.
1433
+ # p result
1434
+ #
1435
+ def get_version request, options = nil
1436
+ raise ::ArgumentError, "request must be provided" if request.nil?
1437
+
1438
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetVersionRequest
1439
+
1440
+ # Converts hash and nil to an options object
1441
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1442
+
1443
+ # Customize the options with defaults
1444
+ metadata = @config.rpcs.get_version.metadata.to_h
1445
+
1446
+ # Set x-goog-api-client and x-goog-user-project headers
1447
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1448
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1449
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1450
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1451
+
1452
+ header_params = {}
1453
+ if request.name
1454
+ header_params["name"] = request.name
1455
+ end
1456
+
1457
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1458
+ metadata[:"x-goog-request-params"] ||= request_params_header
1459
+
1460
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
1461
+ metadata: metadata,
1462
+ retry_policy: @config.rpcs.get_version.retry_policy
1463
+
1464
+ options.apply_defaults timeout: @config.timeout,
1465
+ metadata: @config.metadata,
1466
+ retry_policy: @config.retry_policy
1467
+
1468
+ @artifact_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
1469
+ yield response, operation if block_given?
1470
+ return response
1471
+ end
1472
+ rescue ::GRPC::BadStatus => e
1473
+ raise ::Google::Cloud::Error.from_error(e)
1474
+ end
1475
+
1476
+ ##
1477
+ # Deletes a version and all of its content. The returned operation will
1478
+ # complete once the version has been deleted.
1479
+ #
1480
+ # @overload delete_version(request, options = nil)
1481
+ # Pass arguments to `delete_version` via a request object, either of type
1482
+ # {::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest} or an equivalent Hash.
1483
+ #
1484
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest, ::Hash]
1485
+ # A request object representing the call parameters. Required. To specify no
1486
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1487
+ # @param options [::Gapic::CallOptions, ::Hash]
1488
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1489
+ #
1490
+ # @overload delete_version(name: nil, force: nil)
1491
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
1492
+ # least one keyword argument is required. To specify no parameters, or to keep all
1493
+ # the default parameter values, pass an empty Hash as a request object (see above).
1494
+ #
1495
+ # @param name [::String]
1496
+ # The name of the version to delete.
1497
+ # @param force [::Boolean]
1498
+ # By default, a version that is tagged may not be deleted. If force=true, the
1499
+ # version and any tags pointing to the version are deleted.
1500
+ #
1501
+ # @yield [response, operation] Access the result along with the RPC operation
1502
+ # @yieldparam response [::Gapic::Operation]
1503
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1504
+ #
1505
+ # @return [::Gapic::Operation]
1506
+ #
1507
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1508
+ #
1509
+ # @example Basic example
1510
+ # require "google/cloud/artifact_registry/v1"
1511
+ #
1512
+ # # Create a client object. The client can be reused for multiple calls.
1513
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1514
+ #
1515
+ # # Create a request. To set request fields, pass in keyword arguments.
1516
+ # request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new
1517
+ #
1518
+ # # Call the delete_version method.
1519
+ # result = client.delete_version request
1520
+ #
1521
+ # # The returned object is of type Gapic::Operation. You can use this
1522
+ # # object to check the status of an operation, cancel it, or wait
1523
+ # # for results. Here is how to block until completion:
1524
+ # result.wait_until_done! timeout: 60
1525
+ # if result.response?
1526
+ # p result.response
1527
+ # else
1528
+ # puts "Error!"
1529
+ # end
1530
+ #
1531
+ def delete_version request, options = nil
1532
+ raise ::ArgumentError, "request must be provided" if request.nil?
1533
+
1534
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest
1535
+
1536
+ # Converts hash and nil to an options object
1537
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1538
+
1539
+ # Customize the options with defaults
1540
+ metadata = @config.rpcs.delete_version.metadata.to_h
1541
+
1542
+ # Set x-goog-api-client and x-goog-user-project headers
1543
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1544
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1545
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1546
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1547
+
1548
+ header_params = {}
1549
+ if request.name
1550
+ header_params["name"] = request.name
1551
+ end
1552
+
1553
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1554
+ metadata[:"x-goog-request-params"] ||= request_params_header
1555
+
1556
+ options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
1557
+ metadata: metadata,
1558
+ retry_policy: @config.rpcs.delete_version.retry_policy
1559
+
1560
+ options.apply_defaults timeout: @config.timeout,
1561
+ metadata: @config.metadata,
1562
+ retry_policy: @config.retry_policy
1563
+
1564
+ @artifact_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
1565
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1566
+ yield response, operation if block_given?
1567
+ return response
1568
+ end
1569
+ rescue ::GRPC::BadStatus => e
1570
+ raise ::Google::Cloud::Error.from_error(e)
1571
+ end
1572
+
1573
+ ##
1574
+ # Lists files.
1575
+ #
1576
+ # @overload list_files(request, options = nil)
1577
+ # Pass arguments to `list_files` via a request object, either of type
1578
+ # {::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest} or an equivalent Hash.
1579
+ #
1580
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest, ::Hash]
1581
+ # A request object representing the call parameters. Required. To specify no
1582
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1583
+ # @param options [::Gapic::CallOptions, ::Hash]
1584
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1585
+ #
1586
+ # @overload list_files(parent: nil, filter: nil, page_size: nil, page_token: nil, order_by: nil)
1587
+ # Pass arguments to `list_files` via keyword arguments. Note that at
1588
+ # least one keyword argument is required. To specify no parameters, or to keep all
1589
+ # the default parameter values, pass an empty Hash as a request object (see above).
1590
+ #
1591
+ # @param parent [::String]
1592
+ # The name of the repository whose files will be listed. For example:
1593
+ # "projects/p1/locations/us-central1/repositories/repo1
1594
+ # @param filter [::String]
1595
+ # An expression for filtering the results of the request. Filter rules are
1596
+ # case insensitive. The fields eligible for filtering are:
1597
+ #
1598
+ # * `name`
1599
+ # * `owner`
1600
+ #
1601
+ # An example of using a filter:
1602
+ #
1603
+ # * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an
1604
+ # ID starting with "a/b/".
1605
+ # * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` -->
1606
+ # Files owned by the version `1.0` in package `pkg1`.
1607
+ # @param page_size [::Integer]
1608
+ # The maximum number of files to return.
1609
+ # @param page_token [::String]
1610
+ # The next_page_token value returned from a previous list request, if any.
1611
+ # @param order_by [::String]
1612
+ # The field to order the results by.
1613
+ #
1614
+ # @yield [response, operation] Access the result along with the RPC operation
1615
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>]
1616
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1617
+ #
1618
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::File>]
1619
+ #
1620
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1621
+ #
1622
+ # @example Basic example
1623
+ # require "google/cloud/artifact_registry/v1"
1624
+ #
1625
+ # # Create a client object. The client can be reused for multiple calls.
1626
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1627
+ #
1628
+ # # Create a request. To set request fields, pass in keyword arguments.
1629
+ # request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new
1630
+ #
1631
+ # # Call the list_files method.
1632
+ # result = client.list_files request
1633
+ #
1634
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1635
+ # # iterate over all elements by calling #each, and the enumerable
1636
+ # # will lazily make API calls to fetch subsequent pages. Other
1637
+ # # methods are also available for managing paging directly.
1638
+ # result.each do |response|
1639
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File.
1640
+ # p response
1641
+ # end
1642
+ #
1643
+ def list_files request, options = nil
1644
+ raise ::ArgumentError, "request must be provided" if request.nil?
1645
+
1646
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListFilesRequest
1647
+
1648
+ # Converts hash and nil to an options object
1649
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1650
+
1651
+ # Customize the options with defaults
1652
+ metadata = @config.rpcs.list_files.metadata.to_h
1653
+
1654
+ # Set x-goog-api-client and x-goog-user-project headers
1655
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1656
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1657
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1658
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1659
+
1660
+ header_params = {}
1661
+ if request.parent
1662
+ header_params["parent"] = request.parent
1663
+ end
1664
+
1665
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1666
+ metadata[:"x-goog-request-params"] ||= request_params_header
1667
+
1668
+ options.apply_defaults timeout: @config.rpcs.list_files.timeout,
1669
+ metadata: metadata,
1670
+ retry_policy: @config.rpcs.list_files.retry_policy
1671
+
1672
+ options.apply_defaults timeout: @config.timeout,
1673
+ metadata: @config.metadata,
1674
+ retry_policy: @config.retry_policy
1675
+
1676
+ @artifact_registry_stub.call_rpc :list_files, request, options: options do |response, operation|
1677
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_files, request, response, operation, options
1678
+ yield response, operation if block_given?
1679
+ return response
1680
+ end
1681
+ rescue ::GRPC::BadStatus => e
1682
+ raise ::Google::Cloud::Error.from_error(e)
1683
+ end
1684
+
1685
+ ##
1686
+ # Gets a file.
1687
+ #
1688
+ # @overload get_file(request, options = nil)
1689
+ # Pass arguments to `get_file` via a request object, either of type
1690
+ # {::Google::Cloud::ArtifactRegistry::V1::GetFileRequest} or an equivalent Hash.
1691
+ #
1692
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetFileRequest, ::Hash]
1693
+ # A request object representing the call parameters. Required. To specify no
1694
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1695
+ # @param options [::Gapic::CallOptions, ::Hash]
1696
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1697
+ #
1698
+ # @overload get_file(name: nil)
1699
+ # Pass arguments to `get_file` via keyword arguments. Note that at
1700
+ # least one keyword argument is required. To specify no parameters, or to keep all
1701
+ # the default parameter values, pass an empty Hash as a request object (see above).
1702
+ #
1703
+ # @param name [::String]
1704
+ # The name of the file to retrieve.
1705
+ #
1706
+ # @yield [response, operation] Access the result along with the RPC operation
1707
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::File]
1708
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1709
+ #
1710
+ # @return [::Google::Cloud::ArtifactRegistry::V1::File]
1711
+ #
1712
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1713
+ #
1714
+ # @example Basic example
1715
+ # require "google/cloud/artifact_registry/v1"
1716
+ #
1717
+ # # Create a client object. The client can be reused for multiple calls.
1718
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1719
+ #
1720
+ # # Create a request. To set request fields, pass in keyword arguments.
1721
+ # request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new
1722
+ #
1723
+ # # Call the get_file method.
1724
+ # result = client.get_file request
1725
+ #
1726
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::File.
1727
+ # p result
1728
+ #
1729
+ def get_file request, options = nil
1730
+ raise ::ArgumentError, "request must be provided" if request.nil?
1731
+
1732
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetFileRequest
1733
+
1734
+ # Converts hash and nil to an options object
1735
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1736
+
1737
+ # Customize the options with defaults
1738
+ metadata = @config.rpcs.get_file.metadata.to_h
1739
+
1740
+ # Set x-goog-api-client and x-goog-user-project headers
1741
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1742
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1743
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1744
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1745
+
1746
+ header_params = {}
1747
+ if request.name
1748
+ header_params["name"] = request.name
1749
+ end
1750
+
1751
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1752
+ metadata[:"x-goog-request-params"] ||= request_params_header
1753
+
1754
+ options.apply_defaults timeout: @config.rpcs.get_file.timeout,
1755
+ metadata: metadata,
1756
+ retry_policy: @config.rpcs.get_file.retry_policy
1757
+
1758
+ options.apply_defaults timeout: @config.timeout,
1759
+ metadata: @config.metadata,
1760
+ retry_policy: @config.retry_policy
1761
+
1762
+ @artifact_registry_stub.call_rpc :get_file, request, options: options do |response, operation|
1763
+ yield response, operation if block_given?
1764
+ return response
1765
+ end
1766
+ rescue ::GRPC::BadStatus => e
1767
+ raise ::Google::Cloud::Error.from_error(e)
1768
+ end
1769
+
1770
+ ##
1771
+ # Lists tags.
1772
+ #
1773
+ # @overload list_tags(request, options = nil)
1774
+ # Pass arguments to `list_tags` via a request object, either of type
1775
+ # {::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest} or an equivalent Hash.
1776
+ #
1777
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest, ::Hash]
1778
+ # A request object representing the call parameters. Required. To specify no
1779
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1780
+ # @param options [::Gapic::CallOptions, ::Hash]
1781
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1782
+ #
1783
+ # @overload list_tags(parent: nil, filter: nil, page_size: nil, page_token: nil)
1784
+ # Pass arguments to `list_tags` via keyword arguments. Note that at
1785
+ # least one keyword argument is required. To specify no parameters, or to keep all
1786
+ # the default parameter values, pass an empty Hash as a request object (see above).
1787
+ #
1788
+ # @param parent [::String]
1789
+ # The name of the parent resource whose tags will be listed.
1790
+ # @param filter [::String]
1791
+ # An expression for filtering the results of the request. Filter rules are
1792
+ # case insensitive. The fields eligible for filtering are:
1793
+ #
1794
+ # * `version`
1795
+ #
1796
+ # An example of using a filter:
1797
+ #
1798
+ # * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"`
1799
+ # --> Tags that are applied to the version `1.0` in package `pkg1`.
1800
+ # @param page_size [::Integer]
1801
+ # The maximum number of tags to return. Maximum page size is 10,000.
1802
+ # @param page_token [::String]
1803
+ # The next_page_token value returned from a previous list request, if any.
1804
+ #
1805
+ # @yield [response, operation] Access the result along with the RPC operation
1806
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>]
1807
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1808
+ #
1809
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Tag>]
1810
+ #
1811
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1812
+ #
1813
+ # @example Basic example
1814
+ # require "google/cloud/artifact_registry/v1"
1815
+ #
1816
+ # # Create a client object. The client can be reused for multiple calls.
1817
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1818
+ #
1819
+ # # Create a request. To set request fields, pass in keyword arguments.
1820
+ # request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new
1821
+ #
1822
+ # # Call the list_tags method.
1823
+ # result = client.list_tags request
1824
+ #
1825
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1826
+ # # iterate over all elements by calling #each, and the enumerable
1827
+ # # will lazily make API calls to fetch subsequent pages. Other
1828
+ # # methods are also available for managing paging directly.
1829
+ # result.each do |response|
1830
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag.
1831
+ # p response
1832
+ # end
1833
+ #
1834
+ def list_tags request, options = nil
1835
+ raise ::ArgumentError, "request must be provided" if request.nil?
1836
+
1837
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListTagsRequest
1838
+
1839
+ # Converts hash and nil to an options object
1840
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1841
+
1842
+ # Customize the options with defaults
1843
+ metadata = @config.rpcs.list_tags.metadata.to_h
1844
+
1845
+ # Set x-goog-api-client and x-goog-user-project headers
1846
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1847
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1848
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1849
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1850
+
1851
+ header_params = {}
1852
+ if request.parent
1853
+ header_params["parent"] = request.parent
1854
+ end
1855
+
1856
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1857
+ metadata[:"x-goog-request-params"] ||= request_params_header
1858
+
1859
+ options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
1860
+ metadata: metadata,
1861
+ retry_policy: @config.rpcs.list_tags.retry_policy
1862
+
1863
+ options.apply_defaults timeout: @config.timeout,
1864
+ metadata: @config.metadata,
1865
+ retry_policy: @config.retry_policy
1866
+
1867
+ @artifact_registry_stub.call_rpc :list_tags, request, options: options do |response, operation|
1868
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_tags, request, response, operation, options
1869
+ yield response, operation if block_given?
1870
+ return response
1871
+ end
1872
+ rescue ::GRPC::BadStatus => e
1873
+ raise ::Google::Cloud::Error.from_error(e)
1874
+ end
1875
+
1876
+ ##
1877
+ # Gets a tag.
1878
+ #
1879
+ # @overload get_tag(request, options = nil)
1880
+ # Pass arguments to `get_tag` via a request object, either of type
1881
+ # {::Google::Cloud::ArtifactRegistry::V1::GetTagRequest} or an equivalent Hash.
1882
+ #
1883
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetTagRequest, ::Hash]
1884
+ # A request object representing the call parameters. Required. To specify no
1885
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1886
+ # @param options [::Gapic::CallOptions, ::Hash]
1887
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1888
+ #
1889
+ # @overload get_tag(name: nil)
1890
+ # Pass arguments to `get_tag` via keyword arguments. Note that at
1891
+ # least one keyword argument is required. To specify no parameters, or to keep all
1892
+ # the default parameter values, pass an empty Hash as a request object (see above).
1893
+ #
1894
+ # @param name [::String]
1895
+ # The name of the tag to retrieve.
1896
+ #
1897
+ # @yield [response, operation] Access the result along with the RPC operation
1898
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
1899
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1900
+ #
1901
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
1902
+ #
1903
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1904
+ #
1905
+ # @example Basic example
1906
+ # require "google/cloud/artifact_registry/v1"
1907
+ #
1908
+ # # Create a client object. The client can be reused for multiple calls.
1909
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1910
+ #
1911
+ # # Create a request. To set request fields, pass in keyword arguments.
1912
+ # request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new
1913
+ #
1914
+ # # Call the get_tag method.
1915
+ # result = client.get_tag request
1916
+ #
1917
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
1918
+ # p result
1919
+ #
1920
+ def get_tag request, options = nil
1921
+ raise ::ArgumentError, "request must be provided" if request.nil?
1922
+
1923
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetTagRequest
1924
+
1925
+ # Converts hash and nil to an options object
1926
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1927
+
1928
+ # Customize the options with defaults
1929
+ metadata = @config.rpcs.get_tag.metadata.to_h
1930
+
1931
+ # Set x-goog-api-client and x-goog-user-project headers
1932
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1933
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1934
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
1935
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1936
+
1937
+ header_params = {}
1938
+ if request.name
1939
+ header_params["name"] = request.name
1940
+ end
1941
+
1942
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1943
+ metadata[:"x-goog-request-params"] ||= request_params_header
1944
+
1945
+ options.apply_defaults timeout: @config.rpcs.get_tag.timeout,
1946
+ metadata: metadata,
1947
+ retry_policy: @config.rpcs.get_tag.retry_policy
1948
+
1949
+ options.apply_defaults timeout: @config.timeout,
1950
+ metadata: @config.metadata,
1951
+ retry_policy: @config.retry_policy
1952
+
1953
+ @artifact_registry_stub.call_rpc :get_tag, request, options: options do |response, operation|
1954
+ yield response, operation if block_given?
1955
+ return response
1956
+ end
1957
+ rescue ::GRPC::BadStatus => e
1958
+ raise ::Google::Cloud::Error.from_error(e)
1959
+ end
1960
+
1961
+ ##
1962
+ # Creates a tag.
1963
+ #
1964
+ # @overload create_tag(request, options = nil)
1965
+ # Pass arguments to `create_tag` via a request object, either of type
1966
+ # {::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest} or an equivalent Hash.
1967
+ #
1968
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest, ::Hash]
1969
+ # A request object representing the call parameters. Required. To specify no
1970
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1971
+ # @param options [::Gapic::CallOptions, ::Hash]
1972
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1973
+ #
1974
+ # @overload create_tag(parent: nil, tag_id: nil, tag: nil)
1975
+ # Pass arguments to `create_tag` via keyword arguments. Note that at
1976
+ # least one keyword argument is required. To specify no parameters, or to keep all
1977
+ # the default parameter values, pass an empty Hash as a request object (see above).
1978
+ #
1979
+ # @param parent [::String]
1980
+ # The name of the parent resource where the tag will be created.
1981
+ # @param tag_id [::String]
1982
+ # The tag id to use for this repository.
1983
+ # @param tag [::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash]
1984
+ # The tag to be created.
1985
+ #
1986
+ # @yield [response, operation] Access the result along with the RPC operation
1987
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
1988
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1989
+ #
1990
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
1991
+ #
1992
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1993
+ #
1994
+ # @example Basic example
1995
+ # require "google/cloud/artifact_registry/v1"
1996
+ #
1997
+ # # Create a client object. The client can be reused for multiple calls.
1998
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
1999
+ #
2000
+ # # Create a request. To set request fields, pass in keyword arguments.
2001
+ # request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new
2002
+ #
2003
+ # # Call the create_tag method.
2004
+ # result = client.create_tag request
2005
+ #
2006
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
2007
+ # p result
2008
+ #
2009
+ def create_tag request, options = nil
2010
+ raise ::ArgumentError, "request must be provided" if request.nil?
2011
+
2012
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::CreateTagRequest
2013
+
2014
+ # Converts hash and nil to an options object
2015
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2016
+
2017
+ # Customize the options with defaults
2018
+ metadata = @config.rpcs.create_tag.metadata.to_h
2019
+
2020
+ # Set x-goog-api-client and x-goog-user-project headers
2021
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2022
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2023
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
2024
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2025
+
2026
+ header_params = {}
2027
+ if request.parent
2028
+ header_params["parent"] = request.parent
2029
+ end
2030
+
2031
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2032
+ metadata[:"x-goog-request-params"] ||= request_params_header
2033
+
2034
+ options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
2035
+ metadata: metadata,
2036
+ retry_policy: @config.rpcs.create_tag.retry_policy
2037
+
2038
+ options.apply_defaults timeout: @config.timeout,
2039
+ metadata: @config.metadata,
2040
+ retry_policy: @config.retry_policy
2041
+
2042
+ @artifact_registry_stub.call_rpc :create_tag, request, options: options do |response, operation|
2043
+ yield response, operation if block_given?
2044
+ return response
2045
+ end
2046
+ rescue ::GRPC::BadStatus => e
2047
+ raise ::Google::Cloud::Error.from_error(e)
2048
+ end
2049
+
2050
+ ##
2051
+ # Updates a tag.
2052
+ #
2053
+ # @overload update_tag(request, options = nil)
2054
+ # Pass arguments to `update_tag` via a request object, either of type
2055
+ # {::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest} or an equivalent Hash.
2056
+ #
2057
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest, ::Hash]
2058
+ # A request object representing the call parameters. Required. To specify no
2059
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2060
+ # @param options [::Gapic::CallOptions, ::Hash]
2061
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2062
+ #
2063
+ # @overload update_tag(tag: nil, update_mask: nil)
2064
+ # Pass arguments to `update_tag` via keyword arguments. Note that at
2065
+ # least one keyword argument is required. To specify no parameters, or to keep all
2066
+ # the default parameter values, pass an empty Hash as a request object (see above).
2067
+ #
2068
+ # @param tag [::Google::Cloud::ArtifactRegistry::V1::Tag, ::Hash]
2069
+ # The tag that replaces the resource on the server.
2070
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2071
+ # The update mask applies to the resource. For the `FieldMask` definition,
2072
+ # see
2073
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
2074
+ #
2075
+ # @yield [response, operation] Access the result along with the RPC operation
2076
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Tag]
2077
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2078
+ #
2079
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Tag]
2080
+ #
2081
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2082
+ #
2083
+ # @example Basic example
2084
+ # require "google/cloud/artifact_registry/v1"
2085
+ #
2086
+ # # Create a client object. The client can be reused for multiple calls.
2087
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
2088
+ #
2089
+ # # Create a request. To set request fields, pass in keyword arguments.
2090
+ # request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new
2091
+ #
2092
+ # # Call the update_tag method.
2093
+ # result = client.update_tag request
2094
+ #
2095
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag.
2096
+ # p result
2097
+ #
2098
+ def update_tag request, options = nil
2099
+ raise ::ArgumentError, "request must be provided" if request.nil?
2100
+
2101
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest
2102
+
2103
+ # Converts hash and nil to an options object
2104
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2105
+
2106
+ # Customize the options with defaults
2107
+ metadata = @config.rpcs.update_tag.metadata.to_h
2108
+
2109
+ # Set x-goog-api-client and x-goog-user-project headers
2110
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2111
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2112
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
2113
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2114
+
2115
+ header_params = {}
2116
+ if request.tag&.name
2117
+ header_params["tag.name"] = request.tag.name
2118
+ end
2119
+
2120
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2121
+ metadata[:"x-goog-request-params"] ||= request_params_header
2122
+
2123
+ options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
2124
+ metadata: metadata,
2125
+ retry_policy: @config.rpcs.update_tag.retry_policy
2126
+
2127
+ options.apply_defaults timeout: @config.timeout,
2128
+ metadata: @config.metadata,
2129
+ retry_policy: @config.retry_policy
2130
+
2131
+ @artifact_registry_stub.call_rpc :update_tag, request, options: options do |response, operation|
2132
+ yield response, operation if block_given?
2133
+ return response
2134
+ end
2135
+ rescue ::GRPC::BadStatus => e
2136
+ raise ::Google::Cloud::Error.from_error(e)
2137
+ end
2138
+
2139
+ ##
2140
+ # Deletes a tag.
2141
+ #
2142
+ # @overload delete_tag(request, options = nil)
2143
+ # Pass arguments to `delete_tag` via a request object, either of type
2144
+ # {::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest} or an equivalent Hash.
2145
+ #
2146
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest, ::Hash]
2147
+ # A request object representing the call parameters. Required. To specify no
2148
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2149
+ # @param options [::Gapic::CallOptions, ::Hash]
2150
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2151
+ #
2152
+ # @overload delete_tag(name: nil)
2153
+ # Pass arguments to `delete_tag` via keyword arguments. Note that at
2154
+ # least one keyword argument is required. To specify no parameters, or to keep all
2155
+ # the default parameter values, pass an empty Hash as a request object (see above).
2156
+ #
2157
+ # @param name [::String]
2158
+ # The name of the tag to delete.
2159
+ #
2160
+ # @yield [response, operation] Access the result along with the RPC operation
2161
+ # @yieldparam response [::Google::Protobuf::Empty]
2162
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2163
+ #
2164
+ # @return [::Google::Protobuf::Empty]
2165
+ #
2166
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2167
+ #
2168
+ # @example Basic example
2169
+ # require "google/cloud/artifact_registry/v1"
2170
+ #
2171
+ # # Create a client object. The client can be reused for multiple calls.
2172
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
2173
+ #
2174
+ # # Create a request. To set request fields, pass in keyword arguments.
2175
+ # request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new
2176
+ #
2177
+ # # Call the delete_tag method.
2178
+ # result = client.delete_tag request
2179
+ #
2180
+ # # The returned object is of type Google::Protobuf::Empty.
2181
+ # p result
2182
+ #
2183
+ def delete_tag request, options = nil
2184
+ raise ::ArgumentError, "request must be provided" if request.nil?
2185
+
2186
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest
2187
+
2188
+ # Converts hash and nil to an options object
2189
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2190
+
2191
+ # Customize the options with defaults
2192
+ metadata = @config.rpcs.delete_tag.metadata.to_h
2193
+
2194
+ # Set x-goog-api-client and x-goog-user-project headers
2195
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2196
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2197
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
2198
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2199
+
2200
+ header_params = {}
2201
+ if request.name
2202
+ header_params["name"] = request.name
2203
+ end
2204
+
2205
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2206
+ metadata[:"x-goog-request-params"] ||= request_params_header
2207
+
2208
+ options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
2209
+ metadata: metadata,
2210
+ retry_policy: @config.rpcs.delete_tag.retry_policy
2211
+
2212
+ options.apply_defaults timeout: @config.timeout,
2213
+ metadata: @config.metadata,
2214
+ retry_policy: @config.retry_policy
2215
+
2216
+ @artifact_registry_stub.call_rpc :delete_tag, request, options: options do |response, operation|
2217
+ yield response, operation if block_given?
2218
+ return response
2219
+ end
2220
+ rescue ::GRPC::BadStatus => e
2221
+ raise ::Google::Cloud::Error.from_error(e)
2222
+ end
2223
+
2224
+ ##
2225
+ # Updates the IAM policy for a given resource.
2226
+ #
2227
+ # @overload set_iam_policy(request, options = nil)
2228
+ # Pass arguments to `set_iam_policy` via a request object, either of type
2229
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
2230
+ #
2231
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
2232
+ # A request object representing the call parameters. Required. To specify no
2233
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2234
+ # @param options [::Gapic::CallOptions, ::Hash]
2235
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2236
+ #
2237
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
2238
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
2239
+ # least one keyword argument is required. To specify no parameters, or to keep all
2240
+ # the default parameter values, pass an empty Hash as a request object (see above).
2241
+ #
2242
+ # @param resource [::String]
2243
+ # REQUIRED: The resource for which the policy is being specified.
2244
+ # See the operation documentation for the appropriate value for this field.
2245
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
2246
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
2247
+ # the policy is limited to a few 10s of KB. An empty policy is a
2248
+ # valid policy but certain Cloud Platform services (such as Projects)
2249
+ # might reject them.
2250
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2251
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
2252
+ # the fields in the mask will be modified. If no mask is provided, the
2253
+ # following default mask is used:
2254
+ #
2255
+ # `paths: "bindings, etag"`
2256
+ #
2257
+ # @yield [response, operation] Access the result along with the RPC operation
2258
+ # @yieldparam response [::Google::Iam::V1::Policy]
2259
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2260
+ #
2261
+ # @return [::Google::Iam::V1::Policy]
2262
+ #
2263
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2264
+ #
2265
+ # @example Basic example
2266
+ # require "google/cloud/artifact_registry/v1"
2267
+ #
2268
+ # # Create a client object. The client can be reused for multiple calls.
2269
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
2270
+ #
2271
+ # # Create a request. To set request fields, pass in keyword arguments.
2272
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
2273
+ #
2274
+ # # Call the set_iam_policy method.
2275
+ # result = client.set_iam_policy request
2276
+ #
2277
+ # # The returned object is of type Google::Iam::V1::Policy.
2278
+ # p result
2279
+ #
2280
+ def set_iam_policy request, options = nil
2281
+ raise ::ArgumentError, "request must be provided" if request.nil?
2282
+
2283
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
2284
+
2285
+ # Converts hash and nil to an options object
2286
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2287
+
2288
+ # Customize the options with defaults
2289
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
2290
+
2291
+ # Set x-goog-api-client and x-goog-user-project headers
2292
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2293
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2294
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
2295
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2296
+
2297
+ header_params = {}
2298
+ if request.resource
2299
+ header_params["resource"] = request.resource
2300
+ end
2301
+
2302
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2303
+ metadata[:"x-goog-request-params"] ||= request_params_header
2304
+
2305
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
2306
+ metadata: metadata,
2307
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
2308
+
2309
+ options.apply_defaults timeout: @config.timeout,
2310
+ metadata: @config.metadata,
2311
+ retry_policy: @config.retry_policy
2312
+
2313
+ @artifact_registry_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
2314
+ yield response, operation if block_given?
2315
+ return response
2316
+ end
2317
+ rescue ::GRPC::BadStatus => e
2318
+ raise ::Google::Cloud::Error.from_error(e)
2319
+ end
160
2320
 
161
2321
  ##
162
- # Lists docker images.
2322
+ # Gets the IAM policy for a given resource.
163
2323
  #
164
- # @overload list_docker_images(request, options = nil)
165
- # Pass arguments to `list_docker_images` via a request object, either of type
166
- # {::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest} or an equivalent Hash.
2324
+ # @overload get_iam_policy(request, options = nil)
2325
+ # Pass arguments to `get_iam_policy` via a request object, either of type
2326
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
167
2327
  #
168
- # @param request [::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash]
2328
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
169
2329
  # A request object representing the call parameters. Required. To specify no
170
2330
  # parameters, or to keep all the default parameter values, pass an empty Hash.
171
2331
  # @param options [::Gapic::CallOptions, ::Hash]
172
2332
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
173
2333
  #
174
- # @overload list_docker_images(parent: nil, page_size: nil, page_token: nil)
175
- # Pass arguments to `list_docker_images` via keyword arguments. Note that at
2334
+ # @overload get_iam_policy(resource: nil, options: nil)
2335
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
176
2336
  # least one keyword argument is required. To specify no parameters, or to keep all
177
2337
  # the default parameter values, pass an empty Hash as a request object (see above).
178
2338
  #
179
- # @param parent [::String]
180
- # Required. The name of the parent resource whose docker images will be listed.
181
- # @param page_size [::Integer]
182
- # The maximum number of artifacts to return.
183
- # @param page_token [::String]
184
- # The next_page_token value returned from a previous list request, if any.
2339
+ # @param resource [::String]
2340
+ # REQUIRED: The resource for which the policy is being requested.
2341
+ # See the operation documentation for the appropriate value for this field.
2342
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
2343
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
2344
+ # `GetIamPolicy`.
185
2345
  #
186
2346
  # @yield [response, operation] Access the result along with the RPC operation
187
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
2347
+ # @yieldparam response [::Google::Iam::V1::Policy]
188
2348
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
189
2349
  #
190
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
2350
+ # @return [::Google::Iam::V1::Policy]
191
2351
  #
192
2352
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
193
2353
  #
@@ -198,30 +2358,24 @@ module Google
198
2358
  # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
199
2359
  #
200
2360
  # # Create a request. To set request fields, pass in keyword arguments.
201
- # request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new
2361
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
202
2362
  #
203
- # # Call the list_docker_images method.
204
- # result = client.list_docker_images request
2363
+ # # Call the get_iam_policy method.
2364
+ # result = client.get_iam_policy request
205
2365
  #
206
- # # The returned object is of type Gapic::PagedEnumerable. You can
207
- # # iterate over all elements by calling #each, and the enumerable
208
- # # will lazily make API calls to fetch subsequent pages. Other
209
- # # methods are also available for managing paging directly.
210
- # result.each do |response|
211
- # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage.
212
- # p response
213
- # end
2366
+ # # The returned object is of type Google::Iam::V1::Policy.
2367
+ # p result
214
2368
  #
215
- def list_docker_images request, options = nil
2369
+ def get_iam_policy request, options = nil
216
2370
  raise ::ArgumentError, "request must be provided" if request.nil?
217
2371
 
218
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest
2372
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
219
2373
 
220
2374
  # Converts hash and nil to an options object
221
2375
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
222
2376
 
223
2377
  # Customize the options with defaults
224
- metadata = @config.rpcs.list_docker_images.metadata.to_h
2378
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
225
2379
 
226
2380
  # Set x-goog-api-client and x-goog-user-project headers
227
2381
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -230,23 +2384,22 @@ module Google
230
2384
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
2385
 
232
2386
  header_params = {}
233
- if request.parent
234
- header_params["parent"] = request.parent
2387
+ if request.resource
2388
+ header_params["resource"] = request.resource
235
2389
  end
236
2390
 
237
2391
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
238
2392
  metadata[:"x-goog-request-params"] ||= request_params_header
239
2393
 
240
- options.apply_defaults timeout: @config.rpcs.list_docker_images.timeout,
2394
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
241
2395
  metadata: metadata,
242
- retry_policy: @config.rpcs.list_docker_images.retry_policy
2396
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
243
2397
 
244
2398
  options.apply_defaults timeout: @config.timeout,
245
2399
  metadata: @config.metadata,
246
2400
  retry_policy: @config.retry_policy
247
2401
 
248
- @artifact_registry_stub.call_rpc :list_docker_images, request, options: options do |response, operation|
249
- response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
2402
+ @artifact_registry_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
250
2403
  yield response, operation if block_given?
251
2404
  return response
252
2405
  end
@@ -255,35 +2408,37 @@ module Google
255
2408
  end
256
2409
 
257
2410
  ##
258
- # Lists repositories.
2411
+ # Tests if the caller has a list of permissions on a resource.
259
2412
  #
260
- # @overload list_repositories(request, options = nil)
261
- # Pass arguments to `list_repositories` via a request object, either of type
262
- # {::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest} or an equivalent Hash.
2413
+ # @overload test_iam_permissions(request, options = nil)
2414
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
2415
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
263
2416
  #
264
- # @param request [::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash]
2417
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
265
2418
  # A request object representing the call parameters. Required. To specify no
266
2419
  # parameters, or to keep all the default parameter values, pass an empty Hash.
267
2420
  # @param options [::Gapic::CallOptions, ::Hash]
268
2421
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
269
2422
  #
270
- # @overload list_repositories(parent: nil, page_size: nil, page_token: nil)
271
- # Pass arguments to `list_repositories` via keyword arguments. Note that at
2423
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
2424
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
272
2425
  # least one keyword argument is required. To specify no parameters, or to keep all
273
2426
  # the default parameter values, pass an empty Hash as a request object (see above).
274
2427
  #
275
- # @param parent [::String]
276
- # Required. The name of the parent resource whose repositories will be listed.
277
- # @param page_size [::Integer]
278
- # The maximum number of repositories to return.
279
- # @param page_token [::String]
280
- # The next_page_token value returned from a previous list request, if any.
2428
+ # @param resource [::String]
2429
+ # REQUIRED: The resource for which the policy detail is being requested.
2430
+ # See the operation documentation for the appropriate value for this field.
2431
+ # @param permissions [::Array<::String>]
2432
+ # The set of permissions to check for the `resource`. Permissions with
2433
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
2434
+ # information see
2435
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
281
2436
  #
282
2437
  # @yield [response, operation] Access the result along with the RPC operation
283
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
2438
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
284
2439
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
285
2440
  #
286
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
2441
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
287
2442
  #
288
2443
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
2444
  #
@@ -294,30 +2449,24 @@ module Google
294
2449
  # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
295
2450
  #
296
2451
  # # Create a request. To set request fields, pass in keyword arguments.
297
- # request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new
2452
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
298
2453
  #
299
- # # Call the list_repositories method.
300
- # result = client.list_repositories request
2454
+ # # Call the test_iam_permissions method.
2455
+ # result = client.test_iam_permissions request
301
2456
  #
302
- # # The returned object is of type Gapic::PagedEnumerable. You can
303
- # # iterate over all elements by calling #each, and the enumerable
304
- # # will lazily make API calls to fetch subsequent pages. Other
305
- # # methods are also available for managing paging directly.
306
- # result.each do |response|
307
- # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository.
308
- # p response
309
- # end
2457
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
2458
+ # p result
310
2459
  #
311
- def list_repositories request, options = nil
2460
+ def test_iam_permissions request, options = nil
312
2461
  raise ::ArgumentError, "request must be provided" if request.nil?
313
2462
 
314
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest
2463
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
315
2464
 
316
2465
  # Converts hash and nil to an options object
317
2466
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
318
2467
 
319
2468
  # Customize the options with defaults
320
- metadata = @config.rpcs.list_repositories.metadata.to_h
2469
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
321
2470
 
322
2471
  # Set x-goog-api-client and x-goog-user-project headers
323
2472
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -326,23 +2475,22 @@ module Google
326
2475
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
327
2476
 
328
2477
  header_params = {}
329
- if request.parent
330
- header_params["parent"] = request.parent
2478
+ if request.resource
2479
+ header_params["resource"] = request.resource
331
2480
  end
332
2481
 
333
2482
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
334
2483
  metadata[:"x-goog-request-params"] ||= request_params_header
335
2484
 
336
- options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
2485
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
337
2486
  metadata: metadata,
338
- retry_policy: @config.rpcs.list_repositories.retry_policy
2487
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
339
2488
 
340
2489
  options.apply_defaults timeout: @config.timeout,
341
2490
  metadata: @config.metadata,
342
2491
  retry_policy: @config.retry_policy
343
2492
 
344
- @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
345
- response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
2493
+ @artifact_registry_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
346
2494
  yield response, operation if block_given?
347
2495
  return response
348
2496
  end
@@ -351,31 +2499,31 @@ module Google
351
2499
  end
352
2500
 
353
2501
  ##
354
- # Gets a repository.
2502
+ # Retrieves the Settings for the Project.
355
2503
  #
356
- # @overload get_repository(request, options = nil)
357
- # Pass arguments to `get_repository` via a request object, either of type
358
- # {::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest} or an equivalent Hash.
2504
+ # @overload get_project_settings(request, options = nil)
2505
+ # Pass arguments to `get_project_settings` via a request object, either of type
2506
+ # {::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest} or an equivalent Hash.
359
2507
  #
360
- # @param request [::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash]
2508
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest, ::Hash]
361
2509
  # A request object representing the call parameters. Required. To specify no
362
2510
  # parameters, or to keep all the default parameter values, pass an empty Hash.
363
2511
  # @param options [::Gapic::CallOptions, ::Hash]
364
2512
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
365
2513
  #
366
- # @overload get_repository(name: nil)
367
- # Pass arguments to `get_repository` via keyword arguments. Note that at
2514
+ # @overload get_project_settings(name: nil)
2515
+ # Pass arguments to `get_project_settings` via keyword arguments. Note that at
368
2516
  # least one keyword argument is required. To specify no parameters, or to keep all
369
2517
  # the default parameter values, pass an empty Hash as a request object (see above).
370
2518
  #
371
2519
  # @param name [::String]
372
- # Required. The name of the repository to retrieve.
2520
+ # Required. The name of the projectSettings resource.
373
2521
  #
374
2522
  # @yield [response, operation] Access the result along with the RPC operation
375
- # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
2523
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
376
2524
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
377
2525
  #
378
- # @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
2526
+ # @return [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
379
2527
  #
380
2528
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
381
2529
  #
@@ -386,24 +2534,24 @@ module Google
386
2534
  # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
387
2535
  #
388
2536
  # # Create a request. To set request fields, pass in keyword arguments.
389
- # request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new
2537
+ # request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new
390
2538
  #
391
- # # Call the get_repository method.
392
- # result = client.get_repository request
2539
+ # # Call the get_project_settings method.
2540
+ # result = client.get_project_settings request
393
2541
  #
394
- # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository.
2542
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
395
2543
  # p result
396
2544
  #
397
- def get_repository request, options = nil
2545
+ def get_project_settings request, options = nil
398
2546
  raise ::ArgumentError, "request must be provided" if request.nil?
399
2547
 
400
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest
2548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest
401
2549
 
402
2550
  # Converts hash and nil to an options object
403
2551
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
404
2552
 
405
2553
  # Customize the options with defaults
406
- metadata = @config.rpcs.get_repository.metadata.to_h
2554
+ metadata = @config.rpcs.get_project_settings.metadata.to_h
407
2555
 
408
2556
  # Set x-goog-api-client and x-goog-user-project headers
409
2557
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -419,15 +2567,102 @@ module Google
419
2567
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
420
2568
  metadata[:"x-goog-request-params"] ||= request_params_header
421
2569
 
422
- options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
2570
+ options.apply_defaults timeout: @config.rpcs.get_project_settings.timeout,
423
2571
  metadata: metadata,
424
- retry_policy: @config.rpcs.get_repository.retry_policy
2572
+ retry_policy: @config.rpcs.get_project_settings.retry_policy
425
2573
 
426
2574
  options.apply_defaults timeout: @config.timeout,
427
2575
  metadata: @config.metadata,
428
2576
  retry_policy: @config.retry_policy
429
2577
 
430
- @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
2578
+ @artifact_registry_stub.call_rpc :get_project_settings, request, options: options do |response, operation|
2579
+ yield response, operation if block_given?
2580
+ return response
2581
+ end
2582
+ rescue ::GRPC::BadStatus => e
2583
+ raise ::Google::Cloud::Error.from_error(e)
2584
+ end
2585
+
2586
+ ##
2587
+ # Updates the Settings for the Project.
2588
+ #
2589
+ # @overload update_project_settings(request, options = nil)
2590
+ # Pass arguments to `update_project_settings` via a request object, either of type
2591
+ # {::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest} or an equivalent Hash.
2592
+ #
2593
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest, ::Hash]
2594
+ # A request object representing the call parameters. Required. To specify no
2595
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2596
+ # @param options [::Gapic::CallOptions, ::Hash]
2597
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2598
+ #
2599
+ # @overload update_project_settings(project_settings: nil, update_mask: nil)
2600
+ # Pass arguments to `update_project_settings` via keyword arguments. Note that at
2601
+ # least one keyword argument is required. To specify no parameters, or to keep all
2602
+ # the default parameter values, pass an empty Hash as a request object (see above).
2603
+ #
2604
+ # @param project_settings [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings, ::Hash]
2605
+ # The project settings.
2606
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2607
+ # Field mask to support partial updates.
2608
+ #
2609
+ # @yield [response, operation] Access the result along with the RPC operation
2610
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
2611
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2612
+ #
2613
+ # @return [::Google::Cloud::ArtifactRegistry::V1::ProjectSettings]
2614
+ #
2615
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2616
+ #
2617
+ # @example Basic example
2618
+ # require "google/cloud/artifact_registry/v1"
2619
+ #
2620
+ # # Create a client object. The client can be reused for multiple calls.
2621
+ # client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
2622
+ #
2623
+ # # Create a request. To set request fields, pass in keyword arguments.
2624
+ # request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new
2625
+ #
2626
+ # # Call the update_project_settings method.
2627
+ # result = client.update_project_settings request
2628
+ #
2629
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings.
2630
+ # p result
2631
+ #
2632
+ def update_project_settings request, options = nil
2633
+ raise ::ArgumentError, "request must be provided" if request.nil?
2634
+
2635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest
2636
+
2637
+ # Converts hash and nil to an options object
2638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2639
+
2640
+ # Customize the options with defaults
2641
+ metadata = @config.rpcs.update_project_settings.metadata.to_h
2642
+
2643
+ # Set x-goog-api-client and x-goog-user-project headers
2644
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2645
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2646
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
2647
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2648
+
2649
+ header_params = {}
2650
+ if request.project_settings&.name
2651
+ header_params["project_settings.name"] = request.project_settings.name
2652
+ end
2653
+
2654
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2655
+ metadata[:"x-goog-request-params"] ||= request_params_header
2656
+
2657
+ options.apply_defaults timeout: @config.rpcs.update_project_settings.timeout,
2658
+ metadata: metadata,
2659
+ retry_policy: @config.rpcs.update_project_settings.retry_policy
2660
+
2661
+ options.apply_defaults timeout: @config.timeout,
2662
+ metadata: @config.metadata,
2663
+ retry_policy: @config.retry_policy
2664
+
2665
+ @artifact_registry_stub.call_rpc :update_project_settings, request, options: options do |response, operation|
431
2666
  yield response, operation if block_given?
432
2667
  return response
433
2668
  end
@@ -576,6 +2811,21 @@ module Google
576
2811
  #
577
2812
  attr_reader :list_docker_images
578
2813
  ##
2814
+ # RPC-specific configuration for `get_docker_image`
2815
+ # @return [::Gapic::Config::Method]
2816
+ #
2817
+ attr_reader :get_docker_image
2818
+ ##
2819
+ # RPC-specific configuration for `import_apt_artifacts`
2820
+ # @return [::Gapic::Config::Method]
2821
+ #
2822
+ attr_reader :import_apt_artifacts
2823
+ ##
2824
+ # RPC-specific configuration for `import_yum_artifacts`
2825
+ # @return [::Gapic::Config::Method]
2826
+ #
2827
+ attr_reader :import_yum_artifacts
2828
+ ##
579
2829
  # RPC-specific configuration for `list_repositories`
580
2830
  # @return [::Gapic::Config::Method]
581
2831
  #
@@ -585,15 +2835,168 @@ module Google
585
2835
  # @return [::Gapic::Config::Method]
586
2836
  #
587
2837
  attr_reader :get_repository
2838
+ ##
2839
+ # RPC-specific configuration for `create_repository`
2840
+ # @return [::Gapic::Config::Method]
2841
+ #
2842
+ attr_reader :create_repository
2843
+ ##
2844
+ # RPC-specific configuration for `update_repository`
2845
+ # @return [::Gapic::Config::Method]
2846
+ #
2847
+ attr_reader :update_repository
2848
+ ##
2849
+ # RPC-specific configuration for `delete_repository`
2850
+ # @return [::Gapic::Config::Method]
2851
+ #
2852
+ attr_reader :delete_repository
2853
+ ##
2854
+ # RPC-specific configuration for `list_packages`
2855
+ # @return [::Gapic::Config::Method]
2856
+ #
2857
+ attr_reader :list_packages
2858
+ ##
2859
+ # RPC-specific configuration for `get_package`
2860
+ # @return [::Gapic::Config::Method]
2861
+ #
2862
+ attr_reader :get_package
2863
+ ##
2864
+ # RPC-specific configuration for `delete_package`
2865
+ # @return [::Gapic::Config::Method]
2866
+ #
2867
+ attr_reader :delete_package
2868
+ ##
2869
+ # RPC-specific configuration for `list_versions`
2870
+ # @return [::Gapic::Config::Method]
2871
+ #
2872
+ attr_reader :list_versions
2873
+ ##
2874
+ # RPC-specific configuration for `get_version`
2875
+ # @return [::Gapic::Config::Method]
2876
+ #
2877
+ attr_reader :get_version
2878
+ ##
2879
+ # RPC-specific configuration for `delete_version`
2880
+ # @return [::Gapic::Config::Method]
2881
+ #
2882
+ attr_reader :delete_version
2883
+ ##
2884
+ # RPC-specific configuration for `list_files`
2885
+ # @return [::Gapic::Config::Method]
2886
+ #
2887
+ attr_reader :list_files
2888
+ ##
2889
+ # RPC-specific configuration for `get_file`
2890
+ # @return [::Gapic::Config::Method]
2891
+ #
2892
+ attr_reader :get_file
2893
+ ##
2894
+ # RPC-specific configuration for `list_tags`
2895
+ # @return [::Gapic::Config::Method]
2896
+ #
2897
+ attr_reader :list_tags
2898
+ ##
2899
+ # RPC-specific configuration for `get_tag`
2900
+ # @return [::Gapic::Config::Method]
2901
+ #
2902
+ attr_reader :get_tag
2903
+ ##
2904
+ # RPC-specific configuration for `create_tag`
2905
+ # @return [::Gapic::Config::Method]
2906
+ #
2907
+ attr_reader :create_tag
2908
+ ##
2909
+ # RPC-specific configuration for `update_tag`
2910
+ # @return [::Gapic::Config::Method]
2911
+ #
2912
+ attr_reader :update_tag
2913
+ ##
2914
+ # RPC-specific configuration for `delete_tag`
2915
+ # @return [::Gapic::Config::Method]
2916
+ #
2917
+ attr_reader :delete_tag
2918
+ ##
2919
+ # RPC-specific configuration for `set_iam_policy`
2920
+ # @return [::Gapic::Config::Method]
2921
+ #
2922
+ attr_reader :set_iam_policy
2923
+ ##
2924
+ # RPC-specific configuration for `get_iam_policy`
2925
+ # @return [::Gapic::Config::Method]
2926
+ #
2927
+ attr_reader :get_iam_policy
2928
+ ##
2929
+ # RPC-specific configuration for `test_iam_permissions`
2930
+ # @return [::Gapic::Config::Method]
2931
+ #
2932
+ attr_reader :test_iam_permissions
2933
+ ##
2934
+ # RPC-specific configuration for `get_project_settings`
2935
+ # @return [::Gapic::Config::Method]
2936
+ #
2937
+ attr_reader :get_project_settings
2938
+ ##
2939
+ # RPC-specific configuration for `update_project_settings`
2940
+ # @return [::Gapic::Config::Method]
2941
+ #
2942
+ attr_reader :update_project_settings
588
2943
 
589
2944
  # @private
590
2945
  def initialize parent_rpcs = nil
591
2946
  list_docker_images_config = parent_rpcs.list_docker_images if parent_rpcs.respond_to? :list_docker_images
592
2947
  @list_docker_images = ::Gapic::Config::Method.new list_docker_images_config
2948
+ get_docker_image_config = parent_rpcs.get_docker_image if parent_rpcs.respond_to? :get_docker_image
2949
+ @get_docker_image = ::Gapic::Config::Method.new get_docker_image_config
2950
+ import_apt_artifacts_config = parent_rpcs.import_apt_artifacts if parent_rpcs.respond_to? :import_apt_artifacts
2951
+ @import_apt_artifacts = ::Gapic::Config::Method.new import_apt_artifacts_config
2952
+ import_yum_artifacts_config = parent_rpcs.import_yum_artifacts if parent_rpcs.respond_to? :import_yum_artifacts
2953
+ @import_yum_artifacts = ::Gapic::Config::Method.new import_yum_artifacts_config
593
2954
  list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories
594
2955
  @list_repositories = ::Gapic::Config::Method.new list_repositories_config
595
2956
  get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository
596
2957
  @get_repository = ::Gapic::Config::Method.new get_repository_config
2958
+ create_repository_config = parent_rpcs.create_repository if parent_rpcs.respond_to? :create_repository
2959
+ @create_repository = ::Gapic::Config::Method.new create_repository_config
2960
+ update_repository_config = parent_rpcs.update_repository if parent_rpcs.respond_to? :update_repository
2961
+ @update_repository = ::Gapic::Config::Method.new update_repository_config
2962
+ delete_repository_config = parent_rpcs.delete_repository if parent_rpcs.respond_to? :delete_repository
2963
+ @delete_repository = ::Gapic::Config::Method.new delete_repository_config
2964
+ list_packages_config = parent_rpcs.list_packages if parent_rpcs.respond_to? :list_packages
2965
+ @list_packages = ::Gapic::Config::Method.new list_packages_config
2966
+ get_package_config = parent_rpcs.get_package if parent_rpcs.respond_to? :get_package
2967
+ @get_package = ::Gapic::Config::Method.new get_package_config
2968
+ delete_package_config = parent_rpcs.delete_package if parent_rpcs.respond_to? :delete_package
2969
+ @delete_package = ::Gapic::Config::Method.new delete_package_config
2970
+ list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
2971
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
2972
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
2973
+ @get_version = ::Gapic::Config::Method.new get_version_config
2974
+ delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
2975
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
2976
+ list_files_config = parent_rpcs.list_files if parent_rpcs.respond_to? :list_files
2977
+ @list_files = ::Gapic::Config::Method.new list_files_config
2978
+ get_file_config = parent_rpcs.get_file if parent_rpcs.respond_to? :get_file
2979
+ @get_file = ::Gapic::Config::Method.new get_file_config
2980
+ list_tags_config = parent_rpcs.list_tags if parent_rpcs.respond_to? :list_tags
2981
+ @list_tags = ::Gapic::Config::Method.new list_tags_config
2982
+ get_tag_config = parent_rpcs.get_tag if parent_rpcs.respond_to? :get_tag
2983
+ @get_tag = ::Gapic::Config::Method.new get_tag_config
2984
+ create_tag_config = parent_rpcs.create_tag if parent_rpcs.respond_to? :create_tag
2985
+ @create_tag = ::Gapic::Config::Method.new create_tag_config
2986
+ update_tag_config = parent_rpcs.update_tag if parent_rpcs.respond_to? :update_tag
2987
+ @update_tag = ::Gapic::Config::Method.new update_tag_config
2988
+ delete_tag_config = parent_rpcs.delete_tag if parent_rpcs.respond_to? :delete_tag
2989
+ @delete_tag = ::Gapic::Config::Method.new delete_tag_config
2990
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
2991
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
2992
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
2993
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
2994
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2995
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2996
+ get_project_settings_config = parent_rpcs.get_project_settings if parent_rpcs.respond_to? :get_project_settings
2997
+ @get_project_settings = ::Gapic::Config::Method.new get_project_settings_config
2998
+ update_project_settings_config = parent_rpcs.update_project_settings if parent_rpcs.respond_to? :update_project_settings
2999
+ @update_project_settings = ::Gapic::Config::Method.new update_project_settings_config
597
3000
 
598
3001
  yield self if block_given?
599
3002
  end