google-cloud-artifact_registry-v1beta2 0.3.2 → 0.3.6

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]
@@ -191,19 +190,15 @@ module Google
191
190
  ##
192
191
  # Create a new ArtifactRegistry client object.
193
192
  #
194
- # ## Examples
195
- #
196
- # To create a new ArtifactRegistry client with the default
197
- # configuration:
198
- #
199
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
193
+ # @example
200
194
  #
201
- # To create a new ArtifactRegistry client with a custom
202
- # configuration:
195
+ # # Create a client using the default configuration
196
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
203
197
  #
204
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
205
- # config.timeout = 10.0
206
- # 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
207
202
  #
208
203
  # @yield [config] Configure the ArtifactRegistry client.
209
204
  # @yieldparam config [Client::Configuration]
@@ -223,10 +218,9 @@ module Google
223
218
 
224
219
  # Create credentials
225
220
  credentials = @config.credentials
226
- # 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,
227
222
  # but only if the default endpoint does not have a region prefix.
228
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
229
- @config.endpoint == Client.configure.endpoint &&
223
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
230
224
  !@config.endpoint.split(".").first.include?("-")
231
225
  credentials ||= Credentials.default scope: @config.scope,
232
226
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -238,6 +232,7 @@ module Google
238
232
 
239
233
  @operations_client = Operations.new do |config|
240
234
  config.credentials = credentials
235
+ config.quota_project = @quota_project_id
241
236
  config.endpoint = @config.endpoint
242
237
  end
243
238
 
@@ -293,6 +288,27 @@ module Google
293
288
  #
294
289
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
295
290
  #
291
+ # @example Basic example
292
+ # require "google/cloud/artifact_registry/v1beta2"
293
+ #
294
+ # # Create a client object. The client can be reused for multiple calls.
295
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
296
+ #
297
+ # # Create a request. To set request fields, pass in keyword arguments.
298
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest.new
299
+ #
300
+ # # Call the list_repositories method.
301
+ # result = client.list_repositories request
302
+ #
303
+ # # The returned object is of type Gapic::PagedEnumerable. You can
304
+ # # iterate over all elements by calling #each, and the enumerable
305
+ # # will lazily make API calls to fetch subsequent pages. Other
306
+ # # methods are also available for managing paging directly.
307
+ # result.each do |response|
308
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Repository.
309
+ # p response
310
+ # end
311
+ #
296
312
  def list_repositories request, options = nil
297
313
  raise ::ArgumentError, "request must be provided" if request.nil?
298
314
 
@@ -310,16 +326,20 @@ module Google
310
326
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
311
327
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
312
328
 
313
- header_params = {
314
- "parent" => request.parent
315
- }
329
+ header_params = {}
330
+ if request.parent
331
+ header_params["parent"] = request.parent
332
+ end
333
+
316
334
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
317
335
  metadata[:"x-goog-request-params"] ||= request_params_header
318
336
 
319
337
  options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
320
338
  metadata: metadata,
321
339
  retry_policy: @config.rpcs.list_repositories.retry_policy
322
- options.apply_defaults metadata: @config.metadata,
340
+
341
+ options.apply_defaults timeout: @config.timeout,
342
+ metadata: @config.metadata,
323
343
  retry_policy: @config.retry_policy
324
344
 
325
345
  @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
@@ -360,6 +380,21 @@ module Google
360
380
  #
361
381
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
362
382
  #
383
+ # @example Basic example
384
+ # require "google/cloud/artifact_registry/v1beta2"
385
+ #
386
+ # # Create a client object. The client can be reused for multiple calls.
387
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
388
+ #
389
+ # # Create a request. To set request fields, pass in keyword arguments.
390
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest.new
391
+ #
392
+ # # Call the get_repository method.
393
+ # result = client.get_repository request
394
+ #
395
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository.
396
+ # p result
397
+ #
363
398
  def get_repository request, options = nil
364
399
  raise ::ArgumentError, "request must be provided" if request.nil?
365
400
 
@@ -377,16 +412,20 @@ module Google
377
412
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
378
413
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
379
414
 
380
- header_params = {
381
- "name" => request.name
382
- }
415
+ header_params = {}
416
+ if request.name
417
+ header_params["name"] = request.name
418
+ end
419
+
383
420
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
384
421
  metadata[:"x-goog-request-params"] ||= request_params_header
385
422
 
386
423
  options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
387
424
  metadata: metadata,
388
425
  retry_policy: @config.rpcs.get_repository.retry_policy
389
- options.apply_defaults metadata: @config.metadata,
426
+
427
+ options.apply_defaults timeout: @config.timeout,
428
+ metadata: @config.metadata,
390
429
  retry_policy: @config.retry_policy
391
430
 
392
431
  @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
@@ -431,6 +470,28 @@ module Google
431
470
  #
432
471
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
433
472
  #
473
+ # @example Basic example
474
+ # require "google/cloud/artifact_registry/v1beta2"
475
+ #
476
+ # # Create a client object. The client can be reused for multiple calls.
477
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
478
+ #
479
+ # # Create a request. To set request fields, pass in keyword arguments.
480
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest.new
481
+ #
482
+ # # Call the create_repository method.
483
+ # result = client.create_repository request
484
+ #
485
+ # # The returned object is of type Gapic::Operation. You can use this
486
+ # # object to check the status of an operation, cancel it, or wait
487
+ # # for results. Here is how to block until completion:
488
+ # result.wait_until_done! timeout: 60
489
+ # if result.response?
490
+ # p result.response
491
+ # else
492
+ # puts "Error!"
493
+ # end
494
+ #
434
495
  def create_repository request, options = nil
435
496
  raise ::ArgumentError, "request must be provided" if request.nil?
436
497
 
@@ -448,16 +509,20 @@ module Google
448
509
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
449
510
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
450
511
 
451
- header_params = {
452
- "parent" => request.parent
453
- }
512
+ header_params = {}
513
+ if request.parent
514
+ header_params["parent"] = request.parent
515
+ end
516
+
454
517
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
455
518
  metadata[:"x-goog-request-params"] ||= request_params_header
456
519
 
457
520
  options.apply_defaults timeout: @config.rpcs.create_repository.timeout,
458
521
  metadata: metadata,
459
522
  retry_policy: @config.rpcs.create_repository.retry_policy
460
- options.apply_defaults metadata: @config.metadata,
523
+
524
+ options.apply_defaults timeout: @config.timeout,
525
+ metadata: @config.metadata,
461
526
  retry_policy: @config.retry_policy
462
527
 
463
528
  @artifact_registry_stub.call_rpc :create_repository, request, options: options do |response, operation|
@@ -502,6 +567,21 @@ module Google
502
567
  #
503
568
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
504
569
  #
570
+ # @example Basic example
571
+ # require "google/cloud/artifact_registry/v1beta2"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest.new
578
+ #
579
+ # # Call the update_repository method.
580
+ # result = client.update_repository request
581
+ #
582
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository.
583
+ # p result
584
+ #
505
585
  def update_repository request, options = nil
506
586
  raise ::ArgumentError, "request must be provided" if request.nil?
507
587
 
@@ -519,16 +599,20 @@ module Google
519
599
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
520
600
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
521
601
 
522
- header_params = {
523
- "repository.name" => request.repository.name
524
- }
602
+ header_params = {}
603
+ if request.repository&.name
604
+ header_params["repository.name"] = request.repository.name
605
+ end
606
+
525
607
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
526
608
  metadata[:"x-goog-request-params"] ||= request_params_header
527
609
 
528
610
  options.apply_defaults timeout: @config.rpcs.update_repository.timeout,
529
611
  metadata: metadata,
530
612
  retry_policy: @config.rpcs.update_repository.retry_policy
531
- options.apply_defaults metadata: @config.metadata,
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
532
616
  retry_policy: @config.retry_policy
533
617
 
534
618
  @artifact_registry_stub.call_rpc :update_repository, request, options: options do |response, operation|
@@ -570,6 +654,28 @@ module Google
570
654
  #
571
655
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
572
656
  #
657
+ # @example Basic example
658
+ # require "google/cloud/artifact_registry/v1beta2"
659
+ #
660
+ # # Create a client object. The client can be reused for multiple calls.
661
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
662
+ #
663
+ # # Create a request. To set request fields, pass in keyword arguments.
664
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest.new
665
+ #
666
+ # # Call the delete_repository method.
667
+ # result = client.delete_repository request
668
+ #
669
+ # # The returned object is of type Gapic::Operation. You can use this
670
+ # # object to check the status of an operation, cancel it, or wait
671
+ # # for results. Here is how to block until completion:
672
+ # result.wait_until_done! timeout: 60
673
+ # if result.response?
674
+ # p result.response
675
+ # else
676
+ # puts "Error!"
677
+ # end
678
+ #
573
679
  def delete_repository request, options = nil
574
680
  raise ::ArgumentError, "request must be provided" if request.nil?
575
681
 
@@ -587,16 +693,20 @@ module Google
587
693
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
588
694
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
589
695
 
590
- header_params = {
591
- "name" => request.name
592
- }
696
+ header_params = {}
697
+ if request.name
698
+ header_params["name"] = request.name
699
+ end
700
+
593
701
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
594
702
  metadata[:"x-goog-request-params"] ||= request_params_header
595
703
 
596
704
  options.apply_defaults timeout: @config.rpcs.delete_repository.timeout,
597
705
  metadata: metadata,
598
706
  retry_policy: @config.rpcs.delete_repository.retry_policy
599
- options.apply_defaults metadata: @config.metadata,
707
+
708
+ options.apply_defaults timeout: @config.timeout,
709
+ metadata: @config.metadata,
600
710
  retry_policy: @config.retry_policy
601
711
 
602
712
  @artifact_registry_stub.call_rpc :delete_repository, request, options: options do |response, operation|
@@ -642,6 +752,27 @@ module Google
642
752
  #
643
753
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
644
754
  #
755
+ # @example Basic example
756
+ # require "google/cloud/artifact_registry/v1beta2"
757
+ #
758
+ # # Create a client object. The client can be reused for multiple calls.
759
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
760
+ #
761
+ # # Create a request. To set request fields, pass in keyword arguments.
762
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest.new
763
+ #
764
+ # # Call the list_packages method.
765
+ # result = client.list_packages request
766
+ #
767
+ # # The returned object is of type Gapic::PagedEnumerable. You can
768
+ # # iterate over all elements by calling #each, and the enumerable
769
+ # # will lazily make API calls to fetch subsequent pages. Other
770
+ # # methods are also available for managing paging directly.
771
+ # result.each do |response|
772
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Package.
773
+ # p response
774
+ # end
775
+ #
645
776
  def list_packages request, options = nil
646
777
  raise ::ArgumentError, "request must be provided" if request.nil?
647
778
 
@@ -659,16 +790,20 @@ module Google
659
790
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
660
791
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
661
792
 
662
- header_params = {
663
- "parent" => request.parent
664
- }
793
+ header_params = {}
794
+ if request.parent
795
+ header_params["parent"] = request.parent
796
+ end
797
+
665
798
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
666
799
  metadata[:"x-goog-request-params"] ||= request_params_header
667
800
 
668
801
  options.apply_defaults timeout: @config.rpcs.list_packages.timeout,
669
802
  metadata: metadata,
670
803
  retry_policy: @config.rpcs.list_packages.retry_policy
671
- options.apply_defaults metadata: @config.metadata,
804
+
805
+ options.apply_defaults timeout: @config.timeout,
806
+ metadata: @config.metadata,
672
807
  retry_policy: @config.retry_policy
673
808
 
674
809
  @artifact_registry_stub.call_rpc :list_packages, request, options: options do |response, operation|
@@ -709,6 +844,21 @@ module Google
709
844
  #
710
845
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
711
846
  #
847
+ # @example Basic example
848
+ # require "google/cloud/artifact_registry/v1beta2"
849
+ #
850
+ # # Create a client object. The client can be reused for multiple calls.
851
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
852
+ #
853
+ # # Create a request. To set request fields, pass in keyword arguments.
854
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest.new
855
+ #
856
+ # # Call the get_package method.
857
+ # result = client.get_package request
858
+ #
859
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Package.
860
+ # p result
861
+ #
712
862
  def get_package request, options = nil
713
863
  raise ::ArgumentError, "request must be provided" if request.nil?
714
864
 
@@ -726,16 +876,20 @@ module Google
726
876
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
727
877
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
728
878
 
729
- header_params = {
730
- "name" => request.name
731
- }
879
+ header_params = {}
880
+ if request.name
881
+ header_params["name"] = request.name
882
+ end
883
+
732
884
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
733
885
  metadata[:"x-goog-request-params"] ||= request_params_header
734
886
 
735
887
  options.apply_defaults timeout: @config.rpcs.get_package.timeout,
736
888
  metadata: metadata,
737
889
  retry_policy: @config.rpcs.get_package.retry_policy
738
- options.apply_defaults metadata: @config.metadata,
890
+
891
+ options.apply_defaults timeout: @config.timeout,
892
+ metadata: @config.metadata,
739
893
  retry_policy: @config.retry_policy
740
894
 
741
895
  @artifact_registry_stub.call_rpc :get_package, request, options: options do |response, operation|
@@ -776,6 +930,28 @@ module Google
776
930
  #
777
931
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
778
932
  #
933
+ # @example Basic example
934
+ # require "google/cloud/artifact_registry/v1beta2"
935
+ #
936
+ # # Create a client object. The client can be reused for multiple calls.
937
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
938
+ #
939
+ # # Create a request. To set request fields, pass in keyword arguments.
940
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest.new
941
+ #
942
+ # # Call the delete_package method.
943
+ # result = client.delete_package request
944
+ #
945
+ # # The returned object is of type Gapic::Operation. You can use this
946
+ # # object to check the status of an operation, cancel it, or wait
947
+ # # for results. Here is how to block until completion:
948
+ # result.wait_until_done! timeout: 60
949
+ # if result.response?
950
+ # p result.response
951
+ # else
952
+ # puts "Error!"
953
+ # end
954
+ #
779
955
  def delete_package request, options = nil
780
956
  raise ::ArgumentError, "request must be provided" if request.nil?
781
957
 
@@ -793,16 +969,20 @@ module Google
793
969
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
794
970
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
795
971
 
796
- header_params = {
797
- "name" => request.name
798
- }
972
+ header_params = {}
973
+ if request.name
974
+ header_params["name"] = request.name
975
+ end
976
+
799
977
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
800
978
  metadata[:"x-goog-request-params"] ||= request_params_header
801
979
 
802
980
  options.apply_defaults timeout: @config.rpcs.delete_package.timeout,
803
981
  metadata: metadata,
804
982
  retry_policy: @config.rpcs.delete_package.retry_policy
805
- options.apply_defaults metadata: @config.metadata,
983
+
984
+ options.apply_defaults timeout: @config.timeout,
985
+ metadata: @config.metadata,
806
986
  retry_policy: @config.retry_policy
807
987
 
808
988
  @artifact_registry_stub.call_rpc :delete_package, request, options: options do |response, operation|
@@ -850,6 +1030,27 @@ module Google
850
1030
  #
851
1031
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
852
1032
  #
1033
+ # @example Basic example
1034
+ # require "google/cloud/artifact_registry/v1beta2"
1035
+ #
1036
+ # # Create a client object. The client can be reused for multiple calls.
1037
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1038
+ #
1039
+ # # Create a request. To set request fields, pass in keyword arguments.
1040
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest.new
1041
+ #
1042
+ # # Call the list_versions method.
1043
+ # result = client.list_versions request
1044
+ #
1045
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1046
+ # # iterate over all elements by calling #each, and the enumerable
1047
+ # # will lazily make API calls to fetch subsequent pages. Other
1048
+ # # methods are also available for managing paging directly.
1049
+ # result.each do |response|
1050
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Version.
1051
+ # p response
1052
+ # end
1053
+ #
853
1054
  def list_versions request, options = nil
854
1055
  raise ::ArgumentError, "request must be provided" if request.nil?
855
1056
 
@@ -867,16 +1068,20 @@ module Google
867
1068
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
868
1069
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
869
1070
 
870
- header_params = {
871
- "parent" => request.parent
872
- }
1071
+ header_params = {}
1072
+ if request.parent
1073
+ header_params["parent"] = request.parent
1074
+ end
1075
+
873
1076
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
874
1077
  metadata[:"x-goog-request-params"] ||= request_params_header
875
1078
 
876
1079
  options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
877
1080
  metadata: metadata,
878
1081
  retry_policy: @config.rpcs.list_versions.retry_policy
879
- options.apply_defaults metadata: @config.metadata,
1082
+
1083
+ options.apply_defaults timeout: @config.timeout,
1084
+ metadata: @config.metadata,
880
1085
  retry_policy: @config.retry_policy
881
1086
 
882
1087
  @artifact_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
@@ -919,6 +1124,21 @@ module Google
919
1124
  #
920
1125
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
921
1126
  #
1127
+ # @example Basic example
1128
+ # require "google/cloud/artifact_registry/v1beta2"
1129
+ #
1130
+ # # Create a client object. The client can be reused for multiple calls.
1131
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1132
+ #
1133
+ # # Create a request. To set request fields, pass in keyword arguments.
1134
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest.new
1135
+ #
1136
+ # # Call the get_version method.
1137
+ # result = client.get_version request
1138
+ #
1139
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Version.
1140
+ # p result
1141
+ #
922
1142
  def get_version request, options = nil
923
1143
  raise ::ArgumentError, "request must be provided" if request.nil?
924
1144
 
@@ -936,16 +1156,20 @@ module Google
936
1156
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
937
1157
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
938
1158
 
939
- header_params = {
940
- "name" => request.name
941
- }
1159
+ header_params = {}
1160
+ if request.name
1161
+ header_params["name"] = request.name
1162
+ end
1163
+
942
1164
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
943
1165
  metadata[:"x-goog-request-params"] ||= request_params_header
944
1166
 
945
1167
  options.apply_defaults timeout: @config.rpcs.get_version.timeout,
946
1168
  metadata: metadata,
947
1169
  retry_policy: @config.rpcs.get_version.retry_policy
948
- options.apply_defaults metadata: @config.metadata,
1170
+
1171
+ options.apply_defaults timeout: @config.timeout,
1172
+ metadata: @config.metadata,
949
1173
  retry_policy: @config.retry_policy
950
1174
 
951
1175
  @artifact_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
@@ -989,6 +1213,28 @@ module Google
989
1213
  #
990
1214
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
991
1215
  #
1216
+ # @example Basic example
1217
+ # require "google/cloud/artifact_registry/v1beta2"
1218
+ #
1219
+ # # Create a client object. The client can be reused for multiple calls.
1220
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1221
+ #
1222
+ # # Create a request. To set request fields, pass in keyword arguments.
1223
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest.new
1224
+ #
1225
+ # # Call the delete_version method.
1226
+ # result = client.delete_version request
1227
+ #
1228
+ # # The returned object is of type Gapic::Operation. You can use this
1229
+ # # object to check the status of an operation, cancel it, or wait
1230
+ # # for results. Here is how to block until completion:
1231
+ # result.wait_until_done! timeout: 60
1232
+ # if result.response?
1233
+ # p result.response
1234
+ # else
1235
+ # puts "Error!"
1236
+ # end
1237
+ #
992
1238
  def delete_version request, options = nil
993
1239
  raise ::ArgumentError, "request must be provided" if request.nil?
994
1240
 
@@ -1006,16 +1252,20 @@ module Google
1006
1252
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1007
1253
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1008
1254
 
1009
- header_params = {
1010
- "name" => request.name
1011
- }
1255
+ header_params = {}
1256
+ if request.name
1257
+ header_params["name"] = request.name
1258
+ end
1259
+
1012
1260
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1013
1261
  metadata[:"x-goog-request-params"] ||= request_params_header
1014
1262
 
1015
1263
  options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
1016
1264
  metadata: metadata,
1017
1265
  retry_policy: @config.rpcs.delete_version.retry_policy
1018
- options.apply_defaults metadata: @config.metadata,
1266
+
1267
+ options.apply_defaults timeout: @config.timeout,
1268
+ metadata: @config.metadata,
1019
1269
  retry_policy: @config.retry_policy
1020
1270
 
1021
1271
  @artifact_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
@@ -1073,6 +1323,27 @@ module Google
1073
1323
  #
1074
1324
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1075
1325
  #
1326
+ # @example Basic example
1327
+ # require "google/cloud/artifact_registry/v1beta2"
1328
+ #
1329
+ # # Create a client object. The client can be reused for multiple calls.
1330
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1331
+ #
1332
+ # # Create a request. To set request fields, pass in keyword arguments.
1333
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest.new
1334
+ #
1335
+ # # Call the list_files method.
1336
+ # result = client.list_files 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::V1beta2::File.
1344
+ # p response
1345
+ # end
1346
+ #
1076
1347
  def list_files request, options = nil
1077
1348
  raise ::ArgumentError, "request must be provided" if request.nil?
1078
1349
 
@@ -1090,16 +1361,20 @@ module Google
1090
1361
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1091
1362
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1092
1363
 
1093
- header_params = {
1094
- "parent" => request.parent
1095
- }
1364
+ header_params = {}
1365
+ if request.parent
1366
+ header_params["parent"] = request.parent
1367
+ end
1368
+
1096
1369
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1097
1370
  metadata[:"x-goog-request-params"] ||= request_params_header
1098
1371
 
1099
1372
  options.apply_defaults timeout: @config.rpcs.list_files.timeout,
1100
1373
  metadata: metadata,
1101
1374
  retry_policy: @config.rpcs.list_files.retry_policy
1102
- options.apply_defaults metadata: @config.metadata,
1375
+
1376
+ options.apply_defaults timeout: @config.timeout,
1377
+ metadata: @config.metadata,
1103
1378
  retry_policy: @config.retry_policy
1104
1379
 
1105
1380
  @artifact_registry_stub.call_rpc :list_files, request, options: options do |response, operation|
@@ -1140,6 +1415,21 @@ module Google
1140
1415
  #
1141
1416
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1142
1417
  #
1418
+ # @example Basic example
1419
+ # require "google/cloud/artifact_registry/v1beta2"
1420
+ #
1421
+ # # Create a client object. The client can be reused for multiple calls.
1422
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1423
+ #
1424
+ # # Create a request. To set request fields, pass in keyword arguments.
1425
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest.new
1426
+ #
1427
+ # # Call the get_file method.
1428
+ # result = client.get_file request
1429
+ #
1430
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::File.
1431
+ # p result
1432
+ #
1143
1433
  def get_file request, options = nil
1144
1434
  raise ::ArgumentError, "request must be provided" if request.nil?
1145
1435
 
@@ -1157,16 +1447,20 @@ module Google
1157
1447
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1158
1448
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1159
1449
 
1160
- header_params = {
1161
- "name" => request.name
1162
- }
1450
+ header_params = {}
1451
+ if request.name
1452
+ header_params["name"] = request.name
1453
+ end
1454
+
1163
1455
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1164
1456
  metadata[:"x-goog-request-params"] ||= request_params_header
1165
1457
 
1166
1458
  options.apply_defaults timeout: @config.rpcs.get_file.timeout,
1167
1459
  metadata: metadata,
1168
1460
  retry_policy: @config.rpcs.get_file.retry_policy
1169
- options.apply_defaults metadata: @config.metadata,
1461
+
1462
+ options.apply_defaults timeout: @config.timeout,
1463
+ metadata: @config.metadata,
1170
1464
  retry_policy: @config.retry_policy
1171
1465
 
1172
1466
  @artifact_registry_stub.call_rpc :get_file, request, options: options do |response, operation|
@@ -1221,6 +1515,27 @@ module Google
1221
1515
  #
1222
1516
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1223
1517
  #
1518
+ # @example Basic example
1519
+ # require "google/cloud/artifact_registry/v1beta2"
1520
+ #
1521
+ # # Create a client object. The client can be reused for multiple calls.
1522
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1523
+ #
1524
+ # # Create a request. To set request fields, pass in keyword arguments.
1525
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest.new
1526
+ #
1527
+ # # Call the list_tags method.
1528
+ # result = client.list_tags request
1529
+ #
1530
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1531
+ # # iterate over all elements by calling #each, and the enumerable
1532
+ # # will lazily make API calls to fetch subsequent pages. Other
1533
+ # # methods are also available for managing paging directly.
1534
+ # result.each do |response|
1535
+ # # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1536
+ # p response
1537
+ # end
1538
+ #
1224
1539
  def list_tags request, options = nil
1225
1540
  raise ::ArgumentError, "request must be provided" if request.nil?
1226
1541
 
@@ -1238,16 +1553,20 @@ module Google
1238
1553
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1239
1554
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1240
1555
 
1241
- header_params = {
1242
- "parent" => request.parent
1243
- }
1556
+ header_params = {}
1557
+ if request.parent
1558
+ header_params["parent"] = request.parent
1559
+ end
1560
+
1244
1561
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1245
1562
  metadata[:"x-goog-request-params"] ||= request_params_header
1246
1563
 
1247
1564
  options.apply_defaults timeout: @config.rpcs.list_tags.timeout,
1248
1565
  metadata: metadata,
1249
1566
  retry_policy: @config.rpcs.list_tags.retry_policy
1250
- options.apply_defaults metadata: @config.metadata,
1567
+
1568
+ options.apply_defaults timeout: @config.timeout,
1569
+ metadata: @config.metadata,
1251
1570
  retry_policy: @config.retry_policy
1252
1571
 
1253
1572
  @artifact_registry_stub.call_rpc :list_tags, request, options: options do |response, operation|
@@ -1288,6 +1607,21 @@ module Google
1288
1607
  #
1289
1608
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1290
1609
  #
1610
+ # @example Basic example
1611
+ # require "google/cloud/artifact_registry/v1beta2"
1612
+ #
1613
+ # # Create a client object. The client can be reused for multiple calls.
1614
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1615
+ #
1616
+ # # Create a request. To set request fields, pass in keyword arguments.
1617
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest.new
1618
+ #
1619
+ # # Call the get_tag method.
1620
+ # result = client.get_tag request
1621
+ #
1622
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1623
+ # p result
1624
+ #
1291
1625
  def get_tag request, options = nil
1292
1626
  raise ::ArgumentError, "request must be provided" if request.nil?
1293
1627
 
@@ -1305,16 +1639,20 @@ module Google
1305
1639
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1306
1640
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1307
1641
 
1308
- header_params = {
1309
- "name" => request.name
1310
- }
1642
+ header_params = {}
1643
+ if request.name
1644
+ header_params["name"] = request.name
1645
+ end
1646
+
1311
1647
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1312
1648
  metadata[:"x-goog-request-params"] ||= request_params_header
1313
1649
 
1314
1650
  options.apply_defaults timeout: @config.rpcs.get_tag.timeout,
1315
1651
  metadata: metadata,
1316
1652
  retry_policy: @config.rpcs.get_tag.retry_policy
1317
- options.apply_defaults metadata: @config.metadata,
1653
+
1654
+ options.apply_defaults timeout: @config.timeout,
1655
+ metadata: @config.metadata,
1318
1656
  retry_policy: @config.retry_policy
1319
1657
 
1320
1658
  @artifact_registry_stub.call_rpc :get_tag, request, options: options do |response, operation|
@@ -1358,6 +1696,21 @@ module Google
1358
1696
  #
1359
1697
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1360
1698
  #
1699
+ # @example Basic example
1700
+ # require "google/cloud/artifact_registry/v1beta2"
1701
+ #
1702
+ # # Create a client object. The client can be reused for multiple calls.
1703
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1704
+ #
1705
+ # # Create a request. To set request fields, pass in keyword arguments.
1706
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest.new
1707
+ #
1708
+ # # Call the create_tag method.
1709
+ # result = client.create_tag request
1710
+ #
1711
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1712
+ # p result
1713
+ #
1361
1714
  def create_tag request, options = nil
1362
1715
  raise ::ArgumentError, "request must be provided" if request.nil?
1363
1716
 
@@ -1375,16 +1728,20 @@ module Google
1375
1728
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1376
1729
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1377
1730
 
1378
- header_params = {
1379
- "parent" => request.parent
1380
- }
1731
+ header_params = {}
1732
+ if request.parent
1733
+ header_params["parent"] = request.parent
1734
+ end
1735
+
1381
1736
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1382
1737
  metadata[:"x-goog-request-params"] ||= request_params_header
1383
1738
 
1384
1739
  options.apply_defaults timeout: @config.rpcs.create_tag.timeout,
1385
1740
  metadata: metadata,
1386
1741
  retry_policy: @config.rpcs.create_tag.retry_policy
1387
- options.apply_defaults metadata: @config.metadata,
1742
+
1743
+ options.apply_defaults timeout: @config.timeout,
1744
+ metadata: @config.metadata,
1388
1745
  retry_policy: @config.retry_policy
1389
1746
 
1390
1747
  @artifact_registry_stub.call_rpc :create_tag, request, options: options do |response, operation|
@@ -1428,6 +1785,21 @@ module Google
1428
1785
  #
1429
1786
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1430
1787
  #
1788
+ # @example Basic example
1789
+ # require "google/cloud/artifact_registry/v1beta2"
1790
+ #
1791
+ # # Create a client object. The client can be reused for multiple calls.
1792
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1793
+ #
1794
+ # # Create a request. To set request fields, pass in keyword arguments.
1795
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest.new
1796
+ #
1797
+ # # Call the update_tag method.
1798
+ # result = client.update_tag request
1799
+ #
1800
+ # # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag.
1801
+ # p result
1802
+ #
1431
1803
  def update_tag request, options = nil
1432
1804
  raise ::ArgumentError, "request must be provided" if request.nil?
1433
1805
 
@@ -1445,16 +1817,20 @@ module Google
1445
1817
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1446
1818
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1447
1819
 
1448
- header_params = {
1449
- "tag.name" => request.tag.name
1450
- }
1820
+ header_params = {}
1821
+ if request.tag&.name
1822
+ header_params["tag.name"] = request.tag.name
1823
+ end
1824
+
1451
1825
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1452
1826
  metadata[:"x-goog-request-params"] ||= request_params_header
1453
1827
 
1454
1828
  options.apply_defaults timeout: @config.rpcs.update_tag.timeout,
1455
1829
  metadata: metadata,
1456
1830
  retry_policy: @config.rpcs.update_tag.retry_policy
1457
- options.apply_defaults metadata: @config.metadata,
1831
+
1832
+ options.apply_defaults timeout: @config.timeout,
1833
+ metadata: @config.metadata,
1458
1834
  retry_policy: @config.retry_policy
1459
1835
 
1460
1836
  @artifact_registry_stub.call_rpc :update_tag, request, options: options do |response, operation|
@@ -1494,6 +1870,21 @@ module Google
1494
1870
  #
1495
1871
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1496
1872
  #
1873
+ # @example Basic example
1874
+ # require "google/cloud/artifact_registry/v1beta2"
1875
+ #
1876
+ # # Create a client object. The client can be reused for multiple calls.
1877
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1878
+ #
1879
+ # # Create a request. To set request fields, pass in keyword arguments.
1880
+ # request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest.new
1881
+ #
1882
+ # # Call the delete_tag method.
1883
+ # result = client.delete_tag request
1884
+ #
1885
+ # # The returned object is of type Google::Protobuf::Empty.
1886
+ # p result
1887
+ #
1497
1888
  def delete_tag request, options = nil
1498
1889
  raise ::ArgumentError, "request must be provided" if request.nil?
1499
1890
 
@@ -1511,16 +1902,20 @@ module Google
1511
1902
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1512
1903
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1513
1904
 
1514
- header_params = {
1515
- "name" => request.name
1516
- }
1905
+ header_params = {}
1906
+ if request.name
1907
+ header_params["name"] = request.name
1908
+ end
1909
+
1517
1910
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1518
1911
  metadata[:"x-goog-request-params"] ||= request_params_header
1519
1912
 
1520
1913
  options.apply_defaults timeout: @config.rpcs.delete_tag.timeout,
1521
1914
  metadata: metadata,
1522
1915
  retry_policy: @config.rpcs.delete_tag.retry_policy
1523
- options.apply_defaults metadata: @config.metadata,
1916
+
1917
+ options.apply_defaults timeout: @config.timeout,
1918
+ metadata: @config.metadata,
1524
1919
  retry_policy: @config.retry_policy
1525
1920
 
1526
1921
  @artifact_registry_stub.call_rpc :delete_tag, request, options: options do |response, operation|
@@ -1566,6 +1961,21 @@ module Google
1566
1961
  #
1567
1962
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1568
1963
  #
1964
+ # @example Basic example
1965
+ # require "google/cloud/artifact_registry/v1beta2"
1966
+ #
1967
+ # # Create a client object. The client can be reused for multiple calls.
1968
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
1969
+ #
1970
+ # # Create a request. To set request fields, pass in keyword arguments.
1971
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1972
+ #
1973
+ # # Call the set_iam_policy method.
1974
+ # result = client.set_iam_policy request
1975
+ #
1976
+ # # The returned object is of type Google::Iam::V1::Policy.
1977
+ # p result
1978
+ #
1569
1979
  def set_iam_policy request, options = nil
1570
1980
  raise ::ArgumentError, "request must be provided" if request.nil?
1571
1981
 
@@ -1583,16 +1993,20 @@ module Google
1583
1993
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1584
1994
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1585
1995
 
1586
- header_params = {
1587
- "resource" => request.resource
1588
- }
1996
+ header_params = {}
1997
+ if request.resource
1998
+ header_params["resource"] = request.resource
1999
+ end
2000
+
1589
2001
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1590
2002
  metadata[:"x-goog-request-params"] ||= request_params_header
1591
2003
 
1592
2004
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1593
2005
  metadata: metadata,
1594
2006
  retry_policy: @config.rpcs.set_iam_policy.retry_policy
1595
- options.apply_defaults metadata: @config.metadata,
2007
+
2008
+ options.apply_defaults timeout: @config.timeout,
2009
+ metadata: @config.metadata,
1596
2010
  retry_policy: @config.retry_policy
1597
2011
 
1598
2012
  @artifact_registry_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
@@ -1636,6 +2050,21 @@ module Google
1636
2050
  #
1637
2051
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1638
2052
  #
2053
+ # @example Basic example
2054
+ # require "google/cloud/artifact_registry/v1beta2"
2055
+ #
2056
+ # # Create a client object. The client can be reused for multiple calls.
2057
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
2058
+ #
2059
+ # # Create a request. To set request fields, pass in keyword arguments.
2060
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
2061
+ #
2062
+ # # Call the get_iam_policy method.
2063
+ # result = client.get_iam_policy request
2064
+ #
2065
+ # # The returned object is of type Google::Iam::V1::Policy.
2066
+ # p result
2067
+ #
1639
2068
  def get_iam_policy request, options = nil
1640
2069
  raise ::ArgumentError, "request must be provided" if request.nil?
1641
2070
 
@@ -1653,16 +2082,20 @@ module Google
1653
2082
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1654
2083
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1655
2084
 
1656
- header_params = {
1657
- "resource" => request.resource
1658
- }
2085
+ header_params = {}
2086
+ if request.resource
2087
+ header_params["resource"] = request.resource
2088
+ end
2089
+
1659
2090
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1660
2091
  metadata[:"x-goog-request-params"] ||= request_params_header
1661
2092
 
1662
2093
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1663
2094
  metadata: metadata,
1664
2095
  retry_policy: @config.rpcs.get_iam_policy.retry_policy
1665
- options.apply_defaults metadata: @config.metadata,
2096
+
2097
+ options.apply_defaults timeout: @config.timeout,
2098
+ metadata: @config.metadata,
1666
2099
  retry_policy: @config.retry_policy
1667
2100
 
1668
2101
  @artifact_registry_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
@@ -1708,6 +2141,21 @@ module Google
1708
2141
  #
1709
2142
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1710
2143
  #
2144
+ # @example Basic example
2145
+ # require "google/cloud/artifact_registry/v1beta2"
2146
+ #
2147
+ # # Create a client object. The client can be reused for multiple calls.
2148
+ # client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new
2149
+ #
2150
+ # # Create a request. To set request fields, pass in keyword arguments.
2151
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
2152
+ #
2153
+ # # Call the test_iam_permissions method.
2154
+ # result = client.test_iam_permissions request
2155
+ #
2156
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
2157
+ # p result
2158
+ #
1711
2159
  def test_iam_permissions request, options = nil
1712
2160
  raise ::ArgumentError, "request must be provided" if request.nil?
1713
2161
 
@@ -1725,16 +2173,20 @@ module Google
1725
2173
  gapic_version: ::Google::Cloud::ArtifactRegistry::V1beta2::VERSION
1726
2174
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1727
2175
 
1728
- header_params = {
1729
- "resource" => request.resource
1730
- }
2176
+ header_params = {}
2177
+ if request.resource
2178
+ header_params["resource"] = request.resource
2179
+ end
2180
+
1731
2181
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1732
2182
  metadata[:"x-goog-request-params"] ||= request_params_header
1733
2183
 
1734
2184
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1735
2185
  metadata: metadata,
1736
2186
  retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1737
- options.apply_defaults metadata: @config.metadata,
2187
+
2188
+ options.apply_defaults timeout: @config.timeout,
2189
+ metadata: @config.metadata,
1738
2190
  retry_policy: @config.retry_policy
1739
2191
 
1740
2192
  @artifact_registry_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
@@ -1758,22 +2210,21 @@ module Google
1758
2210
  # Configuration can be applied globally to all clients, or to a single client
1759
2211
  # on construction.
1760
2212
  #
1761
- # # Examples
1762
- #
1763
- # To modify the global config, setting the timeout for list_repositories
1764
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1765
- #
1766
- # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
1767
- # config.timeout = 10.0
1768
- # config.rpcs.list_repositories.timeout = 20.0
1769
- # end
1770
- #
1771
- # To apply the above configuration only to a new client:
1772
- #
1773
- # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
1774
- # config.timeout = 10.0
1775
- # config.rpcs.list_repositories.timeout = 20.0
1776
- # end
2213
+ # @example
2214
+ #
2215
+ # # Modify the global config, setting the timeout for
2216
+ # # list_repositories to 20 seconds,
2217
+ # # and all remaining timeouts to 10 seconds.
2218
+ # ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.configure do |config|
2219
+ # config.timeout = 10.0
2220
+ # config.rpcs.list_repositories.timeout = 20.0
2221
+ # end
2222
+ #
2223
+ # # Apply the above configuration only to a new client.
2224
+ # client = ::Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new do |config|
2225
+ # config.timeout = 10.0
2226
+ # config.rpcs.list_repositories.timeout = 20.0
2227
+ # end
1777
2228
  #
1778
2229
  # @!attribute [rw] endpoint
1779
2230
  # The hostname or hostname:port of the service endpoint.