google-cloud-artifact_registry-v1beta2 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,13 +53,12 @@ module Google
53
53
  # See {::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client::Configuration}
54
54
  # for a description of the configuration fields.
55
55
  #
56
- # ## Example
56
+ # @example
57
57
  #
58
- # To modify the configuration for all ArtifactRegistry clients:
59
- #
60
- # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
61
- # config.timeout = 10.0
62
- # end
58
+ # # Modify the configuration for all ArtifactRegistry clients
59
+ # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
60
+ # config.timeout = 10.0
61
+ # end
63
62
  #
64
63
  # @yield [config] Configure the Client client.
65
64
  # @yieldparam config [Client::Configuration]
@@ -79,18 +78,12 @@ module Google
79
78
 
80
79
  default_config.rpcs.list_repositories.timeout = 30.0
81
80
  default_config.rpcs.list_repositories.retry_policy = {
82
- initial_delay: 0.1,
83
- max_delay: 60.0,
84
- multiplier: 1.3,
85
- retry_codes: [14]
81
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
86
82
  }
87
83
 
88
84
  default_config.rpcs.get_repository.timeout = 30.0
89
85
  default_config.rpcs.get_repository.retry_policy = {
90
- initial_delay: 0.1,
91
- max_delay: 60.0,
92
- multiplier: 1.3,
93
- retry_codes: [14]
86
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
94
87
  }
95
88
 
96
89
  default_config.rpcs.create_repository.timeout = 30.0
@@ -99,90 +92,57 @@ module Google
99
92
 
100
93
  default_config.rpcs.delete_repository.timeout = 30.0
101
94
  default_config.rpcs.delete_repository.retry_policy = {
102
- initial_delay: 0.1,
103
- max_delay: 60.0,
104
- multiplier: 1.3,
105
- retry_codes: [14]
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
106
96
  }
107
97
 
108
98
  default_config.rpcs.list_packages.timeout = 30.0
109
99
  default_config.rpcs.list_packages.retry_policy = {
110
- initial_delay: 0.1,
111
- max_delay: 60.0,
112
- multiplier: 1.3,
113
- retry_codes: [14]
100
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
114
101
  }
115
102
 
116
103
  default_config.rpcs.get_package.timeout = 30.0
117
104
  default_config.rpcs.get_package.retry_policy = {
118
- initial_delay: 0.1,
119
- max_delay: 60.0,
120
- multiplier: 1.3,
121
- retry_codes: [14]
105
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
122
106
  }
123
107
 
124
108
  default_config.rpcs.delete_package.timeout = 30.0
125
109
  default_config.rpcs.delete_package.retry_policy = {
126
- initial_delay: 0.1,
127
- max_delay: 60.0,
128
- multiplier: 1.3,
129
- retry_codes: [14]
110
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
130
111
  }
131
112
 
132
113
  default_config.rpcs.list_versions.timeout = 30.0
133
114
  default_config.rpcs.list_versions.retry_policy = {
134
- initial_delay: 0.1,
135
- max_delay: 60.0,
136
- multiplier: 1.3,
137
- retry_codes: [14]
115
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
138
116
  }
139
117
 
140
118
  default_config.rpcs.get_version.timeout = 30.0
141
119
  default_config.rpcs.get_version.retry_policy = {
142
- initial_delay: 0.1,
143
- max_delay: 60.0,
144
- multiplier: 1.3,
145
- retry_codes: [14]
120
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
146
121
  }
147
122
 
148
123
  default_config.rpcs.delete_version.timeout = 30.0
149
124
  default_config.rpcs.delete_version.retry_policy = {
150
- initial_delay: 0.1,
151
- max_delay: 60.0,
152
- multiplier: 1.3,
153
- retry_codes: [14]
125
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
154
126
  }
155
127
 
156
128
  default_config.rpcs.list_files.timeout = 30.0
157
129
  default_config.rpcs.list_files.retry_policy = {
158
- initial_delay: 0.1,
159
- max_delay: 60.0,
160
- multiplier: 1.3,
161
- retry_codes: [14]
130
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
162
131
  }
163
132
 
164
133
  default_config.rpcs.get_file.timeout = 30.0
165
134
  default_config.rpcs.get_file.retry_policy = {
166
- initial_delay: 0.1,
167
- max_delay: 60.0,
168
- multiplier: 1.3,
169
- retry_codes: [14]
135
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
170
136
  }
171
137
 
172
138
  default_config.rpcs.list_tags.timeout = 30.0
173
139
  default_config.rpcs.list_tags.retry_policy = {
174
- initial_delay: 0.1,
175
- max_delay: 60.0,
176
- multiplier: 1.3,
177
- retry_codes: [14]
140
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
178
141
  }
179
142
 
180
143
  default_config.rpcs.get_tag.timeout = 30.0
181
144
  default_config.rpcs.get_tag.retry_policy = {
182
- initial_delay: 0.1,
183
- max_delay: 60.0,
184
- multiplier: 1.3,
185
- retry_codes: [14]
145
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
186
146
  }
187
147
 
188
148
  default_config.rpcs.create_tag.timeout = 30.0
@@ -191,18 +151,12 @@ module Google
191
151
 
192
152
  default_config.rpcs.delete_tag.timeout = 30.0
193
153
  default_config.rpcs.delete_tag.retry_policy = {
194
- initial_delay: 0.1,
195
- max_delay: 60.0,
196
- multiplier: 1.3,
197
- retry_codes: [14]
154
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
198
155
  }
199
156
 
200
157
  default_config.rpcs.get_iam_policy.timeout = 30.0
201
158
  default_config.rpcs.get_iam_policy.retry_policy = {
202
- initial_delay: 0.1,
203
- max_delay: 60.0,
204
- multiplier: 1.3,
205
- retry_codes: [14]
159
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
206
160
  }
207
161
 
208
162
  default_config.rpcs.test_iam_permissions.timeout = 30.0
@@ -236,19 +190,15 @@ module Google
236
190
  ##
237
191
  # Create a new ArtifactRegistry client object.
238
192
  #
239
- # ## Examples
240
- #
241
- # To create a new ArtifactRegistry client with the default
242
- # configuration:
243
- #
244
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
193
+ # @example
245
194
  #
246
- # To create a new ArtifactRegistry client with a custom
247
- # configuration:
195
+ # # Create a client using the default configuration
196
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
248
197
  #
249
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
250
- # config.timeout = 10.0
251
- # end
198
+ # # Create a client using a custom configuration
199
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
200
+ # config.timeout = 10.0
201
+ # end
252
202
  #
253
203
  # @yield [config] Configure the ArtifactRegistry client.
254
204
  # @yieldparam config [Client::Configuration]
@@ -268,14 +218,13 @@ module Google
268
218
 
269
219
  # Create credentials
270
220
  credentials = @config.credentials
271
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
221
+ # Use self-signed JWT if the endpoint is unchanged from default,
272
222
  # but only if the default endpoint does not have a region prefix.
273
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
274
- @config.endpoint == Client.configure.endpoint &&
223
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
275
224
  !@config.endpoint.split(".").first.include?("-")
276
225
  credentials ||= Credentials.default scope: @config.scope,
277
226
  enable_self_signed_jwt: enable_self_signed_jwt
278
- if credentials.is_a?(String) || credentials.is_a?(Hash)
227
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
279
228
  credentials = Credentials.new credentials, scope: @config.scope
280
229
  end
281
230
  @quota_project_id = @config.quota_project
@@ -338,6 +287,27 @@ module Google
338
287
  #
339
288
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
340
289
  #
290
+ # @example Basic example
291
+ # require "google/cloud/artifact_registry/v1beta2"
292
+ #
293
+ # # Create a client object. The client can be reused for multiple calls.
294
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
295
+ #
296
+ # # Create a request. To set request fields, pass in keyword arguments.
297
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest.new
298
+ #
299
+ # # Call the list_repositories method.
300
+ # result = client.list_repositories request
301
+ #
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::V1beta2::Repository.
308
+ # p response
309
+ # end
310
+ #
341
311
  def list_repositories request, options = nil
342
312
  raise ::ArgumentError, "request must be provided" if request.nil?
343
313
 
@@ -355,16 +325,20 @@ module Google
355
325
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
356
326
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
327
 
358
- header_params = {
359
- "parent" => request.parent
360
- }
328
+ header_params = {}
329
+ if request.parent
330
+ header_params["parent"] = request.parent
331
+ end
332
+
361
333
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
362
334
  metadata[:"x-goog-request-params"] ||= request_params_header
363
335
 
364
336
  options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
365
337
  metadata: metadata,
366
338
  retry_policy: @config.rpcs.list_repositories.retry_policy
367
- options.apply_defaults metadata: @config.metadata,
339
+
340
+ options.apply_defaults timeout: @config.timeout,
341
+ metadata: @config.metadata,
368
342
  retry_policy: @config.retry_policy
369
343
 
370
344
  @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
@@ -405,6 +379,21 @@ module Google
405
379
  #
406
380
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
407
381
  #
382
+ # @example Basic example
383
+ # require "google/cloud/artifact_registry/v1beta2"
384
+ #
385
+ # # Create a client object. The client can be reused for multiple calls.
386
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
387
+ #
388
+ # # Create a request. To set request fields, pass in keyword arguments.
389
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest.new
390
+ #
391
+ # # Call the get_repository method.
392
+ # result = client.get_repository request
393
+ #
394
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository.
395
+ # p result
396
+ #
408
397
  def get_repository request, options = nil
409
398
  raise ::ArgumentError, "request must be provided" if request.nil?
410
399
 
@@ -422,16 +411,20 @@ module Google
422
411
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
423
412
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
424
413
 
425
- header_params = {
426
- "name" => request.name
427
- }
414
+ header_params = {}
415
+ if request.name
416
+ header_params["name"] = request.name
417
+ end
418
+
428
419
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
429
420
  metadata[:"x-goog-request-params"] ||= request_params_header
430
421
 
431
422
  options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
432
423
  metadata: metadata,
433
424
  retry_policy: @config.rpcs.get_repository.retry_policy
434
- options.apply_defaults metadata: @config.metadata,
425
+
426
+ options.apply_defaults timeout: @config.timeout,
427
+ metadata: @config.metadata,
435
428
  retry_policy: @config.retry_policy
436
429
 
437
430
  @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
@@ -476,6 +469,28 @@ module Google
476
469
  #
477
470
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
478
471
  #
472
+ # @example Basic example
473
+ # require "google/cloud/artifact_registry/v1beta2"
474
+ #
475
+ # # Create a client object. The client can be reused for multiple calls.
476
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
477
+ #
478
+ # # Create a request. To set request fields, pass in keyword arguments.
479
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest.new
480
+ #
481
+ # # Call the create_repository method.
482
+ # result = client.create_repository request
483
+ #
484
+ # # The returned object is of type Gapic::Operation. You can use this
485
+ # # object to check the status of an operation, cancel it, or wait
486
+ # # for results. Here is how to block until completion:
487
+ # result.wait_until_done! timeout: 60
488
+ # if result.response?
489
+ # p result.response
490
+ # else
491
+ # puts "Error!"
492
+ # end
493
+ #
479
494
  def create_repository request, options = nil
480
495
  raise ::ArgumentError, "request must be provided" if request.nil?
481
496
 
@@ -493,16 +508,20 @@ module Google
493
508
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
494
509
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
510
 
496
- header_params = {
497
- "parent" => request.parent
498
- }
511
+ header_params = {}
512
+ if request.parent
513
+ header_params["parent"] = request.parent
514
+ end
515
+
499
516
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
500
517
  metadata[:"x-goog-request-params"] ||= request_params_header
501
518
 
502
519
  options.apply_defaults timeout: @config.rpcs.create_repository.timeout,
503
520
  metadata: metadata,
504
521
  retry_policy: @config.rpcs.create_repository.retry_policy
505
- options.apply_defaults metadata: @config.metadata,
522
+
523
+ options.apply_defaults timeout: @config.timeout,
524
+ metadata: @config.metadata,
506
525
  retry_policy: @config.retry_policy
507
526
 
508
527
  @artifact_registry_stub.call_rpc :create_repository, request, options: options do |response, operation|
@@ -547,6 +566,21 @@ module Google
547
566
  #
548
567
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
549
568
  #
569
+ # @example Basic example
570
+ # require "google/cloud/artifact_registry/v1beta2"
571
+ #
572
+ # # Create a client object. The client can be reused for multiple calls.
573
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
574
+ #
575
+ # # Create a request. To set request fields, pass in keyword arguments.
576
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest.new
577
+ #
578
+ # # Call the update_repository method.
579
+ # result = client.update_repository request
580
+ #
581
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository.
582
+ # p result
583
+ #
550
584
  def update_repository request, options = nil
551
585
  raise ::ArgumentError, "request must be provided" if request.nil?
552
586
 
@@ -564,16 +598,20 @@ module Google
564
598
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
565
599
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
566
600
 
567
- header_params = {
568
- "repository.name" => request.repository.name
569
- }
601
+ header_params = {}
602
+ if request.repository&.name
603
+ header_params["repository.name"] = request.repository.name
604
+ end
605
+
570
606
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
571
607
  metadata[:"x-goog-request-params"] ||= request_params_header
572
608
 
573
609
  options.apply_defaults timeout: @config.rpcs.update_repository.timeout,
574
610
  metadata: metadata,
575
611
  retry_policy: @config.rpcs.update_repository.retry_policy
576
- options.apply_defaults metadata: @config.metadata,
612
+
613
+ options.apply_defaults timeout: @config.timeout,
614
+ metadata: @config.metadata,
577
615
  retry_policy: @config.retry_policy
578
616
 
579
617
  @artifact_registry_stub.call_rpc :update_repository, request, options: options do |response, operation|
@@ -615,6 +653,28 @@ module Google
615
653
  #
616
654
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
617
655
  #
656
+ # @example Basic example
657
+ # require "google/cloud/artifact_registry/v1beta2"
658
+ #
659
+ # # Create a client object. The client can be reused for multiple calls.
660
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
661
+ #
662
+ # # Create a request. To set request fields, pass in keyword arguments.
663
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest.new
664
+ #
665
+ # # Call the delete_repository method.
666
+ # result = client.delete_repository request
667
+ #
668
+ # # The returned object is of type Gapic::Operation. You can use this
669
+ # # object to check the status of an operation, cancel it, or wait
670
+ # # for results. Here is how to block until completion:
671
+ # result.wait_until_done! timeout: 60
672
+ # if result.response?
673
+ # p result.response
674
+ # else
675
+ # puts "Error!"
676
+ # end
677
+ #
618
678
  def delete_repository request, options = nil
619
679
  raise ::ArgumentError, "request must be provided" if request.nil?
620
680
 
@@ -632,16 +692,20 @@ module Google
632
692
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
633
693
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
634
694
 
635
- header_params = {
636
- "name" => request.name
637
- }
695
+ header_params = {}
696
+ if request.name
697
+ header_params["name"] = request.name
698
+ end
699
+
638
700
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
639
701
  metadata[:"x-goog-request-params"] ||= request_params_header
640
702
 
641
703
  options.apply_defaults timeout: @config.rpcs.delete_repository.timeout,
642
704
  metadata: metadata,
643
705
  retry_policy: @config.rpcs.delete_repository.retry_policy
644
- options.apply_defaults metadata: @config.metadata,
706
+
707
+ options.apply_defaults timeout: @config.timeout,
708
+ metadata: @config.metadata,
645
709
  retry_policy: @config.retry_policy
646
710
 
647
711
  @artifact_registry_stub.call_rpc :delete_repository, request, options: options do |response, operation|
@@ -687,6 +751,27 @@ module Google
687
751
  #
688
752
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
689
753
  #
754
+ # @example Basic example
755
+ # require "google/cloud/artifact_registry/v1beta2"
756
+ #
757
+ # # Create a client object. The client can be reused for multiple calls.
758
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
759
+ #
760
+ # # Create a request. To set request fields, pass in keyword arguments.
761
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest.new
762
+ #
763
+ # # Call the list_packages method.
764
+ # result = client.list_packages request
765
+ #
766
+ # # The returned object is of type Gapic::PagedEnumerable. You can
767
+ # # iterate over all elements by calling #each, and the enumerable
768
+ # # will lazily make API calls to fetch subsequent pages. Other
769
+ # # methods are also available for managing paging directly.
770
+ # result.each do |response|
771
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Package.
772
+ # p response
773
+ # end
774
+ #
690
775
  def list_packages request, options = nil
691
776
  raise ::ArgumentError, "request must be provided" if request.nil?
692
777
 
@@ -704,16 +789,20 @@ module Google
704
789
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
705
790
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
706
791
 
707
- header_params = {
708
- "parent" => request.parent
709
- }
792
+ header_params = {}
793
+ if request.parent
794
+ header_params["parent"] = request.parent
795
+ end
796
+
710
797
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
711
798
  metadata[:"x-goog-request-params"] ||= request_params_header
712
799
 
713
800
  options.apply_defaults timeout: @config.rpcs.list_packages.timeout,
714
801
  metadata: metadata,
715
802
  retry_policy: @config.rpcs.list_packages.retry_policy
716
- options.apply_defaults metadata: @config.metadata,
803
+
804
+ options.apply_defaults timeout: @config.timeout,
805
+ metadata: @config.metadata,
717
806
  retry_policy: @config.retry_policy
718
807
 
719
808
  @artifact_registry_stub.call_rpc :list_packages, request, options: options do |response, operation|
@@ -754,6 +843,21 @@ module Google
754
843
  #
755
844
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
756
845
  #
846
+ # @example Basic example
847
+ # require "google/cloud/artifact_registry/v1beta2"
848
+ #
849
+ # # Create a client object. The client can be reused for multiple calls.
850
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
851
+ #
852
+ # # Create a request. To set request fields, pass in keyword arguments.
853
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest.new
854
+ #
855
+ # # Call the get_package method.
856
+ # result = client.get_package request
857
+ #
858
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Package.
859
+ # p result
860
+ #
757
861
  def get_package request, options = nil
758
862
  raise ::ArgumentError, "request must be provided" if request.nil?
759
863
 
@@ -771,16 +875,20 @@ module Google
771
875
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
772
876
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
773
877
 
774
- header_params = {
775
- "name" => request.name
776
- }
878
+ header_params = {}
879
+ if request.name
880
+ header_params["name"] = request.name
881
+ end
882
+
777
883
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
778
884
  metadata[:"x-goog-request-params"] ||= request_params_header
779
885
 
780
886
  options.apply_defaults timeout: @config.rpcs.get_package.timeout,
781
887
  metadata: metadata,
782
888
  retry_policy: @config.rpcs.get_package.retry_policy
783
- options.apply_defaults metadata: @config.metadata,
889
+
890
+ options.apply_defaults timeout: @config.timeout,
891
+ metadata: @config.metadata,
784
892
  retry_policy: @config.retry_policy
785
893
 
786
894
  @artifact_registry_stub.call_rpc :get_package, request, options: options do |response, operation|
@@ -821,6 +929,28 @@ module Google
821
929
  #
822
930
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
823
931
  #
932
+ # @example Basic example
933
+ # require "google/cloud/artifact_registry/v1beta2"
934
+ #
935
+ # # Create a client object. The client can be reused for multiple calls.
936
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
937
+ #
938
+ # # Create a request. To set request fields, pass in keyword arguments.
939
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest.new
940
+ #
941
+ # # Call the delete_package method.
942
+ # result = client.delete_package request
943
+ #
944
+ # # The returned object is of type Gapic::Operation. You can use this
945
+ # # object to check the status of an operation, cancel it, or wait
946
+ # # for results. Here is how to block until completion:
947
+ # result.wait_until_done! timeout: 60
948
+ # if result.response?
949
+ # p result.response
950
+ # else
951
+ # puts "Error!"
952
+ # end
953
+ #
824
954
  def delete_package request, options = nil
825
955
  raise ::ArgumentError, "request must be provided" if request.nil?
826
956
 
@@ -838,16 +968,20 @@ module Google
838
968
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
839
969
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
840
970
 
841
- header_params = {
842
- "name" => request.name
843
- }
971
+ header_params = {}
972
+ if request.name
973
+ header_params["name"] = request.name
974
+ end
975
+
844
976
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
845
977
  metadata[:"x-goog-request-params"] ||= request_params_header
846
978
 
847
979
  options.apply_defaults timeout: @config.rpcs.delete_package.timeout,
848
980
  metadata: metadata,
849
981
  retry_policy: @config.rpcs.delete_package.retry_policy
850
- options.apply_defaults metadata: @config.metadata,
982
+
983
+ options.apply_defaults timeout: @config.timeout,
984
+ metadata: @config.metadata,
851
985
  retry_policy: @config.retry_policy
852
986
 
853
987
  @artifact_registry_stub.call_rpc :delete_package, request, options: options do |response, operation|
@@ -895,6 +1029,27 @@ module Google
895
1029
  #
896
1030
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
897
1031
  #
1032
+ # @example Basic example
1033
+ # require "google/cloud/artifact_registry/v1beta2"
1034
+ #
1035
+ # # Create a client object. The client can be reused for multiple calls.
1036
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1037
+ #
1038
+ # # Create a request. To set request fields, pass in keyword arguments.
1039
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest.new
1040
+ #
1041
+ # # Call the list_versions method.
1042
+ # result = client.list_versions request
1043
+ #
1044
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1045
+ # # iterate over all elements by calling #each, and the enumerable
1046
+ # # will lazily make API calls to fetch subsequent pages. Other
1047
+ # # methods are also available for managing paging directly.
1048
+ # result.each do |response|
1049
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Version.
1050
+ # p response
1051
+ # end
1052
+ #
898
1053
  def list_versions request, options = nil
899
1054
  raise ::ArgumentError, "request must be provided" if request.nil?
900
1055
 
@@ -912,16 +1067,20 @@ module Google
912
1067
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
913
1068
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
914
1069
 
915
- header_params = {
916
- "parent" => request.parent
917
- }
1070
+ header_params = {}
1071
+ if request.parent
1072
+ header_params["parent"] = request.parent
1073
+ end
1074
+
918
1075
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
919
1076
  metadata[:"x-goog-request-params"] ||= request_params_header
920
1077
 
921
1078
  options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
922
1079
  metadata: metadata,
923
1080
  retry_policy: @config.rpcs.list_versions.retry_policy
924
- options.apply_defaults metadata: @config.metadata,
1081
+
1082
+ options.apply_defaults timeout: @config.timeout,
1083
+ metadata: @config.metadata,
925
1084
  retry_policy: @config.retry_policy
926
1085
 
927
1086
  @artifact_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
@@ -964,6 +1123,21 @@ module Google
964
1123
  #
965
1124
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
966
1125
  #
1126
+ # @example Basic example
1127
+ # require "google/cloud/artifact_registry/v1beta2"
1128
+ #
1129
+ # # Create a client object. The client can be reused for multiple calls.
1130
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1131
+ #
1132
+ # # Create a request. To set request fields, pass in keyword arguments.
1133
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest.new
1134
+ #
1135
+ # # Call the get_version method.
1136
+ # result = client.get_version request
1137
+ #
1138
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Version.
1139
+ # p result
1140
+ #
967
1141
  def get_version request, options = nil
968
1142
  raise ::ArgumentError, "request must be provided" if request.nil?
969
1143
 
@@ -981,16 +1155,20 @@ module Google
981
1155
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
982
1156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
983
1157
 
984
- header_params = {
985
- "name" => request.name
986
- }
1158
+ header_params = {}
1159
+ if request.name
1160
+ header_params["name"] = request.name
1161
+ end
1162
+
987
1163
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
988
1164
  metadata[:"x-goog-request-params"] ||= request_params_header
989
1165
 
990
1166
  options.apply_defaults timeout: @config.rpcs.get_version.timeout,
991
1167
  metadata: metadata,
992
1168
  retry_policy: @config.rpcs.get_version.retry_policy
993
- options.apply_defaults metadata: @config.metadata,
1169
+
1170
+ options.apply_defaults timeout: @config.timeout,
1171
+ metadata: @config.metadata,
994
1172
  retry_policy: @config.retry_policy
995
1173
 
996
1174
  @artifact_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
@@ -1034,6 +1212,28 @@ module Google
1034
1212
  #
1035
1213
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1036
1214
  #
1215
+ # @example Basic example
1216
+ # require "google/cloud/artifact_registry/v1beta2"
1217
+ #
1218
+ # # Create a client object. The client can be reused for multiple calls.
1219
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1220
+ #
1221
+ # # Create a request. To set request fields, pass in keyword arguments.
1222
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest.new
1223
+ #
1224
+ # # Call the delete_version method.
1225
+ # result = client.delete_version request
1226
+ #
1227
+ # # The returned object is of type Gapic::Operation. You can use this
1228
+ # # object to check the status of an operation, cancel it, or wait
1229
+ # # for results. Here is how to block until completion:
1230
+ # result.wait_until_done! timeout: 60
1231
+ # if result.response?
1232
+ # p result.response
1233
+ # else
1234
+ # puts "Error!"
1235
+ # end
1236
+ #
1037
1237
  def delete_version request, options = nil
1038
1238
  raise ::ArgumentError, "request must be provided" if request.nil?
1039
1239
 
@@ -1051,16 +1251,20 @@ module Google
1051
1251
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1052
1252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1053
1253
 
1054
- header_params = {
1055
- "name" => request.name
1056
- }
1254
+ header_params = {}
1255
+ if request.name
1256
+ header_params["name"] = request.name
1257
+ end
1258
+
1057
1259
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1058
1260
  metadata[:"x-goog-request-params"] ||= request_params_header
1059
1261
 
1060
1262
  options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
1061
1263
  metadata: metadata,
1062
1264
  retry_policy: @config.rpcs.delete_version.retry_policy
1063
- options.apply_defaults metadata: @config.metadata,
1265
+
1266
+ options.apply_defaults timeout: @config.timeout,
1267
+ metadata: @config.metadata,
1064
1268
  retry_policy: @config.retry_policy
1065
1269
 
1066
1270
  @artifact_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
@@ -1118,6 +1322,27 @@ module Google
1118
1322
  #
1119
1323
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1120
1324
  #
1325
+ # @example Basic example
1326
+ # require "google/cloud/artifact_registry/v1beta2"
1327
+ #
1328
+ # # Create a client object. The client can be reused for multiple calls.
1329
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1330
+ #
1331
+ # # Create a request. To set request fields, pass in keyword arguments.
1332
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest.new
1333
+ #
1334
+ # # Call the list_files method.
1335
+ # result = client.list_files request
1336
+ #
1337
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1338
+ # # iterate over all elements by calling #each, and the enumerable
1339
+ # # will lazily make API calls to fetch subsequent pages. Other
1340
+ # # methods are also available for managing paging directly.
1341
+ # result.each do |response|
1342
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::File.
1343
+ # p response
1344
+ # end
1345
+ #
1121
1346
  def list_files request, options = nil
1122
1347
  raise ::ArgumentError, "request must be provided" if request.nil?
1123
1348
 
@@ -1135,16 +1360,20 @@ module Google
1135
1360
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1136
1361
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1137
1362
 
1138
- header_params = {
1139
- "parent" => request.parent
1140
- }
1363
+ header_params = {}
1364
+ if request.parent
1365
+ header_params["parent"] = request.parent
1366
+ end
1367
+
1141
1368
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1142
1369
  metadata[:"x-goog-request-params"] ||= request_params_header
1143
1370
 
1144
1371
  options.apply_defaults timeout: @config.rpcs.list_files.timeout,
1145
1372
  metadata: metadata,
1146
1373
  retry_policy: @config.rpcs.list_files.retry_policy
1147
- options.apply_defaults metadata: @config.metadata,
1374
+
1375
+ options.apply_defaults timeout: @config.timeout,
1376
+ metadata: @config.metadata,
1148
1377
  retry_policy: @config.retry_policy
1149
1378
 
1150
1379
  @artifact_registry_stub.call_rpc :list_files, request, options: options do |response, operation|
@@ -1185,6 +1414,21 @@ module Google
1185
1414
  #
1186
1415
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1187
1416
  #
1417
+ # @example Basic example
1418
+ # require "google/cloud/artifact_registry/v1beta2"
1419
+ #
1420
+ # # Create a client object. The client can be reused for multiple calls.
1421
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1422
+ #
1423
+ # # Create a request. To set request fields, pass in keyword arguments.
1424
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest.new
1425
+ #
1426
+ # # Call the get_file method.
1427
+ # result = client.get_file request
1428
+ #
1429
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::File.
1430
+ # p result
1431
+ #
1188
1432
  def get_file request, options = nil
1189
1433
  raise ::ArgumentError, "request must be provided" if request.nil?
1190
1434
 
@@ -1202,16 +1446,20 @@ module Google
1202
1446
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1203
1447
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1204
1448
 
1205
- header_params = {
1206
- "name" => request.name
1207
- }
1449
+ header_params = {}
1450
+ if request.name
1451
+ header_params["name"] = request.name
1452
+ end
1453
+
1208
1454
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1209
1455
  metadata[:"x-goog-request-params"] ||= request_params_header
1210
1456
 
1211
1457
  options.apply_defaults timeout: @config.rpcs.get_file.timeout,
1212
1458
  metadata: metadata,
1213
1459
  retry_policy: @config.rpcs.get_file.retry_policy
1214
- options.apply_defaults metadata: @config.metadata,
1460
+
1461
+ options.apply_defaults timeout: @config.timeout,
1462
+ metadata: @config.metadata,
1215
1463
  retry_policy: @config.retry_policy
1216
1464
 
1217
1465
  @artifact_registry_stub.call_rpc :get_file, request, options: options do |response, operation|
@@ -1266,6 +1514,27 @@ module Google
1266
1514
  #
1267
1515
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1268
1516
  #
1517
+ # @example Basic example
1518
+ # require "google/cloud/artifact_registry/v1beta2"
1519
+ #
1520
+ # # Create a client object. The client can be reused for multiple calls.
1521
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1522
+ #
1523
+ # # Create a request. To set request fields, pass in keyword arguments.
1524
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest.new
1525
+ #
1526
+ # # Call the list_tags method.
1527
+ # result = client.list_tags request
1528
+ #
1529
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1530
+ # # iterate over all elements by calling #each, and the enumerable
1531
+ # # will lazily make API calls to fetch subsequent pages. Other
1532
+ # # methods are also available for managing paging directly.
1533
+ # result.each do |response|
1534
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1535
+ # p response
1536
+ # end
1537
+ #
1269
1538
  def list_tags request, options = nil
1270
1539
  raise ::ArgumentError, "request must be provided" if request.nil?
1271
1540
 
@@ -1283,16 +1552,20 @@ module Google
1283
1552
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1284
1553
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1285
1554
 
1286
- header_params = {
1287
- "parent" => request.parent
1288
- }
1555
+ header_params = {}
1556
+ if request.parent
1557
+ header_params["parent"] = request.parent
1558
+ end
1559
+
1289
1560
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1290
1561
  metadata[:"x-goog-request-params"] ||= request_params_header
1291
1562
 
1292
1563
  options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
1293
1564
  metadata: metadata,
1294
1565
  retry_policy: @config.rpcs.list_tags.retry_policy
1295
- options.apply_defaults metadata: @config.metadata,
1566
+
1567
+ options.apply_defaults timeout: @config.timeout,
1568
+ metadata: @config.metadata,
1296
1569
  retry_policy: @config.retry_policy
1297
1570
 
1298
1571
  @artifact_registry_stub.call_rpc :list_tags, request, options: options do |response, operation|
@@ -1333,6 +1606,21 @@ module Google
1333
1606
  #
1334
1607
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1335
1608
  #
1609
+ # @example Basic example
1610
+ # require "google/cloud/artifact_registry/v1beta2"
1611
+ #
1612
+ # # Create a client object. The client can be reused for multiple calls.
1613
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1614
+ #
1615
+ # # Create a request. To set request fields, pass in keyword arguments.
1616
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest.new
1617
+ #
1618
+ # # Call the get_tag method.
1619
+ # result = client.get_tag request
1620
+ #
1621
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1622
+ # p result
1623
+ #
1336
1624
  def get_tag request, options = nil
1337
1625
  raise ::ArgumentError, "request must be provided" if request.nil?
1338
1626
 
@@ -1350,16 +1638,20 @@ module Google
1350
1638
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1351
1639
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1352
1640
 
1353
- header_params = {
1354
- "name" => request.name
1355
- }
1641
+ header_params = {}
1642
+ if request.name
1643
+ header_params["name"] = request.name
1644
+ end
1645
+
1356
1646
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1357
1647
  metadata[:"x-goog-request-params"] ||= request_params_header
1358
1648
 
1359
1649
  options.apply_defaults timeout: @config.rpcs.get_tag.timeout,
1360
1650
  metadata: metadata,
1361
1651
  retry_policy: @config.rpcs.get_tag.retry_policy
1362
- options.apply_defaults metadata: @config.metadata,
1652
+
1653
+ options.apply_defaults timeout: @config.timeout,
1654
+ metadata: @config.metadata,
1363
1655
  retry_policy: @config.retry_policy
1364
1656
 
1365
1657
  @artifact_registry_stub.call_rpc :get_tag, request, options: options do |response, operation|
@@ -1403,6 +1695,21 @@ module Google
1403
1695
  #
1404
1696
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1405
1697
  #
1698
+ # @example Basic example
1699
+ # require "google/cloud/artifact_registry/v1beta2"
1700
+ #
1701
+ # # Create a client object. The client can be reused for multiple calls.
1702
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1703
+ #
1704
+ # # Create a request. To set request fields, pass in keyword arguments.
1705
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest.new
1706
+ #
1707
+ # # Call the create_tag method.
1708
+ # result = client.create_tag request
1709
+ #
1710
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1711
+ # p result
1712
+ #
1406
1713
  def create_tag request, options = nil
1407
1714
  raise ::ArgumentError, "request must be provided" if request.nil?
1408
1715
 
@@ -1420,16 +1727,20 @@ module Google
1420
1727
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1421
1728
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1422
1729
 
1423
- header_params = {
1424
- "parent" => request.parent
1425
- }
1730
+ header_params = {}
1731
+ if request.parent
1732
+ header_params["parent"] = request.parent
1733
+ end
1734
+
1426
1735
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1427
1736
  metadata[:"x-goog-request-params"] ||= request_params_header
1428
1737
 
1429
1738
  options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
1430
1739
  metadata: metadata,
1431
1740
  retry_policy: @config.rpcs.create_tag.retry_policy
1432
- options.apply_defaults metadata: @config.metadata,
1741
+
1742
+ options.apply_defaults timeout: @config.timeout,
1743
+ metadata: @config.metadata,
1433
1744
  retry_policy: @config.retry_policy
1434
1745
 
1435
1746
  @artifact_registry_stub.call_rpc :create_tag, request, options: options do |response, operation|
@@ -1473,6 +1784,21 @@ module Google
1473
1784
  #
1474
1785
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1475
1786
  #
1787
+ # @example Basic example
1788
+ # require "google/cloud/artifact_registry/v1beta2"
1789
+ #
1790
+ # # Create a client object. The client can be reused for multiple calls.
1791
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1792
+ #
1793
+ # # Create a request. To set request fields, pass in keyword arguments.
1794
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest.new
1795
+ #
1796
+ # # Call the update_tag method.
1797
+ # result = client.update_tag request
1798
+ #
1799
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1800
+ # p result
1801
+ #
1476
1802
  def update_tag request, options = nil
1477
1803
  raise ::ArgumentError, "request must be provided" if request.nil?
1478
1804
 
@@ -1490,16 +1816,20 @@ module Google
1490
1816
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1491
1817
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1492
1818
 
1493
- header_params = {
1494
- "tag.name" => request.tag.name
1495
- }
1819
+ header_params = {}
1820
+ if request.tag&.name
1821
+ header_params["tag.name"] = request.tag.name
1822
+ end
1823
+
1496
1824
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1497
1825
  metadata[:"x-goog-request-params"] ||= request_params_header
1498
1826
 
1499
1827
  options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
1500
1828
  metadata: metadata,
1501
1829
  retry_policy: @config.rpcs.update_tag.retry_policy
1502
- options.apply_defaults metadata: @config.metadata,
1830
+
1831
+ options.apply_defaults timeout: @config.timeout,
1832
+ metadata: @config.metadata,
1503
1833
  retry_policy: @config.retry_policy
1504
1834
 
1505
1835
  @artifact_registry_stub.call_rpc :update_tag, request, options: options do |response, operation|
@@ -1539,6 +1869,21 @@ module Google
1539
1869
  #
1540
1870
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1541
1871
  #
1872
+ # @example Basic example
1873
+ # require "google/cloud/artifact_registry/v1beta2"
1874
+ #
1875
+ # # Create a client object. The client can be reused for multiple calls.
1876
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1877
+ #
1878
+ # # Create a request. To set request fields, pass in keyword arguments.
1879
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest.new
1880
+ #
1881
+ # # Call the delete_tag method.
1882
+ # result = client.delete_tag request
1883
+ #
1884
+ # # The returned object is of type Google::Protobuf::Empty.
1885
+ # p result
1886
+ #
1542
1887
  def delete_tag request, options = nil
1543
1888
  raise ::ArgumentError, "request must be provided" if request.nil?
1544
1889
 
@@ -1556,16 +1901,20 @@ module Google
1556
1901
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1557
1902
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1558
1903
 
1559
- header_params = {
1560
- "name" => request.name
1561
- }
1904
+ header_params = {}
1905
+ if request.name
1906
+ header_params["name"] = request.name
1907
+ end
1908
+
1562
1909
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1563
1910
  metadata[:"x-goog-request-params"] ||= request_params_header
1564
1911
 
1565
1912
  options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
1566
1913
  metadata: metadata,
1567
1914
  retry_policy: @config.rpcs.delete_tag.retry_policy
1568
- options.apply_defaults metadata: @config.metadata,
1915
+
1916
+ options.apply_defaults timeout: @config.timeout,
1917
+ metadata: @config.metadata,
1569
1918
  retry_policy: @config.retry_policy
1570
1919
 
1571
1920
  @artifact_registry_stub.call_rpc :delete_tag, request, options: options do |response, operation|
@@ -1611,6 +1960,21 @@ module Google
1611
1960
  #
1612
1961
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1613
1962
  #
1963
+ # @example Basic example
1964
+ # require "google/cloud/artifact_registry/v1beta2"
1965
+ #
1966
+ # # Create a client object. The client can be reused for multiple calls.
1967
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1968
+ #
1969
+ # # Create a request. To set request fields, pass in keyword arguments.
1970
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1971
+ #
1972
+ # # Call the set_iam_policy method.
1973
+ # result = client.set_iam_policy request
1974
+ #
1975
+ # # The returned object is of type Google::Iam::V1::Policy.
1976
+ # p result
1977
+ #
1614
1978
  def set_iam_policy request, options = nil
1615
1979
  raise ::ArgumentError, "request must be provided" if request.nil?
1616
1980
 
@@ -1628,16 +1992,20 @@ module Google
1628
1992
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1629
1993
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1630
1994
 
1631
- header_params = {
1632
- "resource" => request.resource
1633
- }
1995
+ header_params = {}
1996
+ if request.resource
1997
+ header_params["resource"] = request.resource
1998
+ end
1999
+
1634
2000
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1635
2001
  metadata[:"x-goog-request-params"] ||= request_params_header
1636
2002
 
1637
2003
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1638
2004
  metadata: metadata,
1639
2005
  retry_policy: @config.rpcs.set_iam_policy.retry_policy
1640
- options.apply_defaults metadata: @config.metadata,
2006
+
2007
+ options.apply_defaults timeout: @config.timeout,
2008
+ metadata: @config.metadata,
1641
2009
  retry_policy: @config.retry_policy
1642
2010
 
1643
2011
  @artifact_registry_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
@@ -1681,6 +2049,21 @@ module Google
1681
2049
  #
1682
2050
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1683
2051
  #
2052
+ # @example Basic example
2053
+ # require "google/cloud/artifact_registry/v1beta2"
2054
+ #
2055
+ # # Create a client object. The client can be reused for multiple calls.
2056
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
2057
+ #
2058
+ # # Create a request. To set request fields, pass in keyword arguments.
2059
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
2060
+ #
2061
+ # # Call the get_iam_policy method.
2062
+ # result = client.get_iam_policy request
2063
+ #
2064
+ # # The returned object is of type Google::Iam::V1::Policy.
2065
+ # p result
2066
+ #
1684
2067
  def get_iam_policy request, options = nil
1685
2068
  raise ::ArgumentError, "request must be provided" if request.nil?
1686
2069
 
@@ -1698,16 +2081,20 @@ module Google
1698
2081
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1699
2082
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1700
2083
 
1701
- header_params = {
1702
- "resource" => request.resource
1703
- }
2084
+ header_params = {}
2085
+ if request.resource
2086
+ header_params["resource"] = request.resource
2087
+ end
2088
+
1704
2089
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1705
2090
  metadata[:"x-goog-request-params"] ||= request_params_header
1706
2091
 
1707
2092
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1708
2093
  metadata: metadata,
1709
2094
  retry_policy: @config.rpcs.get_iam_policy.retry_policy
1710
- options.apply_defaults metadata: @config.metadata,
2095
+
2096
+ options.apply_defaults timeout: @config.timeout,
2097
+ metadata: @config.metadata,
1711
2098
  retry_policy: @config.retry_policy
1712
2099
 
1713
2100
  @artifact_registry_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
@@ -1753,6 +2140,21 @@ module Google
1753
2140
  #
1754
2141
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1755
2142
  #
2143
+ # @example Basic example
2144
+ # require "google/cloud/artifact_registry/v1beta2"
2145
+ #
2146
+ # # Create a client object. The client can be reused for multiple calls.
2147
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
2148
+ #
2149
+ # # Create a request. To set request fields, pass in keyword arguments.
2150
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
2151
+ #
2152
+ # # Call the test_iam_permissions method.
2153
+ # result = client.test_iam_permissions request
2154
+ #
2155
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
2156
+ # p result
2157
+ #
1756
2158
  def test_iam_permissions request, options = nil
1757
2159
  raise ::ArgumentError, "request must be provided" if request.nil?
1758
2160
 
@@ -1770,16 +2172,20 @@ module Google
1770
2172
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1771
2173
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1772
2174
 
1773
- header_params = {
1774
- "resource" => request.resource
1775
- }
2175
+ header_params = {}
2176
+ if request.resource
2177
+ header_params["resource"] = request.resource
2178
+ end
2179
+
1776
2180
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1777
2181
  metadata[:"x-goog-request-params"] ||= request_params_header
1778
2182
 
1779
2183
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1780
2184
  metadata: metadata,
1781
2185
  retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1782
- options.apply_defaults metadata: @config.metadata,
2186
+
2187
+ options.apply_defaults timeout: @config.timeout,
2188
+ metadata: @config.metadata,
1783
2189
  retry_policy: @config.retry_policy
1784
2190
 
1785
2191
  @artifact_registry_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
@@ -1803,22 +2209,21 @@ module Google
1803
2209
  # Configuration can be applied globally to all clients, or to a single client
1804
2210
  # on construction.
1805
2211
  #
1806
- # # Examples
1807
- #
1808
- # To modify the global config, setting the timeout for list_repositories
1809
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1810
- #
1811
- # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
1812
- # config.timeout = 10.0
1813
- # config.rpcs.list_repositories.timeout = 20.0
1814
- # end
1815
- #
1816
- # To apply the above configuration only to a new client:
1817
- #
1818
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
1819
- # config.timeout = 10.0
1820
- # config.rpcs.list_repositories.timeout = 20.0
1821
- # end
2212
+ # @example
2213
+ #
2214
+ # # Modify the global config, setting the timeout for
2215
+ # # list_repositories to 20 seconds,
2216
+ # # and all remaining timeouts to 10 seconds.
2217
+ # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
2218
+ # config.timeout = 10.0
2219
+ # config.rpcs.list_repositories.timeout = 20.0
2220
+ # end
2221
+ #
2222
+ # # Apply the above configuration only to a new client.
2223
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
2224
+ # config.timeout = 10.0
2225
+ # config.rpcs.list_repositories.timeout = 20.0
2226
+ # end
1822
2227
  #
1823
2228
  # @!attribute [rw] endpoint
1824
2229
  # The hostname or hostname:port of the service endpoint.