google-cloud-build-v1 0.9.0 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 250b682a118dc351f44f5d77ee7b28ee7408d705a2eea2c655f2329d6a35ef41
4
- data.tar.gz: 0a59fde0694287e54abaccd1355a73ebaae409a78e3d4e7fd93573627eaf0cea
3
+ metadata.gz: fd40b4de3a3e9c119234c2ef6410466a2dee0c04010a10c4cb6ed3453fc71990
4
+ data.tar.gz: 47dbaa0397f1d3daa1dfe6b58431d7ff58e36f87d0e6ac36e00656120e19093f
5
5
  SHA512:
6
- metadata.gz: 49970a22f3b61969d431b1844a0a66c0f8632b2c46a299c88673197a508ed285af7299e7eb2f43232102a5cecb609495deafae54ff7224be95eb004078822f1e
7
- data.tar.gz: 64d460cdf291c78aeb9e04cfee9cc3518efceb175b1b9298e174c0985da9d2d0656a8d9c1441cc84e75f150d987c34ba7040457a11a9f1f3c90b34b3d4b4927e
6
+ metadata.gz: dfa7705a8d5aa23c7822e700dd96b2f1ffc27667f3d3146bd6adf05e370df8a99f0c50dde168da8d4e35c4cc07e971d3aea8f0ad21d847723dcbb2707fa34246
7
+ data.tar.gz: b7d62494256852bebf51e434042fed0d5763355e05548097f29b8c1e7d2bbefbb04d6087012b7d272b1aa18d202a2dd6baebaaa4aab7b5786e007da471107abc
@@ -48,13 +48,12 @@ module Google
48
48
  # See {::Google::Cloud::Build::V1::CloudBuild::Client::Configuration}
49
49
  # for a description of the configuration fields.
50
50
  #
51
- # ## Example
51
+ # @example
52
52
  #
53
- # To modify the configuration for all CloudBuild clients:
54
- #
55
- # ::Google::Cloud::Build::V1::CloudBuild::Client.configure do |config|
56
- # config.timeout = 10.0
57
- # end
53
+ # # Modify the configuration for all CloudBuild clients
54
+ # ::Google::Cloud::Build::V1::CloudBuild::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
58
57
  #
59
58
  # @yield [config] Configure the Client client.
60
59
  # @yieldparam config [Client::Configuration]
@@ -154,19 +153,15 @@ module Google
154
153
  ##
155
154
  # Create a new CloudBuild client object.
156
155
  #
157
- # ## Examples
158
- #
159
- # To create a new CloudBuild client with the default
160
- # configuration:
161
- #
162
- # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new
156
+ # @example
163
157
  #
164
- # To create a new CloudBuild client with a custom
165
- # configuration:
158
+ # # Create a client using the default configuration
159
+ # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new
166
160
  #
167
- # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config|
168
- # config.timeout = 10.0
169
- # end
161
+ # # Create a client using a custom configuration
162
+ # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config|
163
+ # config.timeout = 10.0
164
+ # end
170
165
  #
171
166
  # @yield [config] Configure the CloudBuild client.
172
167
  # @yieldparam config [Client::Configuration]
@@ -186,10 +181,9 @@ module Google
186
181
 
187
182
  # Create credentials
188
183
  credentials = @config.credentials
189
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
184
+ # Use self-signed JWT if the endpoint is unchanged from default,
190
185
  # but only if the default endpoint does not have a region prefix.
191
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
192
- @config.endpoint == Client.configure.endpoint &&
186
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
193
187
  !@config.endpoint.split(".").first.include?("-")
194
188
  credentials ||= Credentials.default scope: @config.scope,
195
189
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -286,7 +280,9 @@ module Google
286
280
  options.apply_defaults timeout: @config.rpcs.create_build.timeout,
287
281
  metadata: metadata,
288
282
  retry_policy: @config.rpcs.create_build.retry_policy
289
- options.apply_defaults metadata: @config.metadata,
283
+
284
+ options.apply_defaults timeout: @config.timeout,
285
+ metadata: @config.metadata,
290
286
  retry_policy: @config.retry_policy
291
287
 
292
288
  @cloud_build_stub.call_rpc :create_build, request, options: options do |response, operation|
@@ -362,7 +358,9 @@ module Google
362
358
  options.apply_defaults timeout: @config.rpcs.get_build.timeout,
363
359
  metadata: metadata,
364
360
  retry_policy: @config.rpcs.get_build.retry_policy
365
- options.apply_defaults metadata: @config.metadata,
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
366
364
  retry_policy: @config.retry_policy
367
365
 
368
366
  @cloud_build_stub.call_rpc :get_build, request, options: options do |response, operation|
@@ -448,7 +446,9 @@ module Google
448
446
  options.apply_defaults timeout: @config.rpcs.list_builds.timeout,
449
447
  metadata: metadata,
450
448
  retry_policy: @config.rpcs.list_builds.retry_policy
451
- options.apply_defaults metadata: @config.metadata,
449
+
450
+ options.apply_defaults timeout: @config.timeout,
451
+ metadata: @config.metadata,
452
452
  retry_policy: @config.retry_policy
453
453
 
454
454
  @cloud_build_stub.call_rpc :list_builds, request, options: options do |response, operation|
@@ -521,7 +521,9 @@ module Google
521
521
  options.apply_defaults timeout: @config.rpcs.cancel_build.timeout,
522
522
  metadata: metadata,
523
523
  retry_policy: @config.rpcs.cancel_build.retry_policy
524
- options.apply_defaults metadata: @config.metadata,
524
+
525
+ options.apply_defaults timeout: @config.timeout,
526
+ metadata: @config.metadata,
525
527
  retry_policy: @config.retry_policy
526
528
 
527
529
  @cloud_build_stub.call_rpc :cancel_build, request, options: options do |response, operation|
@@ -619,7 +621,9 @@ module Google
619
621
  options.apply_defaults timeout: @config.rpcs.retry_build.timeout,
620
622
  metadata: metadata,
621
623
  retry_policy: @config.rpcs.retry_build.retry_policy
622
- options.apply_defaults metadata: @config.metadata,
624
+
625
+ options.apply_defaults timeout: @config.timeout,
626
+ metadata: @config.metadata,
623
627
  retry_policy: @config.retry_policy
624
628
 
625
629
  @cloud_build_stub.call_rpc :retry_build, request, options: options do |response, operation|
@@ -631,6 +635,83 @@ module Google
631
635
  raise ::Google::Cloud::Error.from_error(e)
632
636
  end
633
637
 
638
+ ##
639
+ # Approves or rejects a pending build.
640
+ #
641
+ # If approved, the returned LRO will be analogous to the LRO returned from
642
+ # a CreateBuild call.
643
+ #
644
+ # If rejected, the returned LRO will be immediately done.
645
+ #
646
+ # @overload approve_build(request, options = nil)
647
+ # Pass arguments to `approve_build` via a request object, either of type
648
+ # {::Google::Cloud::Build::V1::ApproveBuildRequest} or an equivalent Hash.
649
+ #
650
+ # @param request [::Google::Cloud::Build::V1::ApproveBuildRequest, ::Hash]
651
+ # A request object representing the call parameters. Required. To specify no
652
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
653
+ # @param options [::Gapic::CallOptions, ::Hash]
654
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
655
+ #
656
+ # @overload approve_build(name: nil, approval_result: nil)
657
+ # Pass arguments to `approve_build` via keyword arguments. Note that at
658
+ # least one keyword argument is required. To specify no parameters, or to keep all
659
+ # the default parameter values, pass an empty Hash as a request object (see above).
660
+ #
661
+ # @param name [::String]
662
+ # Required. Name of the target build.
663
+ # For example: "projects/\\{$project_id}/builds/\\{$build_id}"
664
+ # @param approval_result [::Google::Cloud::Build::V1::ApprovalResult, ::Hash]
665
+ # Approval decision and metadata.
666
+ #
667
+ # @yield [response, operation] Access the result along with the RPC operation
668
+ # @yieldparam response [::Gapic::Operation]
669
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
670
+ #
671
+ # @return [::Gapic::Operation]
672
+ #
673
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
674
+ #
675
+ def approve_build request, options = nil
676
+ raise ::ArgumentError, "request must be provided" if request.nil?
677
+
678
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Build::V1::ApproveBuildRequest
679
+
680
+ # Converts hash and nil to an options object
681
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
682
+
683
+ # Customize the options with defaults
684
+ metadata = @config.rpcs.approve_build.metadata.to_h
685
+
686
+ # Set x-goog-api-client and x-goog-user-project headers
687
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
688
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
689
+ gapic_version: ::Google::Cloud::Build::V1::VERSION
690
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ header_params = {
693
+ "name" => request.name
694
+ }
695
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
696
+ metadata[:"x-goog-request-params"] ||= request_params_header
697
+
698
+ options.apply_defaults timeout: @config.rpcs.approve_build.timeout,
699
+ metadata: metadata,
700
+ retry_policy: @config.rpcs.approve_build.retry_policy
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
704
+ retry_policy: @config.retry_policy
705
+
706
+ @cloud_build_stub.call_rpc :approve_build, request, options: options do |response, operation|
707
+ response = ::Gapic::Operation.new response, @operations_client, options: options
708
+ yield response, operation if block_given?
709
+ return response
710
+ end
711
+ rescue ::GRPC::BadStatus => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
634
715
  ##
635
716
  # Creates a new `BuildTrigger`.
636
717
  #
@@ -693,7 +774,9 @@ module Google
693
774
  options.apply_defaults timeout: @config.rpcs.create_build_trigger.timeout,
694
775
  metadata: metadata,
695
776
  retry_policy: @config.rpcs.create_build_trigger.retry_policy
696
- options.apply_defaults metadata: @config.metadata,
777
+
778
+ options.apply_defaults timeout: @config.timeout,
779
+ metadata: @config.metadata,
697
780
  retry_policy: @config.retry_policy
698
781
 
699
782
  @cloud_build_stub.call_rpc :create_build_trigger, request, options: options do |response, operation|
@@ -767,7 +850,9 @@ module Google
767
850
  options.apply_defaults timeout: @config.rpcs.get_build_trigger.timeout,
768
851
  metadata: metadata,
769
852
  retry_policy: @config.rpcs.get_build_trigger.retry_policy
770
- options.apply_defaults metadata: @config.metadata,
853
+
854
+ options.apply_defaults timeout: @config.timeout,
855
+ metadata: @config.metadata,
771
856
  retry_policy: @config.retry_policy
772
857
 
773
858
  @cloud_build_stub.call_rpc :get_build_trigger, request, options: options do |response, operation|
@@ -842,7 +927,9 @@ module Google
842
927
  options.apply_defaults timeout: @config.rpcs.list_build_triggers.timeout,
843
928
  metadata: metadata,
844
929
  retry_policy: @config.rpcs.list_build_triggers.retry_policy
845
- options.apply_defaults metadata: @config.metadata,
930
+
931
+ options.apply_defaults timeout: @config.timeout,
932
+ metadata: @config.metadata,
846
933
  retry_policy: @config.retry_policy
847
934
 
848
935
  @cloud_build_stub.call_rpc :list_build_triggers, request, options: options do |response, operation|
@@ -917,7 +1004,9 @@ module Google
917
1004
  options.apply_defaults timeout: @config.rpcs.delete_build_trigger.timeout,
918
1005
  metadata: metadata,
919
1006
  retry_policy: @config.rpcs.delete_build_trigger.retry_policy
920
- options.apply_defaults metadata: @config.metadata,
1007
+
1008
+ options.apply_defaults timeout: @config.timeout,
1009
+ metadata: @config.metadata,
921
1010
  retry_policy: @config.retry_policy
922
1011
 
923
1012
  @cloud_build_stub.call_rpc :delete_build_trigger, request, options: options do |response, operation|
@@ -990,7 +1079,9 @@ module Google
990
1079
  options.apply_defaults timeout: @config.rpcs.update_build_trigger.timeout,
991
1080
  metadata: metadata,
992
1081
  retry_policy: @config.rpcs.update_build_trigger.retry_policy
993
- options.apply_defaults metadata: @config.metadata,
1082
+
1083
+ options.apply_defaults timeout: @config.timeout,
1084
+ metadata: @config.metadata,
994
1085
  retry_policy: @config.retry_policy
995
1086
 
996
1087
  @cloud_build_stub.call_rpc :update_build_trigger, request, options: options do |response, operation|
@@ -1064,7 +1155,9 @@ module Google
1064
1155
  options.apply_defaults timeout: @config.rpcs.run_build_trigger.timeout,
1065
1156
  metadata: metadata,
1066
1157
  retry_policy: @config.rpcs.run_build_trigger.retry_policy
1067
- options.apply_defaults metadata: @config.metadata,
1158
+
1159
+ options.apply_defaults timeout: @config.timeout,
1160
+ metadata: @config.metadata,
1068
1161
  retry_policy: @config.retry_policy
1069
1162
 
1070
1163
  @cloud_build_stub.call_rpc :run_build_trigger, request, options: options do |response, operation|
@@ -1142,7 +1235,9 @@ module Google
1142
1235
  options.apply_defaults timeout: @config.rpcs.receive_trigger_webhook.timeout,
1143
1236
  metadata: metadata,
1144
1237
  retry_policy: @config.rpcs.receive_trigger_webhook.retry_policy
1145
- options.apply_defaults metadata: @config.metadata,
1238
+
1239
+ options.apply_defaults timeout: @config.timeout,
1240
+ metadata: @config.metadata,
1146
1241
  retry_policy: @config.retry_policy
1147
1242
 
1148
1243
  @cloud_build_stub.call_rpc :receive_trigger_webhook, request, options: options do |response, operation|
@@ -1220,7 +1315,9 @@ module Google
1220
1315
  options.apply_defaults timeout: @config.rpcs.create_worker_pool.timeout,
1221
1316
  metadata: metadata,
1222
1317
  retry_policy: @config.rpcs.create_worker_pool.retry_policy
1223
- options.apply_defaults metadata: @config.metadata,
1318
+
1319
+ options.apply_defaults timeout: @config.timeout,
1320
+ metadata: @config.metadata,
1224
1321
  retry_policy: @config.retry_policy
1225
1322
 
1226
1323
  @cloud_build_stub.call_rpc :create_worker_pool, request, options: options do |response, operation|
@@ -1288,7 +1385,9 @@ module Google
1288
1385
  options.apply_defaults timeout: @config.rpcs.get_worker_pool.timeout,
1289
1386
  metadata: metadata,
1290
1387
  retry_policy: @config.rpcs.get_worker_pool.retry_policy
1291
- options.apply_defaults metadata: @config.metadata,
1388
+
1389
+ options.apply_defaults timeout: @config.timeout,
1390
+ metadata: @config.metadata,
1292
1391
  retry_policy: @config.retry_policy
1293
1392
 
1294
1393
  @cloud_build_stub.call_rpc :get_worker_pool, request, options: options do |response, operation|
@@ -1365,7 +1464,9 @@ module Google
1365
1464
  options.apply_defaults timeout: @config.rpcs.delete_worker_pool.timeout,
1366
1465
  metadata: metadata,
1367
1466
  retry_policy: @config.rpcs.delete_worker_pool.retry_policy
1368
- options.apply_defaults metadata: @config.metadata,
1467
+
1468
+ options.apply_defaults timeout: @config.timeout,
1469
+ metadata: @config.metadata,
1369
1470
  retry_policy: @config.retry_policy
1370
1471
 
1371
1472
  @cloud_build_stub.call_rpc :delete_worker_pool, request, options: options do |response, operation|
@@ -1440,7 +1541,9 @@ module Google
1440
1541
  options.apply_defaults timeout: @config.rpcs.update_worker_pool.timeout,
1441
1542
  metadata: metadata,
1442
1543
  retry_policy: @config.rpcs.update_worker_pool.retry_policy
1443
- options.apply_defaults metadata: @config.metadata,
1544
+
1545
+ options.apply_defaults timeout: @config.timeout,
1546
+ metadata: @config.metadata,
1444
1547
  retry_policy: @config.retry_policy
1445
1548
 
1446
1549
  @cloud_build_stub.call_rpc :update_worker_pool, request, options: options do |response, operation|
@@ -1514,7 +1617,9 @@ module Google
1514
1617
  options.apply_defaults timeout: @config.rpcs.list_worker_pools.timeout,
1515
1618
  metadata: metadata,
1516
1619
  retry_policy: @config.rpcs.list_worker_pools.retry_policy
1517
- options.apply_defaults metadata: @config.metadata,
1620
+
1621
+ options.apply_defaults timeout: @config.timeout,
1622
+ metadata: @config.metadata,
1518
1623
  retry_policy: @config.retry_policy
1519
1624
 
1520
1625
  @cloud_build_stub.call_rpc :list_worker_pools, request, options: options do |response, operation|
@@ -1539,22 +1644,21 @@ module Google
1539
1644
  # Configuration can be applied globally to all clients, or to a single client
1540
1645
  # on construction.
1541
1646
  #
1542
- # # Examples
1647
+ # @example
1543
1648
  #
1544
- # To modify the global config, setting the timeout for create_build
1545
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1649
+ # # Modify the global config, setting the timeout for
1650
+ # # create_build to 20 seconds,
1651
+ # # and all remaining timeouts to 10 seconds.
1652
+ # ::Google::Cloud::Build::V1::CloudBuild::Client.configure do |config|
1653
+ # config.timeout = 10.0
1654
+ # config.rpcs.create_build.timeout = 20.0
1655
+ # end
1546
1656
  #
1547
- # ::Google::Cloud::Build::V1::CloudBuild::Client.configure do |config|
1548
- # config.timeout = 10.0
1549
- # config.rpcs.create_build.timeout = 20.0
1550
- # end
1551
- #
1552
- # To apply the above configuration only to a new client:
1553
- #
1554
- # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config|
1555
- # config.timeout = 10.0
1556
- # config.rpcs.create_build.timeout = 20.0
1557
- # end
1657
+ # # Apply the above configuration only to a new client.
1658
+ # client = ::Google::Cloud::Build::V1::CloudBuild::Client.new do |config|
1659
+ # config.timeout = 10.0
1660
+ # config.rpcs.create_build.timeout = 20.0
1661
+ # end
1558
1662
  #
1559
1663
  # @!attribute [rw] endpoint
1560
1664
  # The hostname or hostname:port of the service endpoint.
@@ -1688,6 +1792,11 @@ module Google
1688
1792
  #
1689
1793
  attr_reader :retry_build
1690
1794
  ##
1795
+ # RPC-specific configuration for `approve_build`
1796
+ # @return [::Gapic::Config::Method]
1797
+ #
1798
+ attr_reader :approve_build
1799
+ ##
1691
1800
  # RPC-specific configuration for `create_build_trigger`
1692
1801
  # @return [::Gapic::Config::Method]
1693
1802
  #
@@ -1760,6 +1869,8 @@ module Google
1760
1869
  @cancel_build = ::Gapic::Config::Method.new cancel_build_config
1761
1870
  retry_build_config = parent_rpcs.retry_build if parent_rpcs.respond_to? :retry_build
1762
1871
  @retry_build = ::Gapic::Config::Method.new retry_build_config
1872
+ approve_build_config = parent_rpcs.approve_build if parent_rpcs.respond_to? :approve_build
1873
+ @approve_build = ::Gapic::Config::Method.new approve_build_config
1763
1874
  create_build_trigger_config = parent_rpcs.create_build_trigger if parent_rpcs.respond_to? :create_build_trigger
1764
1875
  @create_build_trigger = ::Gapic::Config::Method.new create_build_trigger_config
1765
1876
  get_build_trigger_config = parent_rpcs.get_build_trigger if parent_rpcs.respond_to? :get_build_trigger
@@ -169,7 +169,9 @@ module Google
169
169
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
170
  metadata: metadata,
171
171
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
172
+
173
+ options.apply_defaults timeout: @config.timeout,
174
+ metadata: @config.metadata,
173
175
  retry_policy: @config.retry_policy
174
176
 
175
177
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -239,7 +241,9 @@ module Google
239
241
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
242
  metadata: metadata,
241
243
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
243
247
  retry_policy: @config.retry_policy
244
248
 
245
249
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -309,7 +313,9 @@ module Google
309
313
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
314
  metadata: metadata,
311
315
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
313
319
  retry_policy: @config.retry_policy
314
320
 
315
321
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -384,7 +390,9 @@ module Google
384
390
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
391
  metadata: metadata,
386
392
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
388
396
  retry_policy: @config.retry_policy
389
397
 
390
398
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -456,7 +464,9 @@ module Google
456
464
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
465
  metadata: metadata,
458
466
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
467
+
468
+ options.apply_defaults timeout: @config.timeout,
469
+ metadata: @config.metadata,
460
470
  retry_policy: @config.retry_policy
461
471
 
462
472
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +491,21 @@ module Google
481
491
  # Configuration can be applied globally to all clients, or to a single client
482
492
  # on construction.
483
493
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
494
+ # @example
495
+ #
496
+ # # Modify the global config, setting the timeout for
497
+ # # list_operations to 20 seconds,
498
+ # # and all remaining timeouts to 10 seconds.
499
+ # ::Google::Longrunning::Operations::Client.configure do |config|
500
+ # config.timeout = 10.0
501
+ # config.rpcs.list_operations.timeout = 20.0
502
+ # end
503
+ #
504
+ # # Apply the above configuration only to a new client.
505
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_operations.timeout = 20.0
508
+ # end
500
509
  #
501
510
  # @!attribute [rw] endpoint
502
511
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Build
23
23
  module V1
24
- VERSION = "0.9.0"
24
+ VERSION = "0.11.0"
25
25
  end
26
26
  end
27
27
  end
@@ -74,6 +74,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
74
74
  optional :pull_timing, :message, 13, "google.devtools.cloudbuild.v1.TimeSpan"
75
75
  optional :timeout, :message, 11, "google.protobuf.Duration"
76
76
  optional :status, :enum, 12, "google.devtools.cloudbuild.v1.Build.Status"
77
+ optional :script, :string, 19
77
78
  end
78
79
  add_message "google.devtools.cloudbuild.v1.Volume" do
79
80
  optional :name, :string, 1
@@ -116,6 +117,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
116
117
  repeated :tags, :string, 31
117
118
  repeated :secrets, :message, 32, "google.devtools.cloudbuild.v1.Secret"
118
119
  map :timing, :string, :message, 33, "google.devtools.cloudbuild.v1.TimeSpan"
120
+ optional :approval, :message, 44, "google.devtools.cloudbuild.v1.BuildApproval"
119
121
  optional :service_account, :string, 42
120
122
  optional :available_secrets, :message, 47, "google.devtools.cloudbuild.v1.Secrets"
121
123
  repeated :warnings, :message, 49, "google.devtools.cloudbuild.v1.Build.Warning"
@@ -146,6 +148,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
146
148
  end
147
149
  add_enum "google.devtools.cloudbuild.v1.Build.Status" do
148
150
  value :STATUS_UNKNOWN, 0
151
+ value :PENDING, 10
149
152
  value :QUEUED, 1
150
153
  value :WORKING, 2
151
154
  value :SUCCESS, 3
@@ -231,6 +234,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
231
234
  optional :project_id, :string, 1
232
235
  optional :id, :string, 2
233
236
  end
237
+ add_message "google.devtools.cloudbuild.v1.ApproveBuildRequest" do
238
+ optional :name, :string, 1
239
+ optional :approval_result, :message, 2, "google.devtools.cloudbuild.v1.ApprovalResult"
240
+ end
241
+ add_message "google.devtools.cloudbuild.v1.BuildApproval" do
242
+ optional :state, :enum, 1, "google.devtools.cloudbuild.v1.BuildApproval.State"
243
+ optional :config, :message, 2, "google.devtools.cloudbuild.v1.ApprovalConfig"
244
+ optional :result, :message, 3, "google.devtools.cloudbuild.v1.ApprovalResult"
245
+ end
246
+ add_enum "google.devtools.cloudbuild.v1.BuildApproval.State" do
247
+ value :STATE_UNSPECIFIED, 0
248
+ value :PENDING, 1
249
+ value :APPROVED, 2
250
+ value :REJECTED, 3
251
+ value :CANCELLED, 5
252
+ end
253
+ add_message "google.devtools.cloudbuild.v1.ApprovalConfig" do
254
+ optional :approval_required, :bool, 1
255
+ end
256
+ add_message "google.devtools.cloudbuild.v1.ApprovalResult" do
257
+ optional :approver_account, :string, 2
258
+ optional :approval_time, :message, 3, "google.protobuf.Timestamp"
259
+ optional :decision, :enum, 4, "google.devtools.cloudbuild.v1.ApprovalResult.Decision"
260
+ optional :comment, :string, 5
261
+ optional :url, :string, 6
262
+ end
263
+ add_enum "google.devtools.cloudbuild.v1.ApprovalResult.Decision" do
264
+ value :DECISION_UNSPECIFIED, 0
265
+ value :APPROVED, 1
266
+ value :REJECTED, 2
267
+ end
234
268
  add_message "google.devtools.cloudbuild.v1.BuildTrigger" do
235
269
  optional :resource_name, :string, 34
236
270
  optional :id, :string, 1
@@ -247,6 +281,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
247
281
  repeated :ignored_files, :string, 15
248
282
  repeated :included_files, :string, 16
249
283
  optional :filter, :string, 30
284
+ optional :service_account, :string, 33
250
285
  oneof :build_template do
251
286
  optional :autodetect, :bool, 18
252
287
  optional :build, :message, 4, "google.devtools.cloudbuild.v1.Build"
@@ -513,6 +548,12 @@ module Google
513
548
  ListBuildsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ListBuildsRequest").msgclass
514
549
  ListBuildsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ListBuildsResponse").msgclass
515
550
  CancelBuildRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.CancelBuildRequest").msgclass
551
+ ApproveBuildRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApproveBuildRequest").msgclass
552
+ BuildApproval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildApproval").msgclass
553
+ BuildApproval::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildApproval.State").enummodule
554
+ ApprovalConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalConfig").msgclass
555
+ ApprovalResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalResult").msgclass
556
+ ApprovalResult::Decision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.ApprovalResult.Decision").enummodule
516
557
  BuildTrigger = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildTrigger").msgclass
517
558
  GitHubEventsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.GitHubEventsConfig").msgclass
518
559
  PubsubConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.PubsubConfig").msgclass
@@ -86,6 +86,13 @@ module Google
86
86
  # object, which may or may not be available depending on the bucket's
87
87
  # lifecycle management settings.
88
88
  rpc :RetryBuild, ::Google::Cloud::Build::V1::RetryBuildRequest, ::Google::Longrunning::Operation
89
+ # Approves or rejects a pending build.
90
+ #
91
+ # If approved, the returned LRO will be analogous to the LRO returned from
92
+ # a CreateBuild call.
93
+ #
94
+ # If rejected, the returned LRO will be immediately done.
95
+ rpc :ApproveBuild, ::Google::Cloud::Build::V1::ApproveBuildRequest, ::Google::Longrunning::Operation
89
96
  # Creates a new `BuildTrigger`.
90
97
  #
91
98
  # This API is experimental.
@@ -277,6 +277,11 @@ module Google
277
277
  # Output only. Status of the build step. At this time, build step status is
278
278
  # only updated on build completion; step status is not updated in real-time
279
279
  # as the build progresses.
280
+ # @!attribute [rw] script
281
+ # @return [::String]
282
+ # A shell script to be executed in the step.
283
+ #
284
+ # When script is provided, the user cannot specify the entrypoint or args.
280
285
  class BuildStep
281
286
  include ::Google::Protobuf::MessageExts
282
287
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -471,12 +476,17 @@ module Google
471
476
  # Output only. Stores timing information for phases of the build. Valid keys
472
477
  # are:
473
478
  #
474
- # * BUILD: time to execute all build steps
479
+ # * BUILD: time to execute all build steps.
475
480
  # * PUSH: time to push all specified images.
476
481
  # * FETCHSOURCE: time to fetch source.
482
+ # * SETUPBUILD: time to set up build.
477
483
  #
478
484
  # If the build does not specify source or images,
479
485
  # these keys will not be included.
486
+ # @!attribute [r] approval
487
+ # @return [::Google::Cloud::Build::V1::BuildApproval]
488
+ # Output only. Describes this build's approval configuration, status,
489
+ # and result.
480
490
  # @!attribute [rw] service_account
481
491
  # @return [::String]
482
492
  # IAM service account whose credentials will be used at build runtime.
@@ -583,6 +593,10 @@ module Google
583
593
  # Status of the build is unknown.
584
594
  STATUS_UNKNOWN = 0
585
595
 
596
+ # Build has been created and is pending execution and queuing. It has not
597
+ # been queued.
598
+ PENDING = 10
599
+
586
600
  # Build or step is queued; work has not yet begun.
587
601
  QUEUED = 1
588
602
 
@@ -934,6 +948,103 @@ module Google
934
948
  extend ::Google::Protobuf::MessageExts::ClassMethods
935
949
  end
936
950
 
951
+ # Request to approve or reject a pending build.
952
+ # @!attribute [rw] name
953
+ # @return [::String]
954
+ # Required. Name of the target build.
955
+ # For example: "projects/\\{$project_id}/builds/\\{$build_id}"
956
+ # @!attribute [rw] approval_result
957
+ # @return [::Google::Cloud::Build::V1::ApprovalResult]
958
+ # Approval decision and metadata.
959
+ class ApproveBuildRequest
960
+ include ::Google::Protobuf::MessageExts
961
+ extend ::Google::Protobuf::MessageExts::ClassMethods
962
+ end
963
+
964
+ # BuildApproval describes a build's approval configuration, state, and
965
+ # result.
966
+ # @!attribute [r] state
967
+ # @return [::Google::Cloud::Build::V1::BuildApproval::State]
968
+ # Output only. The state of this build's approval.
969
+ # @!attribute [r] config
970
+ # @return [::Google::Cloud::Build::V1::ApprovalConfig]
971
+ # Output only. Configuration for manual approval of this build.
972
+ # @!attribute [r] result
973
+ # @return [::Google::Cloud::Build::V1::ApprovalResult]
974
+ # Output only. Result of manual approval for this Build.
975
+ class BuildApproval
976
+ include ::Google::Protobuf::MessageExts
977
+ extend ::Google::Protobuf::MessageExts::ClassMethods
978
+
979
+ # Specifies the current state of a build's approval.
980
+ module State
981
+ # Default enum type. This should not be used.
982
+ STATE_UNSPECIFIED = 0
983
+
984
+ # Build approval is pending.
985
+ PENDING = 1
986
+
987
+ # Build approval has been approved.
988
+ APPROVED = 2
989
+
990
+ # Build approval has been rejected.
991
+ REJECTED = 3
992
+
993
+ # Build was cancelled while it was still pending approval.
994
+ CANCELLED = 5
995
+ end
996
+ end
997
+
998
+ # ApprovalConfig describes configuration for manual approval of a build.
999
+ # @!attribute [rw] approval_required
1000
+ # @return [::Boolean]
1001
+ # Whether or not approval is needed. If this is set on a build, it will
1002
+ # become pending when created, and will need to be explicitly approved
1003
+ # to start.
1004
+ class ApprovalConfig
1005
+ include ::Google::Protobuf::MessageExts
1006
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1007
+ end
1008
+
1009
+ # ApprovalResult describes the decision and associated metadata of a manual
1010
+ # approval of a build.
1011
+ # @!attribute [r] approver_account
1012
+ # @return [::String]
1013
+ # Output only. Email of the user that called the ApproveBuild API to
1014
+ # approve or reject a build at the time that the API was called.
1015
+ # @!attribute [r] approval_time
1016
+ # @return [::Google::Protobuf::Timestamp]
1017
+ # Output only. The time when the approval decision was made.
1018
+ # @!attribute [rw] decision
1019
+ # @return [::Google::Cloud::Build::V1::ApprovalResult::Decision]
1020
+ # Required. The decision of this manual approval.
1021
+ # @!attribute [rw] comment
1022
+ # @return [::String]
1023
+ # Optional. An optional comment for this manual approval result.
1024
+ # @!attribute [rw] url
1025
+ # @return [::String]
1026
+ # Optional. An optional URL tied to this manual approval result. This field
1027
+ # is essentially the same as comment, except that it will be rendered by the
1028
+ # UI differently. An example use case is a link to an external job that
1029
+ # approved this Build.
1030
+ class ApprovalResult
1031
+ include ::Google::Protobuf::MessageExts
1032
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1033
+
1034
+ # Specifies whether or not this manual approval result is to approve
1035
+ # or reject a build.
1036
+ module Decision
1037
+ # Default enum type. This should not be used.
1038
+ DECISION_UNSPECIFIED = 0
1039
+
1040
+ # Build is approved.
1041
+ APPROVED = 1
1042
+
1043
+ # Build is rejected.
1044
+ REJECTED = 2
1045
+ end
1046
+ end
1047
+
937
1048
  # Configuration for an automated build in response to source repository
938
1049
  # changes.
939
1050
  # @!attribute [rw] resource_name
@@ -1033,6 +1144,13 @@ module Google
1033
1144
  # @!attribute [rw] filter
1034
1145
  # @return [::String]
1035
1146
  # Optional. A Common Expression Language string.
1147
+ # @!attribute [rw] service_account
1148
+ # @return [::String]
1149
+ # The service account used for all user-controlled operations including
1150
+ # UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild.
1151
+ # If no service account is set, then the standard Cloud Build service account
1152
+ # ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead.
1153
+ # Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}`
1036
1154
  class BuildTrigger
1037
1155
  include ::Google::Protobuf::MessageExts
1038
1156
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-build-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-21 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a