google-cloud-build-v1 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -195,6 +195,7 @@ module Google
195
195
 
196
196
  @operations_client = Operations.new do |config|
197
197
  config.credentials = credentials
198
+ config.quota_project = @quota_project_id
198
199
  config.endpoint = @config.endpoint
199
200
  end
200
201
 
@@ -254,6 +255,28 @@ module Google
254
255
  #
255
256
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
256
257
  #
258
+ # @example Basic example
259
+ # require "google/cloud/build/v1"
260
+ #
261
+ # # Create a client object. The client can be reused for multiple calls.
262
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
263
+ #
264
+ # # Create a request. To set request fields, pass in keyword arguments.
265
+ # request = Google::Cloud::Build::V1::CreateBuildRequest.new
266
+ #
267
+ # # Call the create_build method.
268
+ # result = client.create_build request
269
+ #
270
+ # # The returned object is of type Gapic::Operation. You can use this
271
+ # # object to check the status of an operation, cancel it, or wait
272
+ # # for results. Here is how to block until completion:
273
+ # result.wait_until_done! timeout: 60
274
+ # if result.response?
275
+ # p result.response
276
+ # else
277
+ # puts "Error!"
278
+ # end
279
+ #
257
280
  def create_build request, options = nil
258
281
  raise ::ArgumentError, "request must be provided" if request.nil?
259
282
 
@@ -271,9 +294,11 @@ module Google
271
294
  gapic_version: ::Google::Cloud::Build::V1::VERSION
272
295
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
296
 
274
- header_params = {
275
- "project_id" => request.project_id
276
- }
297
+ header_params = {}
298
+ if request.project_id
299
+ header_params["project_id"] = request.project_id
300
+ end
301
+
277
302
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
278
303
  metadata[:"x-goog-request-params"] ||= request_params_header
279
304
 
@@ -331,6 +356,21 @@ module Google
331
356
  #
332
357
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
333
358
  #
359
+ # @example Basic example
360
+ # require "google/cloud/build/v1"
361
+ #
362
+ # # Create a client object. The client can be reused for multiple calls.
363
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
364
+ #
365
+ # # Create a request. To set request fields, pass in keyword arguments.
366
+ # request = Google::Cloud::Build::V1::GetBuildRequest.new
367
+ #
368
+ # # Call the get_build method.
369
+ # result = client.get_build request
370
+ #
371
+ # # The returned object is of type Google::Cloud::Build::V1::Build.
372
+ # p result
373
+ #
334
374
  def get_build request, options = nil
335
375
  raise ::ArgumentError, "request must be provided" if request.nil?
336
376
 
@@ -348,10 +388,14 @@ module Google
348
388
  gapic_version: ::Google::Cloud::Build::V1::VERSION
349
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
350
390
 
351
- header_params = {
352
- "project_id" => request.project_id,
353
- "id" => request.id
354
- }
391
+ header_params = {}
392
+ if request.project_id
393
+ header_params["project_id"] = request.project_id
394
+ end
395
+ if request.id
396
+ header_params["id"] = request.id
397
+ end
398
+
355
399
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
356
400
  metadata[:"x-goog-request-params"] ||= request_params_header
357
401
 
@@ -420,6 +464,27 @@ module Google
420
464
  #
421
465
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
422
466
  #
467
+ # @example Basic example
468
+ # require "google/cloud/build/v1"
469
+ #
470
+ # # Create a client object. The client can be reused for multiple calls.
471
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
472
+ #
473
+ # # Create a request. To set request fields, pass in keyword arguments.
474
+ # request = Google::Cloud::Build::V1::ListBuildsRequest.new
475
+ #
476
+ # # Call the list_builds method.
477
+ # result = client.list_builds request
478
+ #
479
+ # # The returned object is of type Gapic::PagedEnumerable. You can
480
+ # # iterate over all elements by calling #each, and the enumerable
481
+ # # will lazily make API calls to fetch subsequent pages. Other
482
+ # # methods are also available for managing paging directly.
483
+ # result.each do |response|
484
+ # # Each element is of type ::Google::Cloud::Build::V1::Build.
485
+ # p response
486
+ # end
487
+ #
423
488
  def list_builds request, options = nil
424
489
  raise ::ArgumentError, "request must be provided" if request.nil?
425
490
 
@@ -437,9 +502,11 @@ module Google
437
502
  gapic_version: ::Google::Cloud::Build::V1::VERSION
438
503
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
504
 
440
- header_params = {
441
- "project_id" => request.project_id
442
- }
505
+ header_params = {}
506
+ if request.project_id
507
+ header_params["project_id"] = request.project_id
508
+ end
509
+
443
510
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
444
511
  metadata[:"x-goog-request-params"] ||= request_params_header
445
512
 
@@ -494,6 +561,21 @@ module Google
494
561
  #
495
562
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
496
563
  #
564
+ # @example Basic example
565
+ # require "google/cloud/build/v1"
566
+ #
567
+ # # Create a client object. The client can be reused for multiple calls.
568
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
569
+ #
570
+ # # Create a request. To set request fields, pass in keyword arguments.
571
+ # request = Google::Cloud::Build::V1::CancelBuildRequest.new
572
+ #
573
+ # # Call the cancel_build method.
574
+ # result = client.cancel_build request
575
+ #
576
+ # # The returned object is of type Google::Cloud::Build::V1::Build.
577
+ # p result
578
+ #
497
579
  def cancel_build request, options = nil
498
580
  raise ::ArgumentError, "request must be provided" if request.nil?
499
581
 
@@ -511,10 +593,14 @@ module Google
511
593
  gapic_version: ::Google::Cloud::Build::V1::VERSION
512
594
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
513
595
 
514
- header_params = {
515
- "project_id" => request.project_id,
516
- "id" => request.id
517
- }
596
+ header_params = {}
597
+ if request.project_id
598
+ header_params["project_id"] = request.project_id
599
+ end
600
+ if request.id
601
+ header_params["id"] = request.id
602
+ end
603
+
518
604
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
519
605
  metadata[:"x-goog-request-params"] ||= request_params_header
520
606
 
@@ -594,6 +680,28 @@ module Google
594
680
  #
595
681
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
596
682
  #
683
+ # @example Basic example
684
+ # require "google/cloud/build/v1"
685
+ #
686
+ # # Create a client object. The client can be reused for multiple calls.
687
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
688
+ #
689
+ # # Create a request. To set request fields, pass in keyword arguments.
690
+ # request = Google::Cloud::Build::V1::RetryBuildRequest.new
691
+ #
692
+ # # Call the retry_build method.
693
+ # result = client.retry_build request
694
+ #
695
+ # # The returned object is of type Gapic::Operation. You can use this
696
+ # # object to check the status of an operation, cancel it, or wait
697
+ # # for results. Here is how to block until completion:
698
+ # result.wait_until_done! timeout: 60
699
+ # if result.response?
700
+ # p result.response
701
+ # else
702
+ # puts "Error!"
703
+ # end
704
+ #
597
705
  def retry_build request, options = nil
598
706
  raise ::ArgumentError, "request must be provided" if request.nil?
599
707
 
@@ -611,10 +719,14 @@ module Google
611
719
  gapic_version: ::Google::Cloud::Build::V1::VERSION
612
720
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
613
721
 
614
- header_params = {
615
- "project_id" => request.project_id,
616
- "id" => request.id
617
- }
722
+ header_params = {}
723
+ if request.project_id
724
+ header_params["project_id"] = request.project_id
725
+ end
726
+ if request.id
727
+ header_params["id"] = request.id
728
+ end
729
+
618
730
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
619
731
  metadata[:"x-goog-request-params"] ||= request_params_header
620
732
 
@@ -672,6 +784,28 @@ module Google
672
784
  #
673
785
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
674
786
  #
787
+ # @example Basic example
788
+ # require "google/cloud/build/v1"
789
+ #
790
+ # # Create a client object. The client can be reused for multiple calls.
791
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
792
+ #
793
+ # # Create a request. To set request fields, pass in keyword arguments.
794
+ # request = Google::Cloud::Build::V1::ApproveBuildRequest.new
795
+ #
796
+ # # Call the approve_build method.
797
+ # result = client.approve_build request
798
+ #
799
+ # # The returned object is of type Gapic::Operation. You can use this
800
+ # # object to check the status of an operation, cancel it, or wait
801
+ # # for results. Here is how to block until completion:
802
+ # result.wait_until_done! timeout: 60
803
+ # if result.response?
804
+ # p result.response
805
+ # else
806
+ # puts "Error!"
807
+ # end
808
+ #
675
809
  def approve_build request, options = nil
676
810
  raise ::ArgumentError, "request must be provided" if request.nil?
677
811
 
@@ -689,9 +823,11 @@ module Google
689
823
  gapic_version: ::Google::Cloud::Build::V1::VERSION
690
824
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
825
 
692
- header_params = {
693
- "name" => request.name
694
- }
826
+ header_params = {}
827
+ if request.name
828
+ header_params["name"] = request.name
829
+ end
830
+
695
831
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
696
832
  metadata[:"x-goog-request-params"] ||= request_params_header
697
833
 
@@ -748,6 +884,21 @@ module Google
748
884
  #
749
885
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
750
886
  #
887
+ # @example Basic example
888
+ # require "google/cloud/build/v1"
889
+ #
890
+ # # Create a client object. The client can be reused for multiple calls.
891
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
892
+ #
893
+ # # Create a request. To set request fields, pass in keyword arguments.
894
+ # request = Google::Cloud::Build::V1::CreateBuildTriggerRequest.new
895
+ #
896
+ # # Call the create_build_trigger method.
897
+ # result = client.create_build_trigger request
898
+ #
899
+ # # The returned object is of type Google::Cloud::Build::V1::BuildTrigger.
900
+ # p result
901
+ #
751
902
  def create_build_trigger request, options = nil
752
903
  raise ::ArgumentError, "request must be provided" if request.nil?
753
904
 
@@ -765,9 +916,11 @@ module Google
765
916
  gapic_version: ::Google::Cloud::Build::V1::VERSION
766
917
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
767
918
 
768
- header_params = {
769
- "project_id" => request.project_id
770
- }
919
+ header_params = {}
920
+ if request.project_id
921
+ header_params["project_id"] = request.project_id
922
+ end
923
+
771
924
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
772
925
  metadata[:"x-goog-request-params"] ||= request_params_header
773
926
 
@@ -823,6 +976,21 @@ module Google
823
976
  #
824
977
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
825
978
  #
979
+ # @example Basic example
980
+ # require "google/cloud/build/v1"
981
+ #
982
+ # # Create a client object. The client can be reused for multiple calls.
983
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
984
+ #
985
+ # # Create a request. To set request fields, pass in keyword arguments.
986
+ # request = Google::Cloud::Build::V1::GetBuildTriggerRequest.new
987
+ #
988
+ # # Call the get_build_trigger method.
989
+ # result = client.get_build_trigger request
990
+ #
991
+ # # The returned object is of type Google::Cloud::Build::V1::BuildTrigger.
992
+ # p result
993
+ #
826
994
  def get_build_trigger request, options = nil
827
995
  raise ::ArgumentError, "request must be provided" if request.nil?
828
996
 
@@ -840,10 +1008,14 @@ module Google
840
1008
  gapic_version: ::Google::Cloud::Build::V1::VERSION
841
1009
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
842
1010
 
843
- header_params = {
844
- "project_id" => request.project_id,
845
- "trigger_id" => request.trigger_id
846
- }
1011
+ header_params = {}
1012
+ if request.project_id
1013
+ header_params["project_id"] = request.project_id
1014
+ end
1015
+ if request.trigger_id
1016
+ header_params["trigger_id"] = request.trigger_id
1017
+ end
1018
+
847
1019
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
848
1020
  metadata[:"x-goog-request-params"] ||= request_params_header
849
1021
 
@@ -901,6 +1073,27 @@ module Google
901
1073
  #
902
1074
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
903
1075
  #
1076
+ # @example Basic example
1077
+ # require "google/cloud/build/v1"
1078
+ #
1079
+ # # Create a client object. The client can be reused for multiple calls.
1080
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1081
+ #
1082
+ # # Create a request. To set request fields, pass in keyword arguments.
1083
+ # request = Google::Cloud::Build::V1::ListBuildTriggersRequest.new
1084
+ #
1085
+ # # Call the list_build_triggers method.
1086
+ # result = client.list_build_triggers request
1087
+ #
1088
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1089
+ # # iterate over all elements by calling #each, and the enumerable
1090
+ # # will lazily make API calls to fetch subsequent pages. Other
1091
+ # # methods are also available for managing paging directly.
1092
+ # result.each do |response|
1093
+ # # Each element is of type ::Google::Cloud::Build::V1::BuildTrigger.
1094
+ # p response
1095
+ # end
1096
+ #
904
1097
  def list_build_triggers request, options = nil
905
1098
  raise ::ArgumentError, "request must be provided" if request.nil?
906
1099
 
@@ -918,9 +1111,11 @@ module Google
918
1111
  gapic_version: ::Google::Cloud::Build::V1::VERSION
919
1112
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
920
1113
 
921
- header_params = {
922
- "project_id" => request.project_id
923
- }
1114
+ header_params = {}
1115
+ if request.project_id
1116
+ header_params["project_id"] = request.project_id
1117
+ end
1118
+
924
1119
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
925
1120
  metadata[:"x-goog-request-params"] ||= request_params_header
926
1121
 
@@ -977,6 +1172,21 @@ module Google
977
1172
  #
978
1173
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
979
1174
  #
1175
+ # @example Basic example
1176
+ # require "google/cloud/build/v1"
1177
+ #
1178
+ # # Create a client object. The client can be reused for multiple calls.
1179
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1180
+ #
1181
+ # # Create a request. To set request fields, pass in keyword arguments.
1182
+ # request = Google::Cloud::Build::V1::DeleteBuildTriggerRequest.new
1183
+ #
1184
+ # # Call the delete_build_trigger method.
1185
+ # result = client.delete_build_trigger request
1186
+ #
1187
+ # # The returned object is of type Google::Protobuf::Empty.
1188
+ # p result
1189
+ #
980
1190
  def delete_build_trigger request, options = nil
981
1191
  raise ::ArgumentError, "request must be provided" if request.nil?
982
1192
 
@@ -994,10 +1204,14 @@ module Google
994
1204
  gapic_version: ::Google::Cloud::Build::V1::VERSION
995
1205
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
996
1206
 
997
- header_params = {
998
- "project_id" => request.project_id,
999
- "trigger_id" => request.trigger_id
1000
- }
1207
+ header_params = {}
1208
+ if request.project_id
1209
+ header_params["project_id"] = request.project_id
1210
+ end
1211
+ if request.trigger_id
1212
+ header_params["trigger_id"] = request.trigger_id
1213
+ end
1214
+
1001
1215
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1002
1216
  metadata[:"x-goog-request-params"] ||= request_params_header
1003
1217
 
@@ -1052,6 +1266,21 @@ module Google
1052
1266
  #
1053
1267
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1054
1268
  #
1269
+ # @example Basic example
1270
+ # require "google/cloud/build/v1"
1271
+ #
1272
+ # # Create a client object. The client can be reused for multiple calls.
1273
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1274
+ #
1275
+ # # Create a request. To set request fields, pass in keyword arguments.
1276
+ # request = Google::Cloud::Build::V1::UpdateBuildTriggerRequest.new
1277
+ #
1278
+ # # Call the update_build_trigger method.
1279
+ # result = client.update_build_trigger request
1280
+ #
1281
+ # # The returned object is of type Google::Cloud::Build::V1::BuildTrigger.
1282
+ # p result
1283
+ #
1055
1284
  def update_build_trigger request, options = nil
1056
1285
  raise ::ArgumentError, "request must be provided" if request.nil?
1057
1286
 
@@ -1069,10 +1298,14 @@ module Google
1069
1298
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1070
1299
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1071
1300
 
1072
- header_params = {
1073
- "project_id" => request.project_id,
1074
- "trigger_id" => request.trigger_id
1075
- }
1301
+ header_params = {}
1302
+ if request.project_id
1303
+ header_params["project_id"] = request.project_id
1304
+ end
1305
+ if request.trigger_id
1306
+ header_params["trigger_id"] = request.trigger_id
1307
+ end
1308
+
1076
1309
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1077
1310
  metadata[:"x-goog-request-params"] ||= request_params_header
1078
1311
 
@@ -1128,6 +1361,28 @@ module Google
1128
1361
  #
1129
1362
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1130
1363
  #
1364
+ # @example Basic example
1365
+ # require "google/cloud/build/v1"
1366
+ #
1367
+ # # Create a client object. The client can be reused for multiple calls.
1368
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1369
+ #
1370
+ # # Create a request. To set request fields, pass in keyword arguments.
1371
+ # request = Google::Cloud::Build::V1::RunBuildTriggerRequest.new
1372
+ #
1373
+ # # Call the run_build_trigger method.
1374
+ # result = client.run_build_trigger request
1375
+ #
1376
+ # # The returned object is of type Gapic::Operation. You can use this
1377
+ # # object to check the status of an operation, cancel it, or wait
1378
+ # # for results. Here is how to block until completion:
1379
+ # result.wait_until_done! timeout: 60
1380
+ # if result.response?
1381
+ # p result.response
1382
+ # else
1383
+ # puts "Error!"
1384
+ # end
1385
+ #
1131
1386
  def run_build_trigger request, options = nil
1132
1387
  raise ::ArgumentError, "request must be provided" if request.nil?
1133
1388
 
@@ -1145,10 +1400,14 @@ module Google
1145
1400
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1146
1401
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1147
1402
 
1148
- header_params = {
1149
- "project_id" => request.project_id,
1150
- "trigger_id" => request.trigger_id
1151
- }
1403
+ header_params = {}
1404
+ if request.project_id
1405
+ header_params["project_id"] = request.project_id
1406
+ end
1407
+ if request.trigger_id
1408
+ header_params["trigger_id"] = request.trigger_id
1409
+ end
1410
+
1152
1411
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1153
1412
  metadata[:"x-goog-request-params"] ||= request_params_header
1154
1413
 
@@ -1208,6 +1467,21 @@ module Google
1208
1467
  #
1209
1468
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1210
1469
  #
1470
+ # @example Basic example
1471
+ # require "google/cloud/build/v1"
1472
+ #
1473
+ # # Create a client object. The client can be reused for multiple calls.
1474
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1475
+ #
1476
+ # # Create a request. To set request fields, pass in keyword arguments.
1477
+ # request = Google::Cloud::Build::V1::ReceiveTriggerWebhookRequest.new
1478
+ #
1479
+ # # Call the receive_trigger_webhook method.
1480
+ # result = client.receive_trigger_webhook request
1481
+ #
1482
+ # # The returned object is of type Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse.
1483
+ # p result
1484
+ #
1211
1485
  def receive_trigger_webhook request, options = nil
1212
1486
  raise ::ArgumentError, "request must be provided" if request.nil?
1213
1487
 
@@ -1225,10 +1499,14 @@ module Google
1225
1499
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1226
1500
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1227
1501
 
1228
- header_params = {
1229
- "project_id" => request.project_id,
1230
- "trigger" => request.trigger
1231
- }
1502
+ header_params = {}
1503
+ if request.project_id
1504
+ header_params["project_id"] = request.project_id
1505
+ end
1506
+ if request.trigger
1507
+ header_params["trigger"] = request.trigger
1508
+ end
1509
+
1232
1510
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1233
1511
  metadata[:"x-goog-request-params"] ||= request_params_header
1234
1512
 
@@ -1289,6 +1567,28 @@ module Google
1289
1567
  #
1290
1568
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1291
1569
  #
1570
+ # @example Basic example
1571
+ # require "google/cloud/build/v1"
1572
+ #
1573
+ # # Create a client object. The client can be reused for multiple calls.
1574
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1575
+ #
1576
+ # # Create a request. To set request fields, pass in keyword arguments.
1577
+ # request = Google::Cloud::Build::V1::CreateWorkerPoolRequest.new
1578
+ #
1579
+ # # Call the create_worker_pool method.
1580
+ # result = client.create_worker_pool request
1581
+ #
1582
+ # # The returned object is of type Gapic::Operation. You can use this
1583
+ # # object to check the status of an operation, cancel it, or wait
1584
+ # # for results. Here is how to block until completion:
1585
+ # result.wait_until_done! timeout: 60
1586
+ # if result.response?
1587
+ # p result.response
1588
+ # else
1589
+ # puts "Error!"
1590
+ # end
1591
+ #
1292
1592
  def create_worker_pool request, options = nil
1293
1593
  raise ::ArgumentError, "request must be provided" if request.nil?
1294
1594
 
@@ -1306,9 +1606,11 @@ module Google
1306
1606
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1307
1607
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1308
1608
 
1309
- header_params = {
1310
- "parent" => request.parent
1311
- }
1609
+ header_params = {}
1610
+ if request.parent
1611
+ header_params["parent"] = request.parent
1612
+ end
1613
+
1312
1614
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1313
1615
  metadata[:"x-goog-request-params"] ||= request_params_header
1314
1616
 
@@ -1359,6 +1661,21 @@ module Google
1359
1661
  #
1360
1662
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1361
1663
  #
1664
+ # @example Basic example
1665
+ # require "google/cloud/build/v1"
1666
+ #
1667
+ # # Create a client object. The client can be reused for multiple calls.
1668
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1669
+ #
1670
+ # # Create a request. To set request fields, pass in keyword arguments.
1671
+ # request = Google::Cloud::Build::V1::GetWorkerPoolRequest.new
1672
+ #
1673
+ # # Call the get_worker_pool method.
1674
+ # result = client.get_worker_pool request
1675
+ #
1676
+ # # The returned object is of type Google::Cloud::Build::V1::WorkerPool.
1677
+ # p result
1678
+ #
1362
1679
  def get_worker_pool request, options = nil
1363
1680
  raise ::ArgumentError, "request must be provided" if request.nil?
1364
1681
 
@@ -1376,9 +1693,11 @@ module Google
1376
1693
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1377
1694
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1378
1695
 
1379
- header_params = {
1380
- "name" => request.name
1381
- }
1696
+ header_params = {}
1697
+ if request.name
1698
+ header_params["name"] = request.name
1699
+ end
1700
+
1382
1701
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1383
1702
  metadata[:"x-goog-request-params"] ||= request_params_header
1384
1703
 
@@ -1438,6 +1757,28 @@ module Google
1438
1757
  #
1439
1758
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1440
1759
  #
1760
+ # @example Basic example
1761
+ # require "google/cloud/build/v1"
1762
+ #
1763
+ # # Create a client object. The client can be reused for multiple calls.
1764
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1765
+ #
1766
+ # # Create a request. To set request fields, pass in keyword arguments.
1767
+ # request = Google::Cloud::Build::V1::DeleteWorkerPoolRequest.new
1768
+ #
1769
+ # # Call the delete_worker_pool method.
1770
+ # result = client.delete_worker_pool request
1771
+ #
1772
+ # # The returned object is of type Gapic::Operation. You can use this
1773
+ # # object to check the status of an operation, cancel it, or wait
1774
+ # # for results. Here is how to block until completion:
1775
+ # result.wait_until_done! timeout: 60
1776
+ # if result.response?
1777
+ # p result.response
1778
+ # else
1779
+ # puts "Error!"
1780
+ # end
1781
+ #
1441
1782
  def delete_worker_pool request, options = nil
1442
1783
  raise ::ArgumentError, "request must be provided" if request.nil?
1443
1784
 
@@ -1455,9 +1796,11 @@ module Google
1455
1796
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1456
1797
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1457
1798
 
1458
- header_params = {
1459
- "name" => request.name
1460
- }
1799
+ header_params = {}
1800
+ if request.name
1801
+ header_params["name"] = request.name
1802
+ end
1803
+
1461
1804
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1462
1805
  metadata[:"x-goog-request-params"] ||= request_params_header
1463
1806
 
@@ -1515,6 +1858,28 @@ module Google
1515
1858
  #
1516
1859
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1517
1860
  #
1861
+ # @example Basic example
1862
+ # require "google/cloud/build/v1"
1863
+ #
1864
+ # # Create a client object. The client can be reused for multiple calls.
1865
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1866
+ #
1867
+ # # Create a request. To set request fields, pass in keyword arguments.
1868
+ # request = Google::Cloud::Build::V1::UpdateWorkerPoolRequest.new
1869
+ #
1870
+ # # Call the update_worker_pool method.
1871
+ # result = client.update_worker_pool request
1872
+ #
1873
+ # # The returned object is of type Gapic::Operation. You can use this
1874
+ # # object to check the status of an operation, cancel it, or wait
1875
+ # # for results. Here is how to block until completion:
1876
+ # result.wait_until_done! timeout: 60
1877
+ # if result.response?
1878
+ # p result.response
1879
+ # else
1880
+ # puts "Error!"
1881
+ # end
1882
+ #
1518
1883
  def update_worker_pool request, options = nil
1519
1884
  raise ::ArgumentError, "request must be provided" if request.nil?
1520
1885
 
@@ -1532,9 +1897,11 @@ module Google
1532
1897
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1533
1898
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1534
1899
 
1535
- header_params = {
1536
- "worker_pool.name" => request.worker_pool.name
1537
- }
1900
+ header_params = {}
1901
+ if request.worker_pool&.name
1902
+ header_params["worker_pool.name"] = request.worker_pool.name
1903
+ end
1904
+
1538
1905
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1539
1906
  metadata[:"x-goog-request-params"] ||= request_params_header
1540
1907
 
@@ -1591,6 +1958,27 @@ module Google
1591
1958
  #
1592
1959
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1593
1960
  #
1961
+ # @example Basic example
1962
+ # require "google/cloud/build/v1"
1963
+ #
1964
+ # # Create a client object. The client can be reused for multiple calls.
1965
+ # client = Google::Cloud::Build::V1::CloudBuild::Client.new
1966
+ #
1967
+ # # Create a request. To set request fields, pass in keyword arguments.
1968
+ # request = Google::Cloud::Build::V1::ListWorkerPoolsRequest.new
1969
+ #
1970
+ # # Call the list_worker_pools method.
1971
+ # result = client.list_worker_pools request
1972
+ #
1973
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1974
+ # # iterate over all elements by calling #each, and the enumerable
1975
+ # # will lazily make API calls to fetch subsequent pages. Other
1976
+ # # methods are also available for managing paging directly.
1977
+ # result.each do |response|
1978
+ # # Each element is of type ::Google::Cloud::Build::V1::WorkerPool.
1979
+ # p response
1980
+ # end
1981
+ #
1594
1982
  def list_worker_pools request, options = nil
1595
1983
  raise ::ArgumentError, "request must be provided" if request.nil?
1596
1984
 
@@ -1608,9 +1996,11 @@ module Google
1608
1996
  gapic_version: ::Google::Cloud::Build::V1::VERSION
1609
1997
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1610
1998
 
1611
- header_params = {
1612
- "parent" => request.parent
1613
- }
1999
+ header_params = {}
2000
+ if request.parent
2001
+ header_params["parent"] = request.parent
2002
+ end
2003
+
1614
2004
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1615
2005
  metadata[:"x-goog-request-params"] ||= request_params_header
1616
2006