google-apis-batch_v1 0.1.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.
@@ -0,0 +1,920 @@
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 BatchV1
23
+ # Batch API
24
+ #
25
+ # An API to manage the running of batch jobs on Google Cloud Platform.
26
+ #
27
+ # @example
28
+ # require 'google/apis/batch_v1'
29
+ #
30
+ # Batch = Google::Apis::BatchV1 # Alias the module
31
+ # service = Batch::BatchService.new
32
+ #
33
+ # @see https://cloud.google.com/batch/
34
+ class BatchService < 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://batch.googleapis.com/', '',
47
+ client_name: 'google-apis-batch_v1',
48
+ client_version: Google::Apis::BatchV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::BatchV1::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::BatchV1::Location]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1/{+name}', options)
74
+ command.response_representation = Google::Apis::BatchV1::Location::Representation
75
+ command.response_class = Google::Apis::BatchV1::Location
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # A filter to narrow down results to a preferred subset. The filtering language
87
+ # accepts strings like `"displayName=tokyo"`, and is documented in more detail
88
+ # in [AIP-160](https://google.aip.dev/160).
89
+ # @param [Fixnum] page_size
90
+ # The maximum number of results to return. If not set, the service selects a
91
+ # default.
92
+ # @param [String] page_token
93
+ # A page token received from the `next_page_token` field in the response. Send
94
+ # that page token to receive the subsequent page.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::BatchV1::ListLocationsResponse] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::BatchV1::ListLocationsResponse]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
114
+ command.response_representation = Google::Apis::BatchV1::ListLocationsResponse::Representation
115
+ command.response_class = Google::Apis::BatchV1::ListLocationsResponse
116
+ command.params['name'] = name unless name.nil?
117
+ command.query['filter'] = filter unless filter.nil?
118
+ command.query['pageSize'] = page_size unless page_size.nil?
119
+ command.query['pageToken'] = page_token unless page_token.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Create a Job.
126
+ # @param [String] parent
127
+ # Required. The parent resource name where the Job will be created. Pattern: "
128
+ # projects/`project`/locations/`location`"
129
+ # @param [Google::Apis::BatchV1::Job] job_object
130
+ # @param [String] job_id
131
+ # ID used to uniquely identify the Job within its parent scope. This field
132
+ # should contain at most 63 characters and must start with lowercase characters.
133
+ # Only lowercase characters, numbers and '-' are accepted. The '-' character
134
+ # cannot be the first or the last one. A system generated ID will be used if the
135
+ # field is not set. The job.name field in the request will be ignored and the
136
+ # created resource name of the Job will be "`parent`/jobs/`job_id`".
137
+ # @param [String] request_id
138
+ # Optional. An optional request ID to identify requests. Specify a unique
139
+ # request ID so that if you must retry your request, the server will know to
140
+ # ignore the request if it has already been completed. The server will guarantee
141
+ # that for at least 60 minutes since the first request. For example, consider a
142
+ # situation where you make an initial request and t he request times out. If you
143
+ # make the request again with the same request ID, the server can check if
144
+ # original operation with the same request ID was received, and if so, will
145
+ # ignore the second request. This prevents clients from accidentally creating
146
+ # duplicate commitments. The request ID must be a valid UUID with the exception
147
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
148
+ # @param [String] fields
149
+ # Selector specifying which fields to include in a partial response.
150
+ # @param [String] quota_user
151
+ # Available to use for quota purposes for server-side applications. Can be any
152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
153
+ # @param [Google::Apis::RequestOptions] options
154
+ # Request-specific options
155
+ #
156
+ # @yield [result, err] Result & error if block supplied
157
+ # @yieldparam result [Google::Apis::BatchV1::Job] parsed result object
158
+ # @yieldparam err [StandardError] error object if request failed
159
+ #
160
+ # @return [Google::Apis::BatchV1::Job]
161
+ #
162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
165
+ def create_project_location_job(parent, job_object = nil, job_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
166
+ command = make_simple_command(:post, 'v1/{+parent}/jobs', options)
167
+ command.request_representation = Google::Apis::BatchV1::Job::Representation
168
+ command.request_object = job_object
169
+ command.response_representation = Google::Apis::BatchV1::Job::Representation
170
+ command.response_class = Google::Apis::BatchV1::Job
171
+ command.params['parent'] = parent unless parent.nil?
172
+ command.query['jobId'] = job_id unless job_id.nil?
173
+ command.query['requestId'] = request_id unless request_id.nil?
174
+ command.query['fields'] = fields unless fields.nil?
175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
176
+ execute_or_queue_command(command, &block)
177
+ end
178
+
179
+ # Delete a Job.
180
+ # @param [String] name
181
+ # Job name.
182
+ # @param [String] reason
183
+ # Optional. Reason for this deletion.
184
+ # @param [String] request_id
185
+ # Optional. An optional request ID to identify requests. Specify a unique
186
+ # request ID so that if you must retry your request, the server will know to
187
+ # ignore the request if it has already been completed. The server will guarantee
188
+ # that for at least 60 minutes after the first request. For example, consider a
189
+ # situation where you make an initial request and t he request times out. If you
190
+ # make the request again with the same request ID, the server can check if
191
+ # original operation with the same request ID was received, and if so, will
192
+ # ignore the second request. This prevents clients from accidentally creating
193
+ # duplicate commitments. The request ID must be a valid UUID with the exception
194
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
195
+ # @param [String] fields
196
+ # Selector specifying which fields to include in a partial response.
197
+ # @param [String] quota_user
198
+ # Available to use for quota purposes for server-side applications. Can be any
199
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
200
+ # @param [Google::Apis::RequestOptions] options
201
+ # Request-specific options
202
+ #
203
+ # @yield [result, err] Result & error if block supplied
204
+ # @yieldparam result [Google::Apis::BatchV1::Operation] parsed result object
205
+ # @yieldparam err [StandardError] error object if request failed
206
+ #
207
+ # @return [Google::Apis::BatchV1::Operation]
208
+ #
209
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
210
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
211
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
212
+ def delete_project_location_job(name, reason: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
213
+ command = make_simple_command(:delete, 'v1/{+name}', options)
214
+ command.response_representation = Google::Apis::BatchV1::Operation::Representation
215
+ command.response_class = Google::Apis::BatchV1::Operation
216
+ command.params['name'] = name unless name.nil?
217
+ command.query['reason'] = reason unless reason.nil?
218
+ command.query['requestId'] = request_id unless request_id.nil?
219
+ command.query['fields'] = fields unless fields.nil?
220
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
221
+ execute_or_queue_command(command, &block)
222
+ end
223
+
224
+ # Get a Job specified by its resource name.
225
+ # @param [String] name
226
+ # Required. Job name.
227
+ # @param [String] fields
228
+ # Selector specifying which fields to include in a partial response.
229
+ # @param [String] quota_user
230
+ # Available to use for quota purposes for server-side applications. Can be any
231
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
232
+ # @param [Google::Apis::RequestOptions] options
233
+ # Request-specific options
234
+ #
235
+ # @yield [result, err] Result & error if block supplied
236
+ # @yieldparam result [Google::Apis::BatchV1::Job] parsed result object
237
+ # @yieldparam err [StandardError] error object if request failed
238
+ #
239
+ # @return [Google::Apis::BatchV1::Job]
240
+ #
241
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
242
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
243
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
244
+ def get_project_location_job(name, fields: nil, quota_user: nil, options: nil, &block)
245
+ command = make_simple_command(:get, 'v1/{+name}', options)
246
+ command.response_representation = Google::Apis::BatchV1::Job::Representation
247
+ command.response_class = Google::Apis::BatchV1::Job
248
+ command.params['name'] = name unless name.nil?
249
+ command.query['fields'] = fields unless fields.nil?
250
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
251
+ execute_or_queue_command(command, &block)
252
+ end
253
+
254
+ # Gets the access control policy for a resource. Returns an empty policy if the
255
+ # resource exists and does not have a policy set.
256
+ # @param [String] resource
257
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
258
+ # names](https://cloud.google.com/apis/design/resource_names) for the
259
+ # appropriate value for this field.
260
+ # @param [Fixnum] options_requested_policy_version
261
+ # Optional. The maximum policy version that will be used to format the policy.
262
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
263
+ # rejected. Requests for policies with any conditional role bindings must
264
+ # specify version 3. Policies with no conditional role bindings may specify any
265
+ # valid value or leave the field unset. The policy in the response might use the
266
+ # policy version that you specified, or it might use a lower policy version. For
267
+ # example, if you specify version 3, but the policy has no conditional role
268
+ # bindings, the response uses version 1. To learn which resources support
269
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
270
+ # google.com/iam/help/conditions/resource-policies).
271
+ # @param [String] fields
272
+ # Selector specifying which fields to include in a partial response.
273
+ # @param [String] quota_user
274
+ # Available to use for quota purposes for server-side applications. Can be any
275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
276
+ # @param [Google::Apis::RequestOptions] options
277
+ # Request-specific options
278
+ #
279
+ # @yield [result, err] Result & error if block supplied
280
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
281
+ # @yieldparam err [StandardError] error object if request failed
282
+ #
283
+ # @return [Google::Apis::BatchV1::Policy]
284
+ #
285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
288
+ def get_project_location_job_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
289
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
290
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
291
+ command.response_class = Google::Apis::BatchV1::Policy
292
+ command.params['resource'] = resource unless resource.nil?
293
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
294
+ command.query['fields'] = fields unless fields.nil?
295
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
296
+ execute_or_queue_command(command, &block)
297
+ end
298
+
299
+ # List all Jobs for a project within a region.
300
+ # @param [String] parent
301
+ # Parent path.
302
+ # @param [String] filter
303
+ # List filter.
304
+ # @param [Fixnum] page_size
305
+ # Page size.
306
+ # @param [String] page_token
307
+ # Page token.
308
+ # @param [String] fields
309
+ # Selector specifying which fields to include in a partial response.
310
+ # @param [String] quota_user
311
+ # Available to use for quota purposes for server-side applications. Can be any
312
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
313
+ # @param [Google::Apis::RequestOptions] options
314
+ # Request-specific options
315
+ #
316
+ # @yield [result, err] Result & error if block supplied
317
+ # @yieldparam result [Google::Apis::BatchV1::ListJobsResponse] parsed result object
318
+ # @yieldparam err [StandardError] error object if request failed
319
+ #
320
+ # @return [Google::Apis::BatchV1::ListJobsResponse]
321
+ #
322
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
323
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
324
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
325
+ def list_project_location_jobs(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
326
+ command = make_simple_command(:get, 'v1/{+parent}/jobs', options)
327
+ command.response_representation = Google::Apis::BatchV1::ListJobsResponse::Representation
328
+ command.response_class = Google::Apis::BatchV1::ListJobsResponse
329
+ command.params['parent'] = parent unless parent.nil?
330
+ command.query['filter'] = filter unless filter.nil?
331
+ command.query['pageSize'] = page_size unless page_size.nil?
332
+ command.query['pageToken'] = page_token unless page_token.nil?
333
+ command.query['fields'] = fields unless fields.nil?
334
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
335
+ execute_or_queue_command(command, &block)
336
+ end
337
+
338
+ # Sets the access control policy on the specified resource. Replaces any
339
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
340
+ # PERMISSION_DENIED` errors.
341
+ # @param [String] resource
342
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
343
+ # names](https://cloud.google.com/apis/design/resource_names) for the
344
+ # appropriate value for this field.
345
+ # @param [Google::Apis::BatchV1::SetIamPolicyRequest] set_iam_policy_request_object
346
+ # @param [String] fields
347
+ # Selector specifying which fields to include in a partial response.
348
+ # @param [String] quota_user
349
+ # Available to use for quota purposes for server-side applications. Can be any
350
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
351
+ # @param [Google::Apis::RequestOptions] options
352
+ # Request-specific options
353
+ #
354
+ # @yield [result, err] Result & error if block supplied
355
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
356
+ # @yieldparam err [StandardError] error object if request failed
357
+ #
358
+ # @return [Google::Apis::BatchV1::Policy]
359
+ #
360
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
361
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
362
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
363
+ def set_job_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
364
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
365
+ command.request_representation = Google::Apis::BatchV1::SetIamPolicyRequest::Representation
366
+ command.request_object = set_iam_policy_request_object
367
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
368
+ command.response_class = Google::Apis::BatchV1::Policy
369
+ command.params['resource'] = resource unless resource.nil?
370
+ command.query['fields'] = fields unless fields.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ execute_or_queue_command(command, &block)
373
+ end
374
+
375
+ # Returns permissions that a caller has on the specified resource. If the
376
+ # resource does not exist, this will return an empty set of permissions, not a `
377
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
378
+ # permission-aware UIs and command-line tools, not for authorization checking.
379
+ # This operation may "fail open" without warning.
380
+ # @param [String] resource
381
+ # REQUIRED: The resource for which the policy detail is being requested. See [
382
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
383
+ # appropriate value for this field.
384
+ # @param [Google::Apis::BatchV1::TestIamPermissionsRequest] test_iam_permissions_request_object
385
+ # @param [String] fields
386
+ # Selector specifying which fields to include in a partial response.
387
+ # @param [String] quota_user
388
+ # Available to use for quota purposes for server-side applications. Can be any
389
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
390
+ # @param [Google::Apis::RequestOptions] options
391
+ # Request-specific options
392
+ #
393
+ # @yield [result, err] Result & error if block supplied
394
+ # @yieldparam result [Google::Apis::BatchV1::TestIamPermissionsResponse] parsed result object
395
+ # @yieldparam err [StandardError] error object if request failed
396
+ #
397
+ # @return [Google::Apis::BatchV1::TestIamPermissionsResponse]
398
+ #
399
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
400
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
401
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
402
+ def test_job_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
403
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
404
+ command.request_representation = Google::Apis::BatchV1::TestIamPermissionsRequest::Representation
405
+ command.request_object = test_iam_permissions_request_object
406
+ command.response_representation = Google::Apis::BatchV1::TestIamPermissionsResponse::Representation
407
+ command.response_class = Google::Apis::BatchV1::TestIamPermissionsResponse
408
+ command.params['resource'] = resource unless resource.nil?
409
+ command.query['fields'] = fields unless fields.nil?
410
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
411
+ execute_or_queue_command(command, &block)
412
+ end
413
+
414
+ # Return a single Task.
415
+ # @param [String] name
416
+ # Required. Task name.
417
+ # @param [String] fields
418
+ # Selector specifying which fields to include in a partial response.
419
+ # @param [String] quota_user
420
+ # Available to use for quota purposes for server-side applications. Can be any
421
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
422
+ # @param [Google::Apis::RequestOptions] options
423
+ # Request-specific options
424
+ #
425
+ # @yield [result, err] Result & error if block supplied
426
+ # @yieldparam result [Google::Apis::BatchV1::Task] parsed result object
427
+ # @yieldparam err [StandardError] error object if request failed
428
+ #
429
+ # @return [Google::Apis::BatchV1::Task]
430
+ #
431
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
432
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
433
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
434
+ def get_project_location_job_task_group_task(name, fields: nil, quota_user: nil, options: nil, &block)
435
+ command = make_simple_command(:get, 'v1/{+name}', options)
436
+ command.response_representation = Google::Apis::BatchV1::Task::Representation
437
+ command.response_class = Google::Apis::BatchV1::Task
438
+ command.params['name'] = name unless name.nil?
439
+ command.query['fields'] = fields unless fields.nil?
440
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
441
+ execute_or_queue_command(command, &block)
442
+ end
443
+
444
+ # List Tasks associated with a job.
445
+ # @param [String] parent
446
+ # Required. Name of a TaskGroup from which Tasks are being requested. Pattern: "
447
+ # projects/`project`/locations/`location`/jobs/`job`/taskGroups/`task_group`"
448
+ # @param [String] filter
449
+ # Task filter, null filter matches all Tasks. Filter string should be of the
450
+ # format State=TaskStatus.State e.g. State=RUNNING
451
+ # @param [Fixnum] page_size
452
+ # Page size.
453
+ # @param [String] page_token
454
+ # Page token.
455
+ # @param [String] fields
456
+ # Selector specifying which fields to include in a partial response.
457
+ # @param [String] quota_user
458
+ # Available to use for quota purposes for server-side applications. Can be any
459
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
460
+ # @param [Google::Apis::RequestOptions] options
461
+ # Request-specific options
462
+ #
463
+ # @yield [result, err] Result & error if block supplied
464
+ # @yieldparam result [Google::Apis::BatchV1::ListTasksResponse] parsed result object
465
+ # @yieldparam err [StandardError] error object if request failed
466
+ #
467
+ # @return [Google::Apis::BatchV1::ListTasksResponse]
468
+ #
469
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
470
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
471
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
472
+ def list_project_location_job_task_group_tasks(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
473
+ command = make_simple_command(:get, 'v1/{+parent}/tasks', options)
474
+ command.response_representation = Google::Apis::BatchV1::ListTasksResponse::Representation
475
+ command.response_class = Google::Apis::BatchV1::ListTasksResponse
476
+ command.params['parent'] = parent unless parent.nil?
477
+ command.query['filter'] = filter unless filter.nil?
478
+ command.query['pageSize'] = page_size unless page_size.nil?
479
+ command.query['pageToken'] = page_token unless page_token.nil?
480
+ command.query['fields'] = fields unless fields.nil?
481
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
482
+ execute_or_queue_command(command, &block)
483
+ end
484
+
485
+ # Gets the access control policy for a resource. Returns an empty policy if the
486
+ # resource exists and does not have a policy set.
487
+ # @param [String] resource
488
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
489
+ # names](https://cloud.google.com/apis/design/resource_names) for the
490
+ # appropriate value for this field.
491
+ # @param [Fixnum] options_requested_policy_version
492
+ # Optional. The maximum policy version that will be used to format the policy.
493
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
494
+ # rejected. Requests for policies with any conditional role bindings must
495
+ # specify version 3. Policies with no conditional role bindings may specify any
496
+ # valid value or leave the field unset. The policy in the response might use the
497
+ # policy version that you specified, or it might use a lower policy version. For
498
+ # example, if you specify version 3, but the policy has no conditional role
499
+ # bindings, the response uses version 1. To learn which resources support
500
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
501
+ # google.com/iam/help/conditions/resource-policies).
502
+ # @param [String] fields
503
+ # Selector specifying which fields to include in a partial response.
504
+ # @param [String] quota_user
505
+ # Available to use for quota purposes for server-side applications. Can be any
506
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
507
+ # @param [Google::Apis::RequestOptions] options
508
+ # Request-specific options
509
+ #
510
+ # @yield [result, err] Result & error if block supplied
511
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
512
+ # @yieldparam err [StandardError] error object if request failed
513
+ #
514
+ # @return [Google::Apis::BatchV1::Policy]
515
+ #
516
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
517
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
518
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
519
+ def get_project_location_node_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
520
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
521
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
522
+ command.response_class = Google::Apis::BatchV1::Policy
523
+ command.params['resource'] = resource unless resource.nil?
524
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
525
+ command.query['fields'] = fields unless fields.nil?
526
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
527
+ execute_or_queue_command(command, &block)
528
+ end
529
+
530
+ # Sets the access control policy on the specified resource. Replaces any
531
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
532
+ # PERMISSION_DENIED` errors.
533
+ # @param [String] resource
534
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
535
+ # names](https://cloud.google.com/apis/design/resource_names) for the
536
+ # appropriate value for this field.
537
+ # @param [Google::Apis::BatchV1::SetIamPolicyRequest] set_iam_policy_request_object
538
+ # @param [String] fields
539
+ # Selector specifying which fields to include in a partial response.
540
+ # @param [String] quota_user
541
+ # Available to use for quota purposes for server-side applications. Can be any
542
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
543
+ # @param [Google::Apis::RequestOptions] options
544
+ # Request-specific options
545
+ #
546
+ # @yield [result, err] Result & error if block supplied
547
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
548
+ # @yieldparam err [StandardError] error object if request failed
549
+ #
550
+ # @return [Google::Apis::BatchV1::Policy]
551
+ #
552
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
553
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
554
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
555
+ def set_node_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
556
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
557
+ command.request_representation = Google::Apis::BatchV1::SetIamPolicyRequest::Representation
558
+ command.request_object = set_iam_policy_request_object
559
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
560
+ command.response_class = Google::Apis::BatchV1::Policy
561
+ command.params['resource'] = resource unless resource.nil?
562
+ command.query['fields'] = fields unless fields.nil?
563
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
564
+ execute_or_queue_command(command, &block)
565
+ end
566
+
567
+ # Returns permissions that a caller has on the specified resource. If the
568
+ # resource does not exist, this will return an empty set of permissions, not a `
569
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
570
+ # permission-aware UIs and command-line tools, not for authorization checking.
571
+ # This operation may "fail open" without warning.
572
+ # @param [String] resource
573
+ # REQUIRED: The resource for which the policy detail is being requested. See [
574
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
575
+ # appropriate value for this field.
576
+ # @param [Google::Apis::BatchV1::TestIamPermissionsRequest] test_iam_permissions_request_object
577
+ # @param [String] fields
578
+ # Selector specifying which fields to include in a partial response.
579
+ # @param [String] quota_user
580
+ # Available to use for quota purposes for server-side applications. Can be any
581
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
582
+ # @param [Google::Apis::RequestOptions] options
583
+ # Request-specific options
584
+ #
585
+ # @yield [result, err] Result & error if block supplied
586
+ # @yieldparam result [Google::Apis::BatchV1::TestIamPermissionsResponse] parsed result object
587
+ # @yieldparam err [StandardError] error object if request failed
588
+ #
589
+ # @return [Google::Apis::BatchV1::TestIamPermissionsResponse]
590
+ #
591
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
592
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
593
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
594
+ def test_node_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
595
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
596
+ command.request_representation = Google::Apis::BatchV1::TestIamPermissionsRequest::Representation
597
+ command.request_object = test_iam_permissions_request_object
598
+ command.response_representation = Google::Apis::BatchV1::TestIamPermissionsResponse::Representation
599
+ command.response_class = Google::Apis::BatchV1::TestIamPermissionsResponse
600
+ command.params['resource'] = resource unless resource.nil?
601
+ command.query['fields'] = fields unless fields.nil?
602
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
603
+ execute_or_queue_command(command, &block)
604
+ end
605
+
606
+ # Starts asynchronous cancellation on a long-running operation. The server makes
607
+ # a best effort to cancel the operation, but success is not guaranteed. If the
608
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
609
+ # Clients can use Operations.GetOperation or other methods to check whether the
610
+ # cancellation succeeded or whether the operation completed despite cancellation.
611
+ # On successful cancellation, the operation is not deleted; instead, it becomes
612
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
613
+ # corresponding to `Code.CANCELLED`.
614
+ # @param [String] name
615
+ # The name of the operation resource to be cancelled.
616
+ # @param [Google::Apis::BatchV1::CancelOperationRequest] cancel_operation_request_object
617
+ # @param [String] fields
618
+ # Selector specifying which fields to include in a partial response.
619
+ # @param [String] quota_user
620
+ # Available to use for quota purposes for server-side applications. Can be any
621
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
622
+ # @param [Google::Apis::RequestOptions] options
623
+ # Request-specific options
624
+ #
625
+ # @yield [result, err] Result & error if block supplied
626
+ # @yieldparam result [Google::Apis::BatchV1::Empty] parsed result object
627
+ # @yieldparam err [StandardError] error object if request failed
628
+ #
629
+ # @return [Google::Apis::BatchV1::Empty]
630
+ #
631
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
632
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
633
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
634
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
635
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
636
+ command.request_representation = Google::Apis::BatchV1::CancelOperationRequest::Representation
637
+ command.request_object = cancel_operation_request_object
638
+ command.response_representation = Google::Apis::BatchV1::Empty::Representation
639
+ command.response_class = Google::Apis::BatchV1::Empty
640
+ command.params['name'] = name unless name.nil?
641
+ command.query['fields'] = fields unless fields.nil?
642
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
643
+ execute_or_queue_command(command, &block)
644
+ end
645
+
646
+ # Deletes a long-running operation. This method indicates that the client is no
647
+ # longer interested in the operation result. It does not cancel the operation.
648
+ # If the server doesn't support this method, it returns `google.rpc.Code.
649
+ # UNIMPLEMENTED`.
650
+ # @param [String] name
651
+ # The name of the operation resource to be deleted.
652
+ # @param [String] fields
653
+ # Selector specifying which fields to include in a partial response.
654
+ # @param [String] quota_user
655
+ # Available to use for quota purposes for server-side applications. Can be any
656
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
657
+ # @param [Google::Apis::RequestOptions] options
658
+ # Request-specific options
659
+ #
660
+ # @yield [result, err] Result & error if block supplied
661
+ # @yieldparam result [Google::Apis::BatchV1::Empty] parsed result object
662
+ # @yieldparam err [StandardError] error object if request failed
663
+ #
664
+ # @return [Google::Apis::BatchV1::Empty]
665
+ #
666
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
667
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
668
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
669
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
670
+ command = make_simple_command(:delete, 'v1/{+name}', options)
671
+ command.response_representation = Google::Apis::BatchV1::Empty::Representation
672
+ command.response_class = Google::Apis::BatchV1::Empty
673
+ command.params['name'] = name unless name.nil?
674
+ command.query['fields'] = fields unless fields.nil?
675
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
676
+ execute_or_queue_command(command, &block)
677
+ end
678
+
679
+ # Gets the latest state of a long-running operation. Clients can use this method
680
+ # to poll the operation result at intervals as recommended by the API service.
681
+ # @param [String] name
682
+ # The name of the operation resource.
683
+ # @param [String] fields
684
+ # Selector specifying which fields to include in a partial response.
685
+ # @param [String] quota_user
686
+ # Available to use for quota purposes for server-side applications. Can be any
687
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
688
+ # @param [Google::Apis::RequestOptions] options
689
+ # Request-specific options
690
+ #
691
+ # @yield [result, err] Result & error if block supplied
692
+ # @yieldparam result [Google::Apis::BatchV1::Operation] parsed result object
693
+ # @yieldparam err [StandardError] error object if request failed
694
+ #
695
+ # @return [Google::Apis::BatchV1::Operation]
696
+ #
697
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
698
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
699
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
700
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
701
+ command = make_simple_command(:get, 'v1/{+name}', options)
702
+ command.response_representation = Google::Apis::BatchV1::Operation::Representation
703
+ command.response_class = Google::Apis::BatchV1::Operation
704
+ command.params['name'] = name unless name.nil?
705
+ command.query['fields'] = fields unless fields.nil?
706
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
707
+ execute_or_queue_command(command, &block)
708
+ end
709
+
710
+ # Lists operations that match the specified filter in the request. If the server
711
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
712
+ # binding allows API services to override the binding to use different resource
713
+ # name schemes, such as `users/*/operations`. To override the binding, API
714
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
715
+ # service configuration. For backwards compatibility, the default name includes
716
+ # the operations collection id, however overriding users must ensure the name
717
+ # binding is the parent resource, without the operations collection id.
718
+ # @param [String] name
719
+ # The name of the operation's parent resource.
720
+ # @param [String] filter
721
+ # The standard list filter.
722
+ # @param [Fixnum] page_size
723
+ # The standard list page size.
724
+ # @param [String] page_token
725
+ # The standard list page token.
726
+ # @param [String] fields
727
+ # Selector specifying which fields to include in a partial response.
728
+ # @param [String] quota_user
729
+ # Available to use for quota purposes for server-side applications. Can be any
730
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
731
+ # @param [Google::Apis::RequestOptions] options
732
+ # Request-specific options
733
+ #
734
+ # @yield [result, err] Result & error if block supplied
735
+ # @yieldparam result [Google::Apis::BatchV1::ListOperationsResponse] parsed result object
736
+ # @yieldparam err [StandardError] error object if request failed
737
+ #
738
+ # @return [Google::Apis::BatchV1::ListOperationsResponse]
739
+ #
740
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
741
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
742
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
743
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
744
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
745
+ command.response_representation = Google::Apis::BatchV1::ListOperationsResponse::Representation
746
+ command.response_class = Google::Apis::BatchV1::ListOperationsResponse
747
+ command.params['name'] = name unless name.nil?
748
+ command.query['filter'] = filter unless filter.nil?
749
+ command.query['pageSize'] = page_size unless page_size.nil?
750
+ command.query['pageToken'] = page_token unless page_token.nil?
751
+ command.query['fields'] = fields unless fields.nil?
752
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
753
+ execute_or_queue_command(command, &block)
754
+ end
755
+
756
+ # Report agent's state, e.g. agent status and tasks information
757
+ # @param [String] parent
758
+ # Required. Format: projects/`project`/locations/`location` `project` should be
759
+ # a project number.
760
+ # @param [Google::Apis::BatchV1::ReportAgentStateRequest] report_agent_state_request_object
761
+ # @param [String] fields
762
+ # Selector specifying which fields to include in a partial response.
763
+ # @param [String] quota_user
764
+ # Available to use for quota purposes for server-side applications. Can be any
765
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
766
+ # @param [Google::Apis::RequestOptions] options
767
+ # Request-specific options
768
+ #
769
+ # @yield [result, err] Result & error if block supplied
770
+ # @yieldparam result [Google::Apis::BatchV1::ReportAgentStateResponse] parsed result object
771
+ # @yieldparam err [StandardError] error object if request failed
772
+ #
773
+ # @return [Google::Apis::BatchV1::ReportAgentStateResponse]
774
+ #
775
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
776
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
777
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
778
+ def report_agent_state(parent, report_agent_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
779
+ command = make_simple_command(:post, 'v1/{+parent}/state:report', options)
780
+ command.request_representation = Google::Apis::BatchV1::ReportAgentStateRequest::Representation
781
+ command.request_object = report_agent_state_request_object
782
+ command.response_representation = Google::Apis::BatchV1::ReportAgentStateResponse::Representation
783
+ command.response_class = Google::Apis::BatchV1::ReportAgentStateResponse
784
+ command.params['parent'] = parent unless parent.nil?
785
+ command.query['fields'] = fields unless fields.nil?
786
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
787
+ execute_or_queue_command(command, &block)
788
+ end
789
+
790
+ # Gets the access control policy for a resource. Returns an empty policy if the
791
+ # resource exists and does not have a policy set.
792
+ # @param [String] resource
793
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
794
+ # names](https://cloud.google.com/apis/design/resource_names) for the
795
+ # appropriate value for this field.
796
+ # @param [Fixnum] options_requested_policy_version
797
+ # Optional. The maximum policy version that will be used to format the policy.
798
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
799
+ # rejected. Requests for policies with any conditional role bindings must
800
+ # specify version 3. Policies with no conditional role bindings may specify any
801
+ # valid value or leave the field unset. The policy in the response might use the
802
+ # policy version that you specified, or it might use a lower policy version. For
803
+ # example, if you specify version 3, but the policy has no conditional role
804
+ # bindings, the response uses version 1. To learn which resources support
805
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
806
+ # google.com/iam/help/conditions/resource-policies).
807
+ # @param [String] fields
808
+ # Selector specifying which fields to include in a partial response.
809
+ # @param [String] quota_user
810
+ # Available to use for quota purposes for server-side applications. Can be any
811
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
812
+ # @param [Google::Apis::RequestOptions] options
813
+ # Request-specific options
814
+ #
815
+ # @yield [result, err] Result & error if block supplied
816
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
817
+ # @yieldparam err [StandardError] error object if request failed
818
+ #
819
+ # @return [Google::Apis::BatchV1::Policy]
820
+ #
821
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
822
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
823
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
824
+ def get_project_location_task_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
825
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
826
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
827
+ command.response_class = Google::Apis::BatchV1::Policy
828
+ command.params['resource'] = resource unless resource.nil?
829
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
830
+ command.query['fields'] = fields unless fields.nil?
831
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
832
+ execute_or_queue_command(command, &block)
833
+ end
834
+
835
+ # Sets the access control policy on the specified resource. Replaces any
836
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
837
+ # PERMISSION_DENIED` errors.
838
+ # @param [String] resource
839
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
840
+ # names](https://cloud.google.com/apis/design/resource_names) for the
841
+ # appropriate value for this field.
842
+ # @param [Google::Apis::BatchV1::SetIamPolicyRequest] set_iam_policy_request_object
843
+ # @param [String] fields
844
+ # Selector specifying which fields to include in a partial response.
845
+ # @param [String] quota_user
846
+ # Available to use for quota purposes for server-side applications. Can be any
847
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
848
+ # @param [Google::Apis::RequestOptions] options
849
+ # Request-specific options
850
+ #
851
+ # @yield [result, err] Result & error if block supplied
852
+ # @yieldparam result [Google::Apis::BatchV1::Policy] parsed result object
853
+ # @yieldparam err [StandardError] error object if request failed
854
+ #
855
+ # @return [Google::Apis::BatchV1::Policy]
856
+ #
857
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
858
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
859
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
860
+ def set_task_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
861
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
862
+ command.request_representation = Google::Apis::BatchV1::SetIamPolicyRequest::Representation
863
+ command.request_object = set_iam_policy_request_object
864
+ command.response_representation = Google::Apis::BatchV1::Policy::Representation
865
+ command.response_class = Google::Apis::BatchV1::Policy
866
+ command.params['resource'] = resource unless resource.nil?
867
+ command.query['fields'] = fields unless fields.nil?
868
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
869
+ execute_or_queue_command(command, &block)
870
+ end
871
+
872
+ # Returns permissions that a caller has on the specified resource. If the
873
+ # resource does not exist, this will return an empty set of permissions, not a `
874
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
875
+ # permission-aware UIs and command-line tools, not for authorization checking.
876
+ # This operation may "fail open" without warning.
877
+ # @param [String] resource
878
+ # REQUIRED: The resource for which the policy detail is being requested. See [
879
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
880
+ # appropriate value for this field.
881
+ # @param [Google::Apis::BatchV1::TestIamPermissionsRequest] test_iam_permissions_request_object
882
+ # @param [String] fields
883
+ # Selector specifying which fields to include in a partial response.
884
+ # @param [String] quota_user
885
+ # Available to use for quota purposes for server-side applications. Can be any
886
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
887
+ # @param [Google::Apis::RequestOptions] options
888
+ # Request-specific options
889
+ #
890
+ # @yield [result, err] Result & error if block supplied
891
+ # @yieldparam result [Google::Apis::BatchV1::TestIamPermissionsResponse] parsed result object
892
+ # @yieldparam err [StandardError] error object if request failed
893
+ #
894
+ # @return [Google::Apis::BatchV1::TestIamPermissionsResponse]
895
+ #
896
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
897
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
898
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
899
+ def test_task_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
900
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
901
+ command.request_representation = Google::Apis::BatchV1::TestIamPermissionsRequest::Representation
902
+ command.request_object = test_iam_permissions_request_object
903
+ command.response_representation = Google::Apis::BatchV1::TestIamPermissionsResponse::Representation
904
+ command.response_class = Google::Apis::BatchV1::TestIamPermissionsResponse
905
+ command.params['resource'] = resource unless resource.nil?
906
+ command.query['fields'] = fields unless fields.nil?
907
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
908
+ execute_or_queue_command(command, &block)
909
+ end
910
+
911
+ protected
912
+
913
+ def apply_command_defaults(command)
914
+ command.query['key'] = key unless key.nil?
915
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
916
+ end
917
+ end
918
+ end
919
+ end
920
+ end