google-apis-cloudbuild_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,818 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudbuildV2
23
+ # Cloud Build API
24
+ #
25
+ # Creates and manages builds on Google Cloud Platform.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudbuild_v2'
29
+ #
30
+ # Cloudbuild = Google::Apis::CloudbuildV2 # Alias the module
31
+ # service = Cloudbuild::CloudBuildService.new
32
+ #
33
+ # @see https://cloud.google.com/cloud-build/docs/
34
+ class CloudBuildService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://cloudbuild.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudbuild_v2',
48
+ client_version: Google::Apis::CloudbuildV2::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a Connection.
53
+ # @param [String] parent
54
+ # Required. Project and location where the connection will be created. Format: `
55
+ # projects/*/locations/*`.
56
+ # @param [Google::Apis::CloudbuildV2::Connection] connection_object
57
+ # @param [String] connection_id
58
+ # Required. The ID to use for the Connection, which will become the final
59
+ # component of the Connection's resource name. Names must be unique per-project
60
+ # per-location. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::CloudbuildV2::Operation]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def create_project_location_connection(parent, connection_object = nil, connection_id: nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v2/{+parent}/connections', options)
80
+ command.request_representation = Google::Apis::CloudbuildV2::Connection::Representation
81
+ command.request_object = connection_object
82
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
83
+ command.response_class = Google::Apis::CloudbuildV2::Operation
84
+ command.params['parent'] = parent unless parent.nil?
85
+ command.query['connectionId'] = connection_id unless connection_id.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Deletes a single connection.
92
+ # @param [String] name
93
+ # Required. The name of the Connection to delete. Format: `projects/*/locations/*
94
+ # /connections/*`.
95
+ # @param [String] etag
96
+ # The current etag of the connection. If an etag is provided and does not match
97
+ # the current etag of the connection, deletion will be blocked and an ABORTED
98
+ # error will be returned.
99
+ # @param [Boolean] validate_only
100
+ # If set, validate the request, but do not actually post it.
101
+ # @param [String] fields
102
+ # Selector specifying which fields to include in a partial response.
103
+ # @param [String] quota_user
104
+ # Available to use for quota purposes for server-side applications. Can be any
105
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
106
+ # @param [Google::Apis::RequestOptions] options
107
+ # Request-specific options
108
+ #
109
+ # @yield [result, err] Result & error if block supplied
110
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
111
+ # @yieldparam err [StandardError] error object if request failed
112
+ #
113
+ # @return [Google::Apis::CloudbuildV2::Operation]
114
+ #
115
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
116
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
117
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
118
+ def delete_project_location_connection(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
119
+ command = make_simple_command(:delete, 'v2/{+name}', options)
120
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
121
+ command.response_class = Google::Apis::CloudbuildV2::Operation
122
+ command.params['name'] = name unless name.nil?
123
+ command.query['etag'] = etag unless etag.nil?
124
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
125
+ command.query['fields'] = fields unless fields.nil?
126
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
127
+ execute_or_queue_command(command, &block)
128
+ end
129
+
130
+ # FetchLinkableRepositories get repositories from SCM that are accessible and
131
+ # could be added to the connection.
132
+ # @param [String] connection
133
+ # Required. The name of the Connection. Format: `projects/*/locations/*/
134
+ # connections/*`.
135
+ # @param [Fixnum] page_size
136
+ # Number of results to return in the list. Default to 20.
137
+ # @param [String] page_token
138
+ # Page start.
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def fetch_project_location_connection_linkable_repositories(connection, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:get, 'v2/{+connection}:fetchLinkableRepositories', options)
158
+ command.response_representation = Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse::Representation
159
+ command.response_class = Google::Apis::CloudbuildV2::FetchLinkableRepositoriesResponse
160
+ command.params['connection'] = connection unless connection.nil?
161
+ command.query['pageSize'] = page_size unless page_size.nil?
162
+ command.query['pageToken'] = page_token unless page_token.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Gets details of a single connection.
169
+ # @param [String] name
170
+ # Required. The name of the Connection to retrieve. Format: `projects/*/
171
+ # locations/*/connections/*`.
172
+ # @param [String] fields
173
+ # Selector specifying which fields to include in a partial response.
174
+ # @param [String] quota_user
175
+ # Available to use for quota purposes for server-side applications. Can be any
176
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
177
+ # @param [Google::Apis::RequestOptions] options
178
+ # Request-specific options
179
+ #
180
+ # @yield [result, err] Result & error if block supplied
181
+ # @yieldparam result [Google::Apis::CloudbuildV2::Connection] parsed result object
182
+ # @yieldparam err [StandardError] error object if request failed
183
+ #
184
+ # @return [Google::Apis::CloudbuildV2::Connection]
185
+ #
186
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
187
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
188
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
189
+ def get_project_location_connection(name, fields: nil, quota_user: nil, options: nil, &block)
190
+ command = make_simple_command(:get, 'v2/{+name}', options)
191
+ command.response_representation = Google::Apis::CloudbuildV2::Connection::Representation
192
+ command.response_class = Google::Apis::CloudbuildV2::Connection
193
+ command.params['name'] = name unless name.nil?
194
+ command.query['fields'] = fields unless fields.nil?
195
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
196
+ execute_or_queue_command(command, &block)
197
+ end
198
+
199
+ # Gets the access control policy for a resource. Returns an empty policy if the
200
+ # resource exists and does not have a policy set.
201
+ # @param [String] resource
202
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
203
+ # names](https://cloud.google.com/apis/design/resource_names) for the
204
+ # appropriate value for this field.
205
+ # @param [Fixnum] options_requested_policy_version
206
+ # Optional. The maximum policy version that will be used to format the policy.
207
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
208
+ # rejected. Requests for policies with any conditional role bindings must
209
+ # specify version 3. Policies with no conditional role bindings may specify any
210
+ # valid value or leave the field unset. The policy in the response might use the
211
+ # policy version that you specified, or it might use a lower policy version. For
212
+ # example, if you specify version 3, but the policy has no conditional role
213
+ # bindings, the response uses version 1. To learn which resources support
214
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
215
+ # google.com/iam/help/conditions/resource-policies).
216
+ # @param [String] fields
217
+ # Selector specifying which fields to include in a partial response.
218
+ # @param [String] quota_user
219
+ # Available to use for quota purposes for server-side applications. Can be any
220
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
221
+ # @param [Google::Apis::RequestOptions] options
222
+ # Request-specific options
223
+ #
224
+ # @yield [result, err] Result & error if block supplied
225
+ # @yieldparam result [Google::Apis::CloudbuildV2::Policy] parsed result object
226
+ # @yieldparam err [StandardError] error object if request failed
227
+ #
228
+ # @return [Google::Apis::CloudbuildV2::Policy]
229
+ #
230
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
231
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
232
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
233
+ def get_project_location_connection_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
234
+ command = make_simple_command(:get, 'v2/{+resource}:getIamPolicy', options)
235
+ command.response_representation = Google::Apis::CloudbuildV2::Policy::Representation
236
+ command.response_class = Google::Apis::CloudbuildV2::Policy
237
+ command.params['resource'] = resource unless resource.nil?
238
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
239
+ command.query['fields'] = fields unless fields.nil?
240
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
241
+ execute_or_queue_command(command, &block)
242
+ end
243
+
244
+ # Lists Connections in a given project and location.
245
+ # @param [String] parent
246
+ # Required. The parent, which owns this collection of Connections. Format: `
247
+ # projects/*/locations/*`.
248
+ # @param [Fixnum] page_size
249
+ # Number of results to return in the list.
250
+ # @param [String] page_token
251
+ # Page start.
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # @param [Google::Apis::RequestOptions] options
258
+ # Request-specific options
259
+ #
260
+ # @yield [result, err] Result & error if block supplied
261
+ # @yieldparam result [Google::Apis::CloudbuildV2::ListConnectionsResponse] parsed result object
262
+ # @yieldparam err [StandardError] error object if request failed
263
+ #
264
+ # @return [Google::Apis::CloudbuildV2::ListConnectionsResponse]
265
+ #
266
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
267
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
268
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
269
+ def list_project_location_connections(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
270
+ command = make_simple_command(:get, 'v2/{+parent}/connections', options)
271
+ command.response_representation = Google::Apis::CloudbuildV2::ListConnectionsResponse::Representation
272
+ command.response_class = Google::Apis::CloudbuildV2::ListConnectionsResponse
273
+ command.params['parent'] = parent unless parent.nil?
274
+ command.query['pageSize'] = page_size unless page_size.nil?
275
+ command.query['pageToken'] = page_token unless page_token.nil?
276
+ command.query['fields'] = fields unless fields.nil?
277
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
278
+ execute_or_queue_command(command, &block)
279
+ end
280
+
281
+ # Updates a single connection.
282
+ # @param [String] name
283
+ # Immutable. The resource name of the connection, in the format `projects/`
284
+ # project`/locations/`location`/connections/`connection_id``.
285
+ # @param [Google::Apis::CloudbuildV2::Connection] connection_object
286
+ # @param [Boolean] allow_missing
287
+ # If set to true, and the connection is not found a new connection will be
288
+ # created. In this situation `update_mask` is ignored. The creation will succeed
289
+ # only if the input connection has all the necessary information (e.g a
290
+ # github_config with both user_oauth_token and installation_id properties).
291
+ # @param [String] etag
292
+ # The current etag of the connection. If an etag is provided and does not match
293
+ # the current etag of the connection, update will be blocked and an ABORTED
294
+ # error will be returned.
295
+ # @param [String] update_mask
296
+ # The list of fields to be updated.
297
+ # @param [String] fields
298
+ # Selector specifying which fields to include in a partial response.
299
+ # @param [String] quota_user
300
+ # Available to use for quota purposes for server-side applications. Can be any
301
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
302
+ # @param [Google::Apis::RequestOptions] options
303
+ # Request-specific options
304
+ #
305
+ # @yield [result, err] Result & error if block supplied
306
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
307
+ # @yieldparam err [StandardError] error object if request failed
308
+ #
309
+ # @return [Google::Apis::CloudbuildV2::Operation]
310
+ #
311
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
312
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
313
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
314
+ def patch_project_location_connection(name, connection_object = nil, allow_missing: nil, etag: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
315
+ command = make_simple_command(:patch, 'v2/{+name}', options)
316
+ command.request_representation = Google::Apis::CloudbuildV2::Connection::Representation
317
+ command.request_object = connection_object
318
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
319
+ command.response_class = Google::Apis::CloudbuildV2::Operation
320
+ command.params['name'] = name unless name.nil?
321
+ command.query['allowMissing'] = allow_missing unless allow_missing.nil?
322
+ command.query['etag'] = etag unless etag.nil?
323
+ command.query['updateMask'] = update_mask unless update_mask.nil?
324
+ command.query['fields'] = fields unless fields.nil?
325
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
326
+ execute_or_queue_command(command, &block)
327
+ end
328
+
329
+ # ProcessWebhook is called by the external SCM for notifying of events.
330
+ # @param [String] parent
331
+ # Required. Project and location where the webhook will be received. Format: `
332
+ # projects/*/locations/*`.
333
+ # @param [Google::Apis::CloudbuildV2::HttpBody] http_body_object
334
+ # @param [String] webhook_key
335
+ # Arbitrary additional key to find the maching repository for a webhook event if
336
+ # needed.
337
+ # @param [String] fields
338
+ # Selector specifying which fields to include in a partial response.
339
+ # @param [String] quota_user
340
+ # Available to use for quota purposes for server-side applications. Can be any
341
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
342
+ # @param [Google::Apis::RequestOptions] options
343
+ # Request-specific options
344
+ #
345
+ # @yield [result, err] Result & error if block supplied
346
+ # @yieldparam result [Google::Apis::CloudbuildV2::Empty] parsed result object
347
+ # @yieldparam err [StandardError] error object if request failed
348
+ #
349
+ # @return [Google::Apis::CloudbuildV2::Empty]
350
+ #
351
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
352
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
353
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
354
+ def process_project_location_connection_webhook(parent, http_body_object = nil, webhook_key: nil, fields: nil, quota_user: nil, options: nil, &block)
355
+ command = make_simple_command(:post, 'v2/{+parent}/connections:processWebhook', options)
356
+ command.request_representation = Google::Apis::CloudbuildV2::HttpBody::Representation
357
+ command.request_object = http_body_object
358
+ command.response_representation = Google::Apis::CloudbuildV2::Empty::Representation
359
+ command.response_class = Google::Apis::CloudbuildV2::Empty
360
+ command.params['parent'] = parent unless parent.nil?
361
+ command.query['webhookKey'] = webhook_key unless webhook_key.nil?
362
+ command.query['fields'] = fields unless fields.nil?
363
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
364
+ execute_or_queue_command(command, &block)
365
+ end
366
+
367
+ # Sets the access control policy on the specified resource. Replaces any
368
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
369
+ # PERMISSION_DENIED` errors.
370
+ # @param [String] resource
371
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
372
+ # names](https://cloud.google.com/apis/design/resource_names) for the
373
+ # appropriate value for this field.
374
+ # @param [Google::Apis::CloudbuildV2::SetIamPolicyRequest] set_iam_policy_request_object
375
+ # @param [String] fields
376
+ # Selector specifying which fields to include in a partial response.
377
+ # @param [String] quota_user
378
+ # Available to use for quota purposes for server-side applications. Can be any
379
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
380
+ # @param [Google::Apis::RequestOptions] options
381
+ # Request-specific options
382
+ #
383
+ # @yield [result, err] Result & error if block supplied
384
+ # @yieldparam result [Google::Apis::CloudbuildV2::Policy] parsed result object
385
+ # @yieldparam err [StandardError] error object if request failed
386
+ #
387
+ # @return [Google::Apis::CloudbuildV2::Policy]
388
+ #
389
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
390
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
391
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
392
+ def set_connection_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
393
+ command = make_simple_command(:post, 'v2/{+resource}:setIamPolicy', options)
394
+ command.request_representation = Google::Apis::CloudbuildV2::SetIamPolicyRequest::Representation
395
+ command.request_object = set_iam_policy_request_object
396
+ command.response_representation = Google::Apis::CloudbuildV2::Policy::Representation
397
+ command.response_class = Google::Apis::CloudbuildV2::Policy
398
+ command.params['resource'] = resource unless resource.nil?
399
+ command.query['fields'] = fields unless fields.nil?
400
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
401
+ execute_or_queue_command(command, &block)
402
+ end
403
+
404
+ # Returns permissions that a caller has on the specified resource. If the
405
+ # resource does not exist, this will return an empty set of permissions, not a `
406
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
407
+ # permission-aware UIs and command-line tools, not for authorization checking.
408
+ # This operation may "fail open" without warning.
409
+ # @param [String] resource
410
+ # REQUIRED: The resource for which the policy detail is being requested. See [
411
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
412
+ # appropriate value for this field.
413
+ # @param [Google::Apis::CloudbuildV2::TestIamPermissionsRequest] test_iam_permissions_request_object
414
+ # @param [String] fields
415
+ # Selector specifying which fields to include in a partial response.
416
+ # @param [String] quota_user
417
+ # Available to use for quota purposes for server-side applications. Can be any
418
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
419
+ # @param [Google::Apis::RequestOptions] options
420
+ # Request-specific options
421
+ #
422
+ # @yield [result, err] Result & error if block supplied
423
+ # @yieldparam result [Google::Apis::CloudbuildV2::TestIamPermissionsResponse] parsed result object
424
+ # @yieldparam err [StandardError] error object if request failed
425
+ #
426
+ # @return [Google::Apis::CloudbuildV2::TestIamPermissionsResponse]
427
+ #
428
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
429
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
430
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
431
+ def test_connection_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
432
+ command = make_simple_command(:post, 'v2/{+resource}:testIamPermissions', options)
433
+ command.request_representation = Google::Apis::CloudbuildV2::TestIamPermissionsRequest::Representation
434
+ command.request_object = test_iam_permissions_request_object
435
+ command.response_representation = Google::Apis::CloudbuildV2::TestIamPermissionsResponse::Representation
436
+ command.response_class = Google::Apis::CloudbuildV2::TestIamPermissionsResponse
437
+ command.params['resource'] = resource unless resource.nil?
438
+ command.query['fields'] = fields unless fields.nil?
439
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
440
+ execute_or_queue_command(command, &block)
441
+ end
442
+
443
+ # Fetches read token of a given repository.
444
+ # @param [String] repository
445
+ # Required. The resource name of the repository in the format `projects/*/
446
+ # locations/*/connections/*/repositories/*`.
447
+ # @param [Google::Apis::CloudbuildV2::FetchReadTokenRequest] fetch_read_token_request_object
448
+ # @param [String] fields
449
+ # Selector specifying which fields to include in a partial response.
450
+ # @param [String] quota_user
451
+ # Available to use for quota purposes for server-side applications. Can be any
452
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
453
+ # @param [Google::Apis::RequestOptions] options
454
+ # Request-specific options
455
+ #
456
+ # @yield [result, err] Result & error if block supplied
457
+ # @yieldparam result [Google::Apis::CloudbuildV2::FetchReadTokenResponse] parsed result object
458
+ # @yieldparam err [StandardError] error object if request failed
459
+ #
460
+ # @return [Google::Apis::CloudbuildV2::FetchReadTokenResponse]
461
+ #
462
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
463
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
464
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
465
+ def access_project_location_connection_repository_read_token(repository, fetch_read_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
466
+ command = make_simple_command(:post, 'v2/{+repository}:accessReadToken', options)
467
+ command.request_representation = Google::Apis::CloudbuildV2::FetchReadTokenRequest::Representation
468
+ command.request_object = fetch_read_token_request_object
469
+ command.response_representation = Google::Apis::CloudbuildV2::FetchReadTokenResponse::Representation
470
+ command.response_class = Google::Apis::CloudbuildV2::FetchReadTokenResponse
471
+ command.params['repository'] = repository unless repository.nil?
472
+ command.query['fields'] = fields unless fields.nil?
473
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
474
+ execute_or_queue_command(command, &block)
475
+ end
476
+
477
+ # Fetches read/write token of a given repository.
478
+ # @param [String] repository
479
+ # Required. The resource name of the repository in the format `projects/*/
480
+ # locations/*/connections/*/repositories/*`.
481
+ # @param [Google::Apis::CloudbuildV2::FetchReadWriteTokenRequest] fetch_read_write_token_request_object
482
+ # @param [String] fields
483
+ # Selector specifying which fields to include in a partial response.
484
+ # @param [String] quota_user
485
+ # Available to use for quota purposes for server-side applications. Can be any
486
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
487
+ # @param [Google::Apis::RequestOptions] options
488
+ # Request-specific options
489
+ #
490
+ # @yield [result, err] Result & error if block supplied
491
+ # @yieldparam result [Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse] parsed result object
492
+ # @yieldparam err [StandardError] error object if request failed
493
+ #
494
+ # @return [Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse]
495
+ #
496
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
497
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
498
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
499
+ def access_project_location_connection_repository_read_write_token(repository, fetch_read_write_token_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
500
+ command = make_simple_command(:post, 'v2/{+repository}:accessReadWriteToken', options)
501
+ command.request_representation = Google::Apis::CloudbuildV2::FetchReadWriteTokenRequest::Representation
502
+ command.request_object = fetch_read_write_token_request_object
503
+ command.response_representation = Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse::Representation
504
+ command.response_class = Google::Apis::CloudbuildV2::FetchReadWriteTokenResponse
505
+ command.params['repository'] = repository unless repository.nil?
506
+ command.query['fields'] = fields unless fields.nil?
507
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
508
+ execute_or_queue_command(command, &block)
509
+ end
510
+
511
+ # Creates multiple repositories inside a connection.
512
+ # @param [String] parent
513
+ # Required. The connection to contain all the repositories being created. Format:
514
+ # projects/*/locations/*/connections/* The parent field in the
515
+ # CreateRepositoryRequest messages must either be empty or match this field.
516
+ # @param [Google::Apis::CloudbuildV2::BatchCreateRepositoriesRequest] batch_create_repositories_request_object
517
+ # @param [String] fields
518
+ # Selector specifying which fields to include in a partial response.
519
+ # @param [String] quota_user
520
+ # Available to use for quota purposes for server-side applications. Can be any
521
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
522
+ # @param [Google::Apis::RequestOptions] options
523
+ # Request-specific options
524
+ #
525
+ # @yield [result, err] Result & error if block supplied
526
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
527
+ # @yieldparam err [StandardError] error object if request failed
528
+ #
529
+ # @return [Google::Apis::CloudbuildV2::Operation]
530
+ #
531
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
532
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
533
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
534
+ def batch_repository_create_repositories(parent, batch_create_repositories_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
535
+ command = make_simple_command(:post, 'v2/{+parent}/repositories:batchCreate', options)
536
+ command.request_representation = Google::Apis::CloudbuildV2::BatchCreateRepositoriesRequest::Representation
537
+ command.request_object = batch_create_repositories_request_object
538
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
539
+ command.response_class = Google::Apis::CloudbuildV2::Operation
540
+ command.params['parent'] = parent unless parent.nil?
541
+ command.query['fields'] = fields unless fields.nil?
542
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
543
+ execute_or_queue_command(command, &block)
544
+ end
545
+
546
+ # Creates a Repository.
547
+ # @param [String] parent
548
+ # Required. The connection to contain the repository. If the request is part of
549
+ # a BatchCreateRepositoriesRequest, this field should be empty or match the
550
+ # parent specified there.
551
+ # @param [Google::Apis::CloudbuildV2::Repository] repository_object
552
+ # @param [String] repository_id
553
+ # Required. The ID to use for the repository, which will become the final
554
+ # component of the repository's resource name. This ID should be unique in the
555
+ # connection. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.
556
+ # @param [String] fields
557
+ # Selector specifying which fields to include in a partial response.
558
+ # @param [String] quota_user
559
+ # Available to use for quota purposes for server-side applications. Can be any
560
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
561
+ # @param [Google::Apis::RequestOptions] options
562
+ # Request-specific options
563
+ #
564
+ # @yield [result, err] Result & error if block supplied
565
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
566
+ # @yieldparam err [StandardError] error object if request failed
567
+ #
568
+ # @return [Google::Apis::CloudbuildV2::Operation]
569
+ #
570
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
571
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
572
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
573
+ def create_project_location_connection_repository(parent, repository_object = nil, repository_id: nil, fields: nil, quota_user: nil, options: nil, &block)
574
+ command = make_simple_command(:post, 'v2/{+parent}/repositories', options)
575
+ command.request_representation = Google::Apis::CloudbuildV2::Repository::Representation
576
+ command.request_object = repository_object
577
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
578
+ command.response_class = Google::Apis::CloudbuildV2::Operation
579
+ command.params['parent'] = parent unless parent.nil?
580
+ command.query['repositoryId'] = repository_id unless repository_id.nil?
581
+ command.query['fields'] = fields unless fields.nil?
582
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
583
+ execute_or_queue_command(command, &block)
584
+ end
585
+
586
+ # Deletes a single repository.
587
+ # @param [String] name
588
+ # Required. The name of the Repository to delete. Format: `projects/*/locations/*
589
+ # /connections/*/repositories/*`.
590
+ # @param [String] etag
591
+ # The current etag of the repository. If an etag is provided and does not match
592
+ # the current etag of the repository, deletion will be blocked and an ABORTED
593
+ # error will be returned.
594
+ # @param [Boolean] validate_only
595
+ # If set, validate the request, but do not actually post it.
596
+ # @param [String] fields
597
+ # Selector specifying which fields to include in a partial response.
598
+ # @param [String] quota_user
599
+ # Available to use for quota purposes for server-side applications. Can be any
600
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
601
+ # @param [Google::Apis::RequestOptions] options
602
+ # Request-specific options
603
+ #
604
+ # @yield [result, err] Result & error if block supplied
605
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
606
+ # @yieldparam err [StandardError] error object if request failed
607
+ #
608
+ # @return [Google::Apis::CloudbuildV2::Operation]
609
+ #
610
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
611
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
612
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
613
+ def delete_project_location_connection_repository(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
614
+ command = make_simple_command(:delete, 'v2/{+name}', options)
615
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
616
+ command.response_class = Google::Apis::CloudbuildV2::Operation
617
+ command.params['name'] = name unless name.nil?
618
+ command.query['etag'] = etag unless etag.nil?
619
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
620
+ command.query['fields'] = fields unless fields.nil?
621
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
622
+ execute_or_queue_command(command, &block)
623
+ end
624
+
625
+ # Fetch the list of branches or tags for a given repository.
626
+ # @param [String] repository
627
+ # Required. The resource name of the repository in the format `projects/*/
628
+ # locations/*/connections/*/repositories/*`.
629
+ # @param [Fixnum] page_size
630
+ # Optional. Number of results to return in the list. Default to 100.
631
+ # @param [String] page_token
632
+ # Optional. Page start.
633
+ # @param [String] ref_type
634
+ # Type of refs to fetch
635
+ # @param [String] fields
636
+ # Selector specifying which fields to include in a partial response.
637
+ # @param [String] quota_user
638
+ # Available to use for quota purposes for server-side applications. Can be any
639
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
640
+ # @param [Google::Apis::RequestOptions] options
641
+ # Request-specific options
642
+ #
643
+ # @yield [result, err] Result & error if block supplied
644
+ # @yieldparam result [Google::Apis::CloudbuildV2::FetchGitRefsResponse] parsed result object
645
+ # @yieldparam err [StandardError] error object if request failed
646
+ #
647
+ # @return [Google::Apis::CloudbuildV2::FetchGitRefsResponse]
648
+ #
649
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
650
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
651
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
652
+ def fetch_project_location_connection_repository_git_refs(repository, page_size: nil, page_token: nil, ref_type: nil, fields: nil, quota_user: nil, options: nil, &block)
653
+ command = make_simple_command(:get, 'v2/{+repository}:fetchGitRefs', options)
654
+ command.response_representation = Google::Apis::CloudbuildV2::FetchGitRefsResponse::Representation
655
+ command.response_class = Google::Apis::CloudbuildV2::FetchGitRefsResponse
656
+ command.params['repository'] = repository unless repository.nil?
657
+ command.query['pageSize'] = page_size unless page_size.nil?
658
+ command.query['pageToken'] = page_token unless page_token.nil?
659
+ command.query['refType'] = ref_type unless ref_type.nil?
660
+ command.query['fields'] = fields unless fields.nil?
661
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
662
+ execute_or_queue_command(command, &block)
663
+ end
664
+
665
+ # Gets details of a single repository.
666
+ # @param [String] name
667
+ # Required. The name of the Repository to retrieve. Format: `projects/*/
668
+ # locations/*/connections/*/repositories/*`.
669
+ # @param [String] fields
670
+ # Selector specifying which fields to include in a partial response.
671
+ # @param [String] quota_user
672
+ # Available to use for quota purposes for server-side applications. Can be any
673
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
674
+ # @param [Google::Apis::RequestOptions] options
675
+ # Request-specific options
676
+ #
677
+ # @yield [result, err] Result & error if block supplied
678
+ # @yieldparam result [Google::Apis::CloudbuildV2::Repository] parsed result object
679
+ # @yieldparam err [StandardError] error object if request failed
680
+ #
681
+ # @return [Google::Apis::CloudbuildV2::Repository]
682
+ #
683
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
684
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
685
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
686
+ def get_project_location_connection_repository(name, fields: nil, quota_user: nil, options: nil, &block)
687
+ command = make_simple_command(:get, 'v2/{+name}', options)
688
+ command.response_representation = Google::Apis::CloudbuildV2::Repository::Representation
689
+ command.response_class = Google::Apis::CloudbuildV2::Repository
690
+ command.params['name'] = name unless name.nil?
691
+ command.query['fields'] = fields unless fields.nil?
692
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
693
+ execute_or_queue_command(command, &block)
694
+ end
695
+
696
+ # Lists Repositories in a given connection.
697
+ # @param [String] parent
698
+ # Required. The parent, which owns this collection of Repositories. Format: `
699
+ # projects/*/locations/*/connections/*`.
700
+ # @param [String] filter
701
+ # A filter expression that filters resources listed in the response. Expressions
702
+ # must follow API improvement proposal [AIP-160](https://google.aip.dev/160). e.
703
+ # g. `remote_uri:"https://github.com*"`.
704
+ # @param [Fixnum] page_size
705
+ # Number of results to return in the list.
706
+ # @param [String] page_token
707
+ # Page start.
708
+ # @param [String] fields
709
+ # Selector specifying which fields to include in a partial response.
710
+ # @param [String] quota_user
711
+ # Available to use for quota purposes for server-side applications. Can be any
712
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
713
+ # @param [Google::Apis::RequestOptions] options
714
+ # Request-specific options
715
+ #
716
+ # @yield [result, err] Result & error if block supplied
717
+ # @yieldparam result [Google::Apis::CloudbuildV2::ListRepositoriesResponse] parsed result object
718
+ # @yieldparam err [StandardError] error object if request failed
719
+ #
720
+ # @return [Google::Apis::CloudbuildV2::ListRepositoriesResponse]
721
+ #
722
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
723
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
724
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
725
+ def list_project_location_connection_repositories(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
726
+ command = make_simple_command(:get, 'v2/{+parent}/repositories', options)
727
+ command.response_representation = Google::Apis::CloudbuildV2::ListRepositoriesResponse::Representation
728
+ command.response_class = Google::Apis::CloudbuildV2::ListRepositoriesResponse
729
+ command.params['parent'] = parent unless parent.nil?
730
+ command.query['filter'] = filter unless filter.nil?
731
+ command.query['pageSize'] = page_size unless page_size.nil?
732
+ command.query['pageToken'] = page_token unless page_token.nil?
733
+ command.query['fields'] = fields unless fields.nil?
734
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
735
+ execute_or_queue_command(command, &block)
736
+ end
737
+
738
+ # Starts asynchronous cancellation on a long-running operation. The server makes
739
+ # a best effort to cancel the operation, but success is not guaranteed. If the
740
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
741
+ # Clients can use Operations.GetOperation or other methods to check whether the
742
+ # cancellation succeeded or whether the operation completed despite cancellation.
743
+ # On successful cancellation, the operation is not deleted; instead, it becomes
744
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
745
+ # corresponding to `Code.CANCELLED`.
746
+ # @param [String] name
747
+ # The name of the operation resource to be cancelled.
748
+ # @param [Google::Apis::CloudbuildV2::CancelOperationRequest] cancel_operation_request_object
749
+ # @param [String] fields
750
+ # Selector specifying which fields to include in a partial response.
751
+ # @param [String] quota_user
752
+ # Available to use for quota purposes for server-side applications. Can be any
753
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
754
+ # @param [Google::Apis::RequestOptions] options
755
+ # Request-specific options
756
+ #
757
+ # @yield [result, err] Result & error if block supplied
758
+ # @yieldparam result [Google::Apis::CloudbuildV2::Empty] parsed result object
759
+ # @yieldparam err [StandardError] error object if request failed
760
+ #
761
+ # @return [Google::Apis::CloudbuildV2::Empty]
762
+ #
763
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
764
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
765
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
766
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
767
+ command = make_simple_command(:post, 'v2/{+name}:cancel', options)
768
+ command.request_representation = Google::Apis::CloudbuildV2::CancelOperationRequest::Representation
769
+ command.request_object = cancel_operation_request_object
770
+ command.response_representation = Google::Apis::CloudbuildV2::Empty::Representation
771
+ command.response_class = Google::Apis::CloudbuildV2::Empty
772
+ command.params['name'] = name unless name.nil?
773
+ command.query['fields'] = fields unless fields.nil?
774
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
775
+ execute_or_queue_command(command, &block)
776
+ end
777
+
778
+ # Gets the latest state of a long-running operation. Clients can use this method
779
+ # to poll the operation result at intervals as recommended by the API service.
780
+ # @param [String] name
781
+ # The name of the operation resource.
782
+ # @param [String] fields
783
+ # Selector specifying which fields to include in a partial response.
784
+ # @param [String] quota_user
785
+ # Available to use for quota purposes for server-side applications. Can be any
786
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
787
+ # @param [Google::Apis::RequestOptions] options
788
+ # Request-specific options
789
+ #
790
+ # @yield [result, err] Result & error if block supplied
791
+ # @yieldparam result [Google::Apis::CloudbuildV2::Operation] parsed result object
792
+ # @yieldparam err [StandardError] error object if request failed
793
+ #
794
+ # @return [Google::Apis::CloudbuildV2::Operation]
795
+ #
796
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
797
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
798
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
799
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
800
+ command = make_simple_command(:get, 'v2/{+name}', options)
801
+ command.response_representation = Google::Apis::CloudbuildV2::Operation::Representation
802
+ command.response_class = Google::Apis::CloudbuildV2::Operation
803
+ command.params['name'] = name unless name.nil?
804
+ command.query['fields'] = fields unless fields.nil?
805
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
806
+ execute_or_queue_command(command, &block)
807
+ end
808
+
809
+ protected
810
+
811
+ def apply_command_defaults(command)
812
+ command.query['key'] = key unless key.nil?
813
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end