google-cloud-dataproc-v1 0.16.0 → 0.17.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb +711 -0
  4. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb +382 -0
  5. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb +54 -0
  6. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service.rb +6 -0
  7. data/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb +640 -0
  8. data/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb +820 -0
  9. data/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb +285 -0
  10. data/lib/google/cloud/dataproc/v1/batch_controller/rest.rb +54 -0
  11. data/lib/google/cloud/dataproc/v1/batch_controller.rb +6 -0
  12. data/lib/google/cloud/dataproc/v1/bindings_override.rb +257 -0
  13. data/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb +1117 -0
  14. data/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb +820 -0
  15. data/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb +539 -0
  16. data/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb +55 -0
  17. data/lib/google/cloud/dataproc/v1/cluster_controller.rb +6 -0
  18. data/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb +929 -0
  19. data/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb +820 -0
  20. data/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb +476 -0
  21. data/lib/google/cloud/dataproc/v1/job_controller/rest.rb +53 -0
  22. data/lib/google/cloud/dataproc/v1/job_controller.rb +6 -0
  23. data/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb +581 -0
  24. data/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb +820 -0
  25. data/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb +227 -0
  26. data/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb +55 -0
  27. data/lib/google/cloud/dataproc/v1/node_group_controller.rb +6 -0
  28. data/lib/google/cloud/dataproc/v1/rest.rb +43 -0
  29. data/lib/google/cloud/dataproc/v1/version.rb +1 -1
  30. data/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb +983 -0
  31. data/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb +820 -0
  32. data/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb +518 -0
  33. data/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb +55 -0
  34. data/lib/google/cloud/dataproc/v1/workflow_template_service.rb +6 -0
  35. data/lib/google/cloud/dataproc/v1.rb +5 -0
  36. metadata +30 -5
@@ -0,0 +1,640 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/dataproc/v1/batches_pb"
21
+ require "google/cloud/dataproc/v1/batch_controller/rest/service_stub"
22
+ require "google/iam/v1/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dataproc
27
+ module V1
28
+ module BatchController
29
+ module Rest
30
+ ##
31
+ # REST client for the BatchController service.
32
+ #
33
+ # The BatchController provides methods to manage batch workloads.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :batch_controller_stub
40
+
41
+ ##
42
+ # Configure the BatchController Client class.
43
+ #
44
+ # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all BatchController clients
50
+ # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "Dataproc", "V1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config
71
+ end
72
+ yield @configure if block_given?
73
+ @configure
74
+ end
75
+
76
+ ##
77
+ # Configure the BatchController Client instance.
78
+ #
79
+ # The configuration is set to the derived mode, meaning that values can be changed,
80
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
81
+ # should be made on {Client.configure}.
82
+ #
83
+ # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration}
84
+ # for a description of the configuration fields.
85
+ #
86
+ # @yield [config] Configure the Client client.
87
+ # @yieldparam config [Client::Configuration]
88
+ #
89
+ # @return [Client::Configuration]
90
+ #
91
+ def configure
92
+ yield @config if block_given?
93
+ @config
94
+ end
95
+
96
+ ##
97
+ # Create a new BatchController REST client object.
98
+ #
99
+ # @example
100
+ #
101
+ # # Create a client using the default configuration
102
+ # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new
103
+ #
104
+ # # Create a client using a custom configuration
105
+ # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the BatchController client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ def initialize
113
+ # Create the configuration object
114
+ @config = Configuration.new Client.configure
115
+
116
+ # Yield the configuration if needed
117
+ yield @config if block_given?
118
+
119
+ # Create credentials
120
+ credentials = @config.credentials
121
+ # Use self-signed JWT if the endpoint is unchanged from default,
122
+ # but only if the default endpoint does not have a region prefix.
123
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
124
+ !@config.endpoint.split(".").first.include?("-")
125
+ credentials ||= Credentials.default scope: @config.scope,
126
+ enable_self_signed_jwt: enable_self_signed_jwt
127
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
128
+ credentials = Credentials.new credentials, scope: @config.scope
129
+ end
130
+
131
+ @quota_project_id = @config.quota_project
132
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
133
+
134
+ @operations_client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations.new do |config|
135
+ config.credentials = credentials
136
+ config.quota_project = @quota_project_id
137
+ config.endpoint = @config.endpoint
138
+ end
139
+
140
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ config.bindings_override = @config.bindings_override
145
+ end
146
+
147
+ @batch_controller_stub = ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ end
149
+
150
+ ##
151
+ # Get the associated client for long-running operations.
152
+ #
153
+ # @return [::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations]
154
+ #
155
+ attr_reader :operations_client
156
+
157
+ ##
158
+ # Get the associated client for mix-in of the IAMPolicy.
159
+ #
160
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
161
+ #
162
+ attr_reader :iam_policy_client
163
+
164
+ # Service calls
165
+
166
+ ##
167
+ # Creates a batch workload that executes asynchronously.
168
+ #
169
+ # @overload create_batch(request, options = nil)
170
+ # Pass arguments to `create_batch` via a request object, either of type
171
+ # {::Google::Cloud::Dataproc::V1::CreateBatchRequest} or an equivalent Hash.
172
+ #
173
+ # @param request [::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Hash]
174
+ # A request object representing the call parameters. Required. To specify no
175
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
176
+ # @param options [::Gapic::CallOptions, ::Hash]
177
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
178
+ #
179
+ # @overload create_batch(parent: nil, batch: nil, batch_id: nil, request_id: nil)
180
+ # Pass arguments to `create_batch` via keyword arguments. Note that at
181
+ # least one keyword argument is required. To specify no parameters, or to keep all
182
+ # the default parameter values, pass an empty Hash as a request object (see above).
183
+ #
184
+ # @param parent [::String]
185
+ # Required. The parent resource where this batch will be created.
186
+ # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash]
187
+ # Required. The batch to create.
188
+ # @param batch_id [::String]
189
+ # Optional. The ID to use for the batch, which will become the final
190
+ # component of the batch's resource name.
191
+ #
192
+ # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`.
193
+ # @param request_id [::String]
194
+ # Optional. A unique ID used to identify the request. If the service
195
+ # receives two
196
+ # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s
197
+ # with the same request_id, the second request is ignored and the
198
+ # Operation that corresponds to the first Batch created and stored
199
+ # in the backend is returned.
200
+ #
201
+ # Recommendation: Set this value to a
202
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
203
+ #
204
+ # The value must contain only letters (a-z, A-Z), numbers (0-9),
205
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
206
+ # @yield [result, operation] Access the result along with the TransportOperation object
207
+ # @yieldparam result [::Gapic::Operation]
208
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
209
+ #
210
+ # @return [::Gapic::Operation]
211
+ #
212
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
213
+ def create_batch request, options = nil
214
+ raise ::ArgumentError, "request must be provided" if request.nil?
215
+
216
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest
217
+
218
+ # Converts hash and nil to an options object
219
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
220
+
221
+ # Customize the options with defaults
222
+ call_metadata = @config.rpcs.create_batch.metadata.to_h
223
+
224
+ # Set x-goog-api-client and x-goog-user-project headers
225
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
226
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
227
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
228
+ transports_version_send: [:rest]
229
+
230
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
+
232
+ options.apply_defaults timeout: @config.rpcs.create_batch.timeout,
233
+ metadata: call_metadata,
234
+ retry_policy: @config.rpcs.create_batch.retry_policy
235
+
236
+ options.apply_defaults timeout: @config.timeout,
237
+ metadata: @config.metadata,
238
+ retry_policy: @config.retry_policy
239
+
240
+ @batch_controller_stub.create_batch request, options do |result, operation|
241
+ result = ::Gapic::Operation.new result, @operations_client, options: options
242
+ yield result, operation if block_given?
243
+ return result
244
+ end
245
+ rescue ::Gapic::Rest::Error => e
246
+ raise ::Google::Cloud::Error.from_error(e)
247
+ end
248
+
249
+ ##
250
+ # Gets the batch workload resource representation.
251
+ #
252
+ # @overload get_batch(request, options = nil)
253
+ # Pass arguments to `get_batch` via a request object, either of type
254
+ # {::Google::Cloud::Dataproc::V1::GetBatchRequest} or an equivalent Hash.
255
+ #
256
+ # @param request [::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Hash]
257
+ # A request object representing the call parameters. Required. To specify no
258
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
259
+ # @param options [::Gapic::CallOptions, ::Hash]
260
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
261
+ #
262
+ # @overload get_batch(name: nil)
263
+ # Pass arguments to `get_batch` via keyword arguments. Note that at
264
+ # least one keyword argument is required. To specify no parameters, or to keep all
265
+ # the default parameter values, pass an empty Hash as a request object (see above).
266
+ #
267
+ # @param name [::String]
268
+ # Required. The fully qualified name of the batch to retrieve
269
+ # in the format
270
+ # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
271
+ # @yield [result, operation] Access the result along with the TransportOperation object
272
+ # @yieldparam result [::Google::Cloud::Dataproc::V1::Batch]
273
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
274
+ #
275
+ # @return [::Google::Cloud::Dataproc::V1::Batch]
276
+ #
277
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
278
+ def get_batch request, options = nil
279
+ raise ::ArgumentError, "request must be provided" if request.nil?
280
+
281
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest
282
+
283
+ # Converts hash and nil to an options object
284
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
285
+
286
+ # Customize the options with defaults
287
+ call_metadata = @config.rpcs.get_batch.metadata.to_h
288
+
289
+ # Set x-goog-api-client and x-goog-user-project headers
290
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
291
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
292
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
293
+ transports_version_send: [:rest]
294
+
295
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
296
+
297
+ options.apply_defaults timeout: @config.rpcs.get_batch.timeout,
298
+ metadata: call_metadata,
299
+ retry_policy: @config.rpcs.get_batch.retry_policy
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
303
+ retry_policy: @config.retry_policy
304
+
305
+ @batch_controller_stub.get_batch request, options do |result, operation|
306
+ yield result, operation if block_given?
307
+ return result
308
+ end
309
+ rescue ::Gapic::Rest::Error => e
310
+ raise ::Google::Cloud::Error.from_error(e)
311
+ end
312
+
313
+ ##
314
+ # Lists batch workloads.
315
+ #
316
+ # @overload list_batches(request, options = nil)
317
+ # Pass arguments to `list_batches` via a request object, either of type
318
+ # {::Google::Cloud::Dataproc::V1::ListBatchesRequest} or an equivalent Hash.
319
+ #
320
+ # @param request [::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Hash]
321
+ # A request object representing the call parameters. Required. To specify no
322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
323
+ # @param options [::Gapic::CallOptions, ::Hash]
324
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
325
+ #
326
+ # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
327
+ # Pass arguments to `list_batches` via keyword arguments. Note that at
328
+ # least one keyword argument is required. To specify no parameters, or to keep all
329
+ # the default parameter values, pass an empty Hash as a request object (see above).
330
+ #
331
+ # @param parent [::String]
332
+ # Required. The parent, which owns this collection of batches.
333
+ # @param page_size [::Integer]
334
+ # Optional. The maximum number of batches to return in each response.
335
+ # The service may return fewer than this value.
336
+ # The default page size is 20; the maximum page size is 1000.
337
+ # @param page_token [::String]
338
+ # Optional. A page token received from a previous `ListBatches` call.
339
+ # Provide this token to retrieve the subsequent page.
340
+ # @param filter [::String]
341
+ # Optional. A filter for the batches to return in the response.
342
+ #
343
+ # A filter is a logical expression constraining the values of various fields
344
+ # in each batch resource. Filters are case sensitive, and may contain
345
+ # multiple clauses combined with logical operators (AND/OR).
346
+ # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`.
347
+ #
348
+ # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"`
349
+ # filters for batches in state RUNNING that were created before 2023-01-01
350
+ #
351
+ # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed
352
+ # description of the filter syntax and a list of supported comparisons.
353
+ # @param order_by [::String]
354
+ # Optional. Field(s) on which to sort the list of batches.
355
+ #
356
+ # Currently the only supported sort orders are unspecified (empty) and
357
+ # `create_time desc` to sort by most recently created batches first.
358
+ #
359
+ # See https://google.aip.dev/132#ordering for more details.
360
+ # @yield [result, operation] Access the result along with the TransportOperation object
361
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>]
362
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
363
+ #
364
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>]
365
+ #
366
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
367
+ def list_batches request, options = nil
368
+ raise ::ArgumentError, "request must be provided" if request.nil?
369
+
370
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest
371
+
372
+ # Converts hash and nil to an options object
373
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
374
+
375
+ # Customize the options with defaults
376
+ call_metadata = @config.rpcs.list_batches.metadata.to_h
377
+
378
+ # Set x-goog-api-client and x-goog-user-project headers
379
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
380
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
381
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
382
+ transports_version_send: [:rest]
383
+
384
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
385
+
386
+ options.apply_defaults timeout: @config.rpcs.list_batches.timeout,
387
+ metadata: call_metadata,
388
+ retry_policy: @config.rpcs.list_batches.retry_policy
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata,
392
+ retry_policy: @config.retry_policy
393
+
394
+ @batch_controller_stub.list_batches request, options do |result, operation|
395
+ result = ::Gapic::Rest::PagedEnumerable.new @batch_controller_stub, :list_batches, "batches", request, result, options
396
+ yield result, operation if block_given?
397
+ return result
398
+ end
399
+ rescue ::Gapic::Rest::Error => e
400
+ raise ::Google::Cloud::Error.from_error(e)
401
+ end
402
+
403
+ ##
404
+ # Deletes the batch workload resource. If the batch is not in terminal state,
405
+ # the delete fails and the response returns `FAILED_PRECONDITION`.
406
+ #
407
+ # @overload delete_batch(request, options = nil)
408
+ # Pass arguments to `delete_batch` via a request object, either of type
409
+ # {::Google::Cloud::Dataproc::V1::DeleteBatchRequest} or an equivalent Hash.
410
+ #
411
+ # @param request [::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Hash]
412
+ # A request object representing the call parameters. Required. To specify no
413
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
414
+ # @param options [::Gapic::CallOptions, ::Hash]
415
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
416
+ #
417
+ # @overload delete_batch(name: nil)
418
+ # Pass arguments to `delete_batch` via keyword arguments. Note that at
419
+ # least one keyword argument is required. To specify no parameters, or to keep all
420
+ # the default parameter values, pass an empty Hash as a request object (see above).
421
+ #
422
+ # @param name [::String]
423
+ # Required. The fully qualified name of the batch to retrieve
424
+ # in the format
425
+ # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
426
+ # @yield [result, operation] Access the result along with the TransportOperation object
427
+ # @yieldparam result [::Google::Protobuf::Empty]
428
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
429
+ #
430
+ # @return [::Google::Protobuf::Empty]
431
+ #
432
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
433
+ def delete_batch request, options = nil
434
+ raise ::ArgumentError, "request must be provided" if request.nil?
435
+
436
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest
437
+
438
+ # Converts hash and nil to an options object
439
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
440
+
441
+ # Customize the options with defaults
442
+ call_metadata = @config.rpcs.delete_batch.metadata.to_h
443
+
444
+ # Set x-goog-api-client and x-goog-user-project headers
445
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
446
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
447
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
448
+ transports_version_send: [:rest]
449
+
450
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
451
+
452
+ options.apply_defaults timeout: @config.rpcs.delete_batch.timeout,
453
+ metadata: call_metadata,
454
+ retry_policy: @config.rpcs.delete_batch.retry_policy
455
+
456
+ options.apply_defaults timeout: @config.timeout,
457
+ metadata: @config.metadata,
458
+ retry_policy: @config.retry_policy
459
+
460
+ @batch_controller_stub.delete_batch request, options do |result, operation|
461
+ yield result, operation if block_given?
462
+ return result
463
+ end
464
+ rescue ::Gapic::Rest::Error => e
465
+ raise ::Google::Cloud::Error.from_error(e)
466
+ end
467
+
468
+ ##
469
+ # Configuration class for the BatchController REST API.
470
+ #
471
+ # This class represents the configuration for BatchController REST,
472
+ # providing control over timeouts, retry behavior, logging, transport
473
+ # parameters, and other low-level controls. Certain parameters can also be
474
+ # applied individually to specific RPCs. See
475
+ # {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration::Rpcs}
476
+ # for a list of RPCs that can be configured independently.
477
+ #
478
+ # Configuration can be applied globally to all clients, or to a single client
479
+ # on construction.
480
+ #
481
+ # @example
482
+ #
483
+ # # Modify the global config, setting the timeout for
484
+ # # create_batch to 20 seconds,
485
+ # # and all remaining timeouts to 10 seconds.
486
+ # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config|
487
+ # config.timeout = 10.0
488
+ # config.rpcs.create_batch.timeout = 20.0
489
+ # end
490
+ #
491
+ # # Apply the above configuration only to a new client.
492
+ # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config|
493
+ # config.timeout = 10.0
494
+ # config.rpcs.create_batch.timeout = 20.0
495
+ # end
496
+ #
497
+ # @!attribute [rw] endpoint
498
+ # The hostname or hostname:port of the service endpoint.
499
+ # Defaults to `"dataproc.googleapis.com"`.
500
+ # @return [::String]
501
+ # @!attribute [rw] credentials
502
+ # Credentials to send with calls. You may provide any of the following types:
503
+ # * (`String`) The path to a service account key file in JSON format
504
+ # * (`Hash`) A service account key as a Hash
505
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
506
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
507
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
508
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
509
+ # * (`nil`) indicating no credentials
510
+ # @return [::Object]
511
+ # @!attribute [rw] scope
512
+ # The OAuth scopes
513
+ # @return [::Array<::String>]
514
+ # @!attribute [rw] lib_name
515
+ # The library name as recorded in instrumentation and logging
516
+ # @return [::String]
517
+ # @!attribute [rw] lib_version
518
+ # The library version as recorded in instrumentation and logging
519
+ # @return [::String]
520
+ # @!attribute [rw] timeout
521
+ # The call timeout in seconds.
522
+ # @return [::Numeric]
523
+ # @!attribute [rw] metadata
524
+ # Additional headers to be sent with the call.
525
+ # @return [::Hash{::Symbol=>::String}]
526
+ # @!attribute [rw] retry_policy
527
+ # The retry policy. The value is a hash with the following keys:
528
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
529
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
530
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
531
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
532
+ # trigger a retry.
533
+ # @return [::Hash]
534
+ # @!attribute [rw] quota_project
535
+ # A separate project against which to charge quota.
536
+ # @return [::String]
537
+ #
538
+ class Configuration
539
+ extend ::Gapic::Config
540
+
541
+ config_attr :endpoint, "dataproc.googleapis.com", ::String
542
+ config_attr :credentials, nil do |value|
543
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
544
+ allowed.any? { |klass| klass === value }
545
+ end
546
+ config_attr :scope, nil, ::String, ::Array, nil
547
+ config_attr :lib_name, nil, ::String, nil
548
+ config_attr :lib_version, nil, ::String, nil
549
+ config_attr :timeout, nil, ::Numeric, nil
550
+ config_attr :metadata, nil, ::Hash, nil
551
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
552
+ config_attr :quota_project, nil, ::String, nil
553
+
554
+ # @private
555
+ # Overrides for http bindings for the RPCs of this service
556
+ # are only used when this service is used as mixin, and only
557
+ # by the host service.
558
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
559
+ config_attr :bindings_override, {}, ::Hash, nil
560
+
561
+ # @private
562
+ def initialize parent_config = nil
563
+ @parent_config = parent_config unless parent_config.nil?
564
+
565
+ yield self if block_given?
566
+ end
567
+
568
+ ##
569
+ # Configurations for individual RPCs
570
+ # @return [Rpcs]
571
+ #
572
+ def rpcs
573
+ @rpcs ||= begin
574
+ parent_rpcs = nil
575
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
576
+ Rpcs.new parent_rpcs
577
+ end
578
+ end
579
+
580
+ ##
581
+ # Configuration RPC class for the BatchController API.
582
+ #
583
+ # Includes fields providing the configuration for each RPC in this service.
584
+ # Each configuration object is of type `Gapic::Config::Method` and includes
585
+ # the following configuration fields:
586
+ #
587
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
588
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
589
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
590
+ # include the following keys:
591
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
592
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
593
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
594
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
595
+ # trigger a retry.
596
+ #
597
+ class Rpcs
598
+ ##
599
+ # RPC-specific configuration for `create_batch`
600
+ # @return [::Gapic::Config::Method]
601
+ #
602
+ attr_reader :create_batch
603
+ ##
604
+ # RPC-specific configuration for `get_batch`
605
+ # @return [::Gapic::Config::Method]
606
+ #
607
+ attr_reader :get_batch
608
+ ##
609
+ # RPC-specific configuration for `list_batches`
610
+ # @return [::Gapic::Config::Method]
611
+ #
612
+ attr_reader :list_batches
613
+ ##
614
+ # RPC-specific configuration for `delete_batch`
615
+ # @return [::Gapic::Config::Method]
616
+ #
617
+ attr_reader :delete_batch
618
+
619
+ # @private
620
+ def initialize parent_rpcs = nil
621
+ create_batch_config = parent_rpcs.create_batch if parent_rpcs.respond_to? :create_batch
622
+ @create_batch = ::Gapic::Config::Method.new create_batch_config
623
+ get_batch_config = parent_rpcs.get_batch if parent_rpcs.respond_to? :get_batch
624
+ @get_batch = ::Gapic::Config::Method.new get_batch_config
625
+ list_batches_config = parent_rpcs.list_batches if parent_rpcs.respond_to? :list_batches
626
+ @list_batches = ::Gapic::Config::Method.new list_batches_config
627
+ delete_batch_config = parent_rpcs.delete_batch if parent_rpcs.respond_to? :delete_batch
628
+ @delete_batch = ::Gapic::Config::Method.new delete_batch_config
629
+
630
+ yield self if block_given?
631
+ end
632
+ end
633
+ end
634
+ end
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end
640
+ end