google-cloud-build-v1 0.19.0 → 0.21.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: ea9a6859457936f6b56971252fb53b0f5ddc2f6450429b3fc1ec3fbe3af1fa2d
4
- data.tar.gz: fa8194d01ef4b669c38ee63ddc34ec86829bead0dd992f97565b19a12954aafc
3
+ metadata.gz: 70a6588393194bcc795b8e5b1f386a21a6994f1040175ab7b3054d85f54df753
4
+ data.tar.gz: 1e2dabb6155abc01cf03a571b8aa6212301a6bc10de6aa1cc4bc50022e63c0f1
5
5
  SHA512:
6
- metadata.gz: 7a1a144d8f4c7667f130098fe9534cf974d8ecda46586bbc611bcbfe538c2228093e0af066428d53c351e8a167365cb440b3e3dcff6534f38ffff6812317cac8
7
- data.tar.gz: bd7166c77874ff5bee7a49493c469928f39a8e69204baf8d30e694535d112a545fd477766991365066f1a33708024a23823f7df1dfbe7b812a939f5ce13830c3
6
+ metadata.gz: 400174cab7050b4699a37151580636b4428241f64da09ceae6e4132dfe282b8356ce99dfdc5687242e0006164d973d6162b292e1bf2b32a2a2006e93421ce86d
7
+ data.tar.gz: c8698e44f7a904f583e68718effc8e1eeb1dc22cf880c44af65a12f47566fcd592d0429d1bfe3b0ced2d161bd3e423ad88dcfc9b805193603627d58f30b13467
@@ -295,11 +295,14 @@ module Google
295
295
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
296
 
297
297
  header_params = {}
298
- if request.project_id
299
- header_params["project_id"] = request.project_id
298
+ if request.parent
299
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
300
+ if regex_match
301
+ header_params["location"] = regex_match["location".to_s]
302
+ end
300
303
  end
301
304
 
302
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
305
+ request_params_header = URI.encode_www_form header_params
303
306
  metadata[:"x-goog-request-params"] ||= request_params_header
304
307
 
305
308
  options.apply_defaults timeout: @config.rpcs.create_build.timeout,
@@ -389,14 +392,14 @@ module Google
389
392
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
390
393
 
391
394
  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
395
+ if request.name
396
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/builds/[^/]+/?$}.match request.name
397
+ if regex_match
398
+ header_params["location"] = regex_match["location".to_s]
399
+ end
397
400
  end
398
401
 
399
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
402
+ request_params_header = URI.encode_www_form header_params
400
403
  metadata[:"x-goog-request-params"] ||= request_params_header
401
404
 
402
405
  options.apply_defaults timeout: @config.rpcs.get_build.timeout,
@@ -501,11 +504,14 @@ module Google
501
504
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
502
505
 
503
506
  header_params = {}
504
- if request.project_id
505
- header_params["project_id"] = request.project_id
507
+ if request.parent
508
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
509
+ if regex_match
510
+ header_params["location"] = regex_match["location".to_s]
511
+ end
506
512
  end
507
513
 
508
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
514
+ request_params_header = URI.encode_www_form header_params
509
515
  metadata[:"x-goog-request-params"] ||= request_params_header
510
516
 
511
517
  options.apply_defaults timeout: @config.rpcs.list_builds.timeout,
@@ -592,14 +598,14 @@ module Google
592
598
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
593
599
 
594
600
  header_params = {}
595
- if request.project_id
596
- header_params["project_id"] = request.project_id
597
- end
598
- if request.id
599
- header_params["id"] = request.id
601
+ if request.name
602
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/builds/[^/]+/?$}.match request.name
603
+ if regex_match
604
+ header_params["location"] = regex_match["location".to_s]
605
+ end
600
606
  end
601
607
 
602
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
608
+ request_params_header = URI.encode_www_form header_params
603
609
  metadata[:"x-goog-request-params"] ||= request_params_header
604
610
 
605
611
  options.apply_defaults timeout: @config.rpcs.cancel_build.timeout,
@@ -639,7 +645,7 @@ module Google
639
645
  #
640
646
  # For builds that specify `StorageSource`:
641
647
  #
642
- # * If the original build pulled source from Google Cloud Storage without
648
+ # * If the original build pulled source from Cloud Storage without
643
649
  # specifying the generation of the object, the new build will use the current
644
650
  # object, which may be different from the original build source.
645
651
  # * If the original build pulled source from Cloud Storage and specified the
@@ -718,14 +724,14 @@ module Google
718
724
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
719
725
 
720
726
  header_params = {}
721
- if request.project_id
722
- header_params["project_id"] = request.project_id
723
- end
724
- if request.id
725
- header_params["id"] = request.id
727
+ if request.name
728
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/builds/[^/]+/?$}.match request.name
729
+ if regex_match
730
+ header_params["location"] = regex_match["location".to_s]
731
+ end
726
732
  end
727
733
 
728
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
734
+ request_params_header = URI.encode_www_form header_params
729
735
  metadata[:"x-goog-request-params"] ||= request_params_header
730
736
 
731
737
  options.apply_defaults timeout: @config.rpcs.retry_build.timeout,
@@ -823,10 +829,13 @@ module Google
823
829
 
824
830
  header_params = {}
825
831
  if request.name
826
- header_params["name"] = request.name
832
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/builds/[^/]+/?$}.match request.name
833
+ if regex_match
834
+ header_params["location"] = regex_match["location".to_s]
835
+ end
827
836
  end
828
837
 
829
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
838
+ request_params_header = URI.encode_www_form header_params
830
839
  metadata[:"x-goog-request-params"] ||= request_params_header
831
840
 
832
841
  options.apply_defaults timeout: @config.rpcs.approve_build.timeout,
@@ -915,11 +924,14 @@ module Google
915
924
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
916
925
 
917
926
  header_params = {}
918
- if request.project_id
919
- header_params["project_id"] = request.project_id
927
+ if request.parent
928
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
929
+ if regex_match
930
+ header_params["location"] = regex_match["location".to_s]
931
+ end
920
932
  end
921
933
 
922
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
934
+ request_params_header = URI.encode_www_form header_params
923
935
  metadata[:"x-goog-request-params"] ||= request_params_header
924
936
 
925
937
  options.apply_defaults timeout: @config.rpcs.create_build_trigger.timeout,
@@ -1007,14 +1019,14 @@ module Google
1007
1019
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1008
1020
 
1009
1021
  header_params = {}
1010
- if request.project_id
1011
- header_params["project_id"] = request.project_id
1012
- end
1013
- if request.trigger_id
1014
- header_params["trigger_id"] = request.trigger_id
1022
+ if request.name
1023
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/triggers/[^/]+/?$}.match request.name
1024
+ if regex_match
1025
+ header_params["location"] = regex_match["location".to_s]
1026
+ end
1015
1027
  end
1016
1028
 
1017
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1029
+ request_params_header = URI.encode_www_form header_params
1018
1030
  metadata[:"x-goog-request-params"] ||= request_params_header
1019
1031
 
1020
1032
  options.apply_defaults timeout: @config.rpcs.get_build_trigger.timeout,
@@ -1108,11 +1120,14 @@ module Google
1108
1120
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1109
1121
 
1110
1122
  header_params = {}
1111
- if request.project_id
1112
- header_params["project_id"] = request.project_id
1123
+ if request.parent
1124
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
1125
+ if regex_match
1126
+ header_params["location"] = regex_match["location".to_s]
1127
+ end
1113
1128
  end
1114
1129
 
1115
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1130
+ request_params_header = URI.encode_www_form header_params
1116
1131
  metadata[:"x-goog-request-params"] ||= request_params_header
1117
1132
 
1118
1133
  options.apply_defaults timeout: @config.rpcs.list_build_triggers.timeout,
@@ -1201,14 +1216,14 @@ module Google
1201
1216
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1202
1217
 
1203
1218
  header_params = {}
1204
- if request.project_id
1205
- header_params["project_id"] = request.project_id
1206
- end
1207
- if request.trigger_id
1208
- header_params["trigger_id"] = request.trigger_id
1219
+ if request.name
1220
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/triggers/[^/]+/?$}.match request.name
1221
+ if regex_match
1222
+ header_params["location"] = regex_match["location".to_s]
1223
+ end
1209
1224
  end
1210
1225
 
1211
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1226
+ request_params_header = URI.encode_www_form header_params
1212
1227
  metadata[:"x-goog-request-params"] ||= request_params_header
1213
1228
 
1214
1229
  options.apply_defaults timeout: @config.rpcs.delete_build_trigger.timeout,
@@ -1295,14 +1310,14 @@ module Google
1295
1310
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1296
1311
 
1297
1312
  header_params = {}
1298
- if request.project_id
1299
- header_params["project_id"] = request.project_id
1300
- end
1301
- if request.trigger_id
1302
- header_params["trigger_id"] = request.trigger_id
1313
+ if request.trigger&.resource_name
1314
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/triggers/[^/]+/?$}.match request.trigger.resource_name
1315
+ if regex_match
1316
+ header_params["location"] = regex_match["location".to_s]
1317
+ end
1303
1318
  end
1304
1319
 
1305
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1320
+ request_params_header = URI.encode_www_form header_params
1306
1321
  metadata[:"x-goog-request-params"] ||= request_params_header
1307
1322
 
1308
1323
  options.apply_defaults timeout: @config.rpcs.update_build_trigger.timeout,
@@ -1324,6 +1339,12 @@ module Google
1324
1339
  ##
1325
1340
  # Runs a `BuildTrigger` at a particular source revision.
1326
1341
  #
1342
+ # To run a regional or global trigger, use the POST request
1343
+ # that includes the location endpoint in the path (ex.
1344
+ # v1/projects/\\{projectId}/locations/\\{region}/triggers/\\{triggerId}:run). The
1345
+ # POST request that does not include the location endpoint in the path can
1346
+ # only be used when running global triggers.
1347
+ #
1327
1348
  # @overload run_build_trigger(request, options = nil)
1328
1349
  # Pass arguments to `run_build_trigger` via a request object, either of type
1329
1350
  # {::Google::Cloud::Build::V1::RunBuildTriggerRequest} or an equivalent Hash.
@@ -1348,6 +1369,7 @@ module Google
1348
1369
  # Required. ID of the trigger.
1349
1370
  # @param source [::Google::Cloud::Build::V1::RepoSource, ::Hash]
1350
1371
  # Source to build against this trigger.
1372
+ # Branch and tag names cannot consist of regular expressions.
1351
1373
  #
1352
1374
  # @yield [response, operation] Access the result along with the RPC operation
1353
1375
  # @yieldparam response [::Gapic::Operation]
@@ -1397,14 +1419,14 @@ module Google
1397
1419
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1398
1420
 
1399
1421
  header_params = {}
1400
- if request.project_id
1401
- header_params["project_id"] = request.project_id
1402
- end
1403
- if request.trigger_id
1404
- header_params["trigger_id"] = request.trigger_id
1422
+ if request.name
1423
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/triggers/[^/]+/?$}.match request.name
1424
+ if regex_match
1425
+ header_params["location"] = regex_match["location".to_s]
1426
+ end
1405
1427
  end
1406
1428
 
1407
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1429
+ request_params_header = URI.encode_www_form header_params
1408
1430
  metadata[:"x-goog-request-params"] ||= request_params_header
1409
1431
 
1410
1432
  options.apply_defaults timeout: @config.rpcs.run_build_trigger.timeout,
@@ -1604,10 +1626,13 @@ module Google
1604
1626
 
1605
1627
  header_params = {}
1606
1628
  if request.parent
1607
- header_params["parent"] = request.parent
1629
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
1630
+ if regex_match
1631
+ header_params["location"] = regex_match["location".to_s]
1632
+ end
1608
1633
  end
1609
1634
 
1610
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1635
+ request_params_header = URI.encode_www_form header_params
1611
1636
  metadata[:"x-goog-request-params"] ||= request_params_header
1612
1637
 
1613
1638
  options.apply_defaults timeout: @config.rpcs.create_worker_pool.timeout,
@@ -1691,10 +1716,13 @@ module Google
1691
1716
 
1692
1717
  header_params = {}
1693
1718
  if request.name
1694
- header_params["name"] = request.name
1719
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/workerPools/[^/]+/?$}.match request.name
1720
+ if regex_match
1721
+ header_params["location"] = regex_match["location".to_s]
1722
+ end
1695
1723
  end
1696
1724
 
1697
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1725
+ request_params_header = URI.encode_www_form header_params
1698
1726
  metadata[:"x-goog-request-params"] ||= request_params_header
1699
1727
 
1700
1728
  options.apply_defaults timeout: @config.rpcs.get_worker_pool.timeout,
@@ -1736,8 +1764,8 @@ module Google
1736
1764
  # Format:
1737
1765
  # `projects/{project}/locations/{location}/workerPools/{workerPool}`.
1738
1766
  # @param etag [::String]
1739
- # Optional. If this is provided, it must match the server's etag on the
1740
- # workerpool for the request to be processed.
1767
+ # Optional. If provided, it must match the server's etag on the workerpool
1768
+ # for the request to be processed.
1741
1769
  # @param allow_missing [::Boolean]
1742
1770
  # If set to true, and the `WorkerPool` is not found, the request will succeed
1743
1771
  # but no action will be taken on the server.
@@ -1794,10 +1822,13 @@ module Google
1794
1822
 
1795
1823
  header_params = {}
1796
1824
  if request.name
1797
- header_params["name"] = request.name
1825
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/workerPools/[^/]+/?$}.match request.name
1826
+ if regex_match
1827
+ header_params["location"] = regex_match["location".to_s]
1828
+ end
1798
1829
  end
1799
1830
 
1800
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1831
+ request_params_header = URI.encode_www_form header_params
1801
1832
  metadata[:"x-goog-request-params"] ||= request_params_header
1802
1833
 
1803
1834
  options.apply_defaults timeout: @config.rpcs.delete_worker_pool.timeout,
@@ -1895,10 +1926,13 @@ module Google
1895
1926
 
1896
1927
  header_params = {}
1897
1928
  if request.worker_pool&.name
1898
- header_params["worker_pool.name"] = request.worker_pool.name
1929
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/workerPools/[^/]+/?$}.match request.worker_pool.name
1930
+ if regex_match
1931
+ header_params["location"] = regex_match["location".to_s]
1932
+ end
1899
1933
  end
1900
1934
 
1901
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1935
+ request_params_header = URI.encode_www_form header_params
1902
1936
  metadata[:"x-goog-request-params"] ||= request_params_header
1903
1937
 
1904
1938
  options.apply_defaults timeout: @config.rpcs.update_worker_pool.timeout,
@@ -1992,10 +2026,13 @@ module Google
1992
2026
 
1993
2027
  header_params = {}
1994
2028
  if request.parent
1995
- header_params["parent"] = request.parent
2029
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
2030
+ if regex_match
2031
+ header_params["location"] = regex_match["location".to_s]
2032
+ end
1996
2033
  end
1997
2034
 
1998
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2035
+ request_params_header = URI.encode_www_form header_params
1999
2036
  metadata[:"x-goog-request-params"] ||= request_params_header
2000
2037
 
2001
2038
  options.apply_defaults timeout: @config.rpcs.list_worker_pools.timeout,
@@ -127,6 +127,47 @@ module Google
127
127
  "projects/#{project}/locations/#{location}/keyRings/#{keyring}/cryptoKeys/#{key}"
128
128
  end
129
129
 
130
+ ##
131
+ # Create a fully-qualified GithubEnterpriseConfig resource string.
132
+ #
133
+ # @overload github_enterprise_config_path(project:, config:)
134
+ # The resource will be in the following format:
135
+ #
136
+ # `projects/{project}/githubEnterpriseConfigs/{config}`
137
+ #
138
+ # @param project [String]
139
+ # @param config [String]
140
+ #
141
+ # @overload github_enterprise_config_path(project:, location:, config:)
142
+ # The resource will be in the following format:
143
+ #
144
+ # `projects/{project}/locations/{location}/githubEnterpriseConfigs/{config}`
145
+ #
146
+ # @param project [String]
147
+ # @param location [String]
148
+ # @param config [String]
149
+ #
150
+ # @return [::String]
151
+ def github_enterprise_config_path **args
152
+ resources = {
153
+ "config:project" => (proc do |project:, config:|
154
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
155
+
156
+ "projects/#{project}/githubEnterpriseConfigs/#{config}"
157
+ end),
158
+ "config:location:project" => (proc do |project:, location:, config:|
159
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
160
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
161
+
162
+ "projects/#{project}/locations/#{location}/githubEnterpriseConfigs/#{config}"
163
+ end)
164
+ }
165
+
166
+ resource = resources[args.keys.sort.join(":")]
167
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
168
+ resource.call(**args)
169
+ end
170
+
130
171
  ##
131
172
  # Create a fully-qualified Location resource string.
132
173
  #
@@ -521,7 +521,7 @@ module Google
521
521
  #
522
522
  # For builds that specify `StorageSource`:
523
523
  #
524
- # * If the original build pulled source from Google Cloud Storage without
524
+ # * If the original build pulled source from Cloud Storage without
525
525
  # specifying the generation of the object, the new build will use the current
526
526
  # object, which may be different from the original build source.
527
527
  # * If the original build pulled source from Cloud Storage and specified the
@@ -1015,6 +1015,12 @@ module Google
1015
1015
  ##
1016
1016
  # Runs a `BuildTrigger` at a particular source revision.
1017
1017
  #
1018
+ # To run a regional or global trigger, use the POST request
1019
+ # that includes the location endpoint in the path (ex.
1020
+ # v1/projects/\\{projectId}/locations/\\{region}/triggers/\\{triggerId}:run). The
1021
+ # POST request that does not include the location endpoint in the path can
1022
+ # only be used when running global triggers.
1023
+ #
1018
1024
  # @overload run_build_trigger(request, options = nil)
1019
1025
  # Pass arguments to `run_build_trigger` via a request object, either of type
1020
1026
  # {::Google::Cloud::Build::V1::RunBuildTriggerRequest} or an equivalent Hash.
@@ -1039,6 +1045,7 @@ module Google
1039
1045
  # Required. ID of the trigger.
1040
1046
  # @param source [::Google::Cloud::Build::V1::RepoSource, ::Hash]
1041
1047
  # Source to build against this trigger.
1048
+ # Branch and tag names cannot consist of regular expressions.
1042
1049
  # @yield [result, operation] Access the result along with the TransportOperation object
1043
1050
  # @yieldparam result [::Gapic::Operation]
1044
1051
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1315,8 +1322,8 @@ module Google
1315
1322
  # Format:
1316
1323
  # `projects/{project}/locations/{location}/workerPools/{workerPool}`.
1317
1324
  # @param etag [::String]
1318
- # Optional. If this is provided, it must match the server's etag on the
1319
- # workerpool for the request to be processed.
1325
+ # Optional. If provided, it must match the server's etag on the workerpool
1326
+ # for the request to be processed.
1320
1327
  # @param allow_missing [::Boolean]
1321
1328
  # If set to true, and the `WorkerPool` is not found, the request will succeed
1322
1329
  # but no action will be taken on the server.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Build
23
23
  module V1
24
- VERSION = "0.19.0"
24
+ VERSION = "0.21.0"
25
25
  end
26
26
  end
27
27
  end