google-cloud-dataproc-v1 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
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,581 @@
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/node_groups_pb"
21
+ require "google/cloud/dataproc/v1/node_group_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 NodeGroupController
29
+ module Rest
30
+ ##
31
+ # REST client for the NodeGroupController service.
32
+ #
33
+ # The `NodeGroupControllerService` provides methods to manage node groups
34
+ # of Compute Engine managed instances.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :node_group_controller_stub
41
+
42
+ ##
43
+ # Configure the NodeGroupController Client class.
44
+ #
45
+ # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all NodeGroupController clients
51
+ # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Dataproc", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the NodeGroupController Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # Create a new NodeGroupController REST client object.
99
+ #
100
+ # @example
101
+ #
102
+ # # Create a client using the default configuration
103
+ # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new
104
+ #
105
+ # # Create a client using a custom configuration
106
+ # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config|
107
+ # config.timeout = 10.0
108
+ # end
109
+ #
110
+ # @yield [config] Configure the NodeGroupController client.
111
+ # @yieldparam config [Client::Configuration]
112
+ #
113
+ def initialize
114
+ # Create the configuration object
115
+ @config = Configuration.new Client.configure
116
+
117
+ # Yield the configuration if needed
118
+ yield @config if block_given?
119
+
120
+ # Create credentials
121
+ credentials = @config.credentials
122
+ # Use self-signed JWT if the endpoint is unchanged from default,
123
+ # but only if the default endpoint does not have a region prefix.
124
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
125
+ !@config.endpoint.split(".").first.include?("-")
126
+ credentials ||= Credentials.default scope: @config.scope,
127
+ enable_self_signed_jwt: enable_self_signed_jwt
128
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
129
+ credentials = Credentials.new credentials, scope: @config.scope
130
+ end
131
+
132
+ @quota_project_id = @config.quota_project
133
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
134
+
135
+ @operations_client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations.new do |config|
136
+ config.credentials = credentials
137
+ config.quota_project = @quota_project_id
138
+ config.endpoint = @config.endpoint
139
+ end
140
+
141
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
142
+ config.credentials = credentials
143
+ config.quota_project = @quota_project_id
144
+ config.endpoint = @config.endpoint
145
+ config.bindings_override = @config.bindings_override
146
+ end
147
+
148
+ @node_group_controller_stub = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
149
+ end
150
+
151
+ ##
152
+ # Get the associated client for long-running operations.
153
+ #
154
+ # @return [::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations]
155
+ #
156
+ attr_reader :operations_client
157
+
158
+ ##
159
+ # Get the associated client for mix-in of the IAMPolicy.
160
+ #
161
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
162
+ #
163
+ attr_reader :iam_policy_client
164
+
165
+ # Service calls
166
+
167
+ ##
168
+ # Creates a node group in a cluster. The returned
169
+ # {::Google::Longrunning::Operation#metadata Operation.metadata} is
170
+ # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
171
+ #
172
+ # @overload create_node_group(request, options = nil)
173
+ # Pass arguments to `create_node_group` via a request object, either of type
174
+ # {::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
181
+ #
182
+ # @overload create_node_group(parent: nil, node_group: nil, node_group_id: nil, request_id: nil)
183
+ # Pass arguments to `create_node_group` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param parent [::String]
188
+ # Required. The parent resource where this node group will be created.
189
+ # Format: `projects/{project}/regions/{region}/clusters/{cluster}`
190
+ # @param node_group [::Google::Cloud::Dataproc::V1::NodeGroup, ::Hash]
191
+ # Required. The node group to create.
192
+ # @param node_group_id [::String]
193
+ # Optional. An optional node group ID. Generated if not specified.
194
+ #
195
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
196
+ # underscores (_), and hyphens (-). Cannot begin or end with underscore
197
+ # or hyphen. Must consist of from 3 to 33 characters.
198
+ # @param request_id [::String]
199
+ # Optional. A unique ID used to identify the request. If the server receives
200
+ # two
201
+ # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests)
202
+ # with the same ID, the second request is ignored and the
203
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created
204
+ # and stored in the backend is returned.
205
+ #
206
+ # Recommendation: Set this value to a
207
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
208
+ #
209
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
210
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
211
+ # @yield [result, operation] Access the result along with the TransportOperation object
212
+ # @yieldparam result [::Gapic::Operation]
213
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
214
+ #
215
+ # @return [::Gapic::Operation]
216
+ #
217
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
218
+ def create_node_group request, options = nil
219
+ raise ::ArgumentError, "request must be provided" if request.nil?
220
+
221
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest
222
+
223
+ # Converts hash and nil to an options object
224
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
225
+
226
+ # Customize the options with defaults
227
+ call_metadata = @config.rpcs.create_node_group.metadata.to_h
228
+
229
+ # Set x-goog-api-client and x-goog-user-project headers
230
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
231
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
232
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
233
+ transports_version_send: [:rest]
234
+
235
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
236
+
237
+ options.apply_defaults timeout: @config.rpcs.create_node_group.timeout,
238
+ metadata: call_metadata,
239
+ retry_policy: @config.rpcs.create_node_group.retry_policy
240
+
241
+ options.apply_defaults timeout: @config.timeout,
242
+ metadata: @config.metadata,
243
+ retry_policy: @config.retry_policy
244
+
245
+ @node_group_controller_stub.create_node_group request, options do |result, operation|
246
+ result = ::Gapic::Operation.new result, @operations_client, options: options
247
+ yield result, operation if block_given?
248
+ return result
249
+ end
250
+ rescue ::Gapic::Rest::Error => e
251
+ raise ::Google::Cloud::Error.from_error(e)
252
+ end
253
+
254
+ ##
255
+ # Resizes a node group in a cluster. The returned
256
+ # {::Google::Longrunning::Operation#metadata Operation.metadata} is
257
+ # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
258
+ #
259
+ # @overload resize_node_group(request, options = nil)
260
+ # Pass arguments to `resize_node_group` via a request object, either of type
261
+ # {::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest} or an equivalent Hash.
262
+ #
263
+ # @param request [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Hash]
264
+ # A request object representing the call parameters. Required. To specify no
265
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
266
+ # @param options [::Gapic::CallOptions, ::Hash]
267
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
268
+ #
269
+ # @overload resize_node_group(name: nil, size: nil, request_id: nil, graceful_decommission_timeout: nil)
270
+ # Pass arguments to `resize_node_group` via keyword arguments. Note that at
271
+ # least one keyword argument is required. To specify no parameters, or to keep all
272
+ # the default parameter values, pass an empty Hash as a request object (see above).
273
+ #
274
+ # @param name [::String]
275
+ # Required. The name of the node group to resize.
276
+ # Format:
277
+ # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
278
+ # @param size [::Integer]
279
+ # Required. The number of running instances for the node group to maintain.
280
+ # The group adds or removes instances to maintain the number of instances
281
+ # specified by this parameter.
282
+ # @param request_id [::String]
283
+ # Optional. A unique ID used to identify the request. If the server receives
284
+ # two
285
+ # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests)
286
+ # with the same ID, the second request is ignored and the
287
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created
288
+ # and stored in the backend is returned.
289
+ #
290
+ # Recommendation: Set this value to a
291
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
292
+ #
293
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
294
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
295
+ # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash]
296
+ # Optional. Timeout for graceful YARN decomissioning. [Graceful
297
+ # decommissioning]
298
+ # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning)
299
+ # allows the removal of nodes from the Compute Engine node group
300
+ # without interrupting jobs in progress. This timeout specifies how long to
301
+ # wait for jobs in progress to finish before forcefully removing nodes (and
302
+ # potentially interrupting jobs). Default timeout is 0 (for forceful
303
+ # decommission), and the maximum allowed timeout is 1 day. (see JSON
304
+ # representation of
305
+ # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
306
+ #
307
+ # Only supported on Dataproc image versions 1.2 and higher.
308
+ # @yield [result, operation] Access the result along with the TransportOperation object
309
+ # @yieldparam result [::Gapic::Operation]
310
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
311
+ #
312
+ # @return [::Gapic::Operation]
313
+ #
314
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
315
+ def resize_node_group request, options = nil
316
+ raise ::ArgumentError, "request must be provided" if request.nil?
317
+
318
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest
319
+
320
+ # Converts hash and nil to an options object
321
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
322
+
323
+ # Customize the options with defaults
324
+ call_metadata = @config.rpcs.resize_node_group.metadata.to_h
325
+
326
+ # Set x-goog-api-client and x-goog-user-project headers
327
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
328
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
329
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
330
+ transports_version_send: [:rest]
331
+
332
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
333
+
334
+ options.apply_defaults timeout: @config.rpcs.resize_node_group.timeout,
335
+ metadata: call_metadata,
336
+ retry_policy: @config.rpcs.resize_node_group.retry_policy
337
+
338
+ options.apply_defaults timeout: @config.timeout,
339
+ metadata: @config.metadata,
340
+ retry_policy: @config.retry_policy
341
+
342
+ @node_group_controller_stub.resize_node_group request, options do |result, operation|
343
+ result = ::Gapic::Operation.new result, @operations_client, options: options
344
+ yield result, operation if block_given?
345
+ return result
346
+ end
347
+ rescue ::Gapic::Rest::Error => e
348
+ raise ::Google::Cloud::Error.from_error(e)
349
+ end
350
+
351
+ ##
352
+ # Gets the resource representation for a node group in a
353
+ # cluster.
354
+ #
355
+ # @overload get_node_group(request, options = nil)
356
+ # Pass arguments to `get_node_group` via a request object, either of type
357
+ # {::Google::Cloud::Dataproc::V1::GetNodeGroupRequest} or an equivalent Hash.
358
+ #
359
+ # @param request [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Hash]
360
+ # A request object representing the call parameters. Required. To specify no
361
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
362
+ # @param options [::Gapic::CallOptions, ::Hash]
363
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
364
+ #
365
+ # @overload get_node_group(name: nil)
366
+ # Pass arguments to `get_node_group` via keyword arguments. Note that at
367
+ # least one keyword argument is required. To specify no parameters, or to keep all
368
+ # the default parameter values, pass an empty Hash as a request object (see above).
369
+ #
370
+ # @param name [::String]
371
+ # Required. The name of the node group to retrieve.
372
+ # Format:
373
+ # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
374
+ # @yield [result, operation] Access the result along with the TransportOperation object
375
+ # @yieldparam result [::Google::Cloud::Dataproc::V1::NodeGroup]
376
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
377
+ #
378
+ # @return [::Google::Cloud::Dataproc::V1::NodeGroup]
379
+ #
380
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
381
+ def get_node_group request, options = nil
382
+ raise ::ArgumentError, "request must be provided" if request.nil?
383
+
384
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest
385
+
386
+ # Converts hash and nil to an options object
387
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
388
+
389
+ # Customize the options with defaults
390
+ call_metadata = @config.rpcs.get_node_group.metadata.to_h
391
+
392
+ # Set x-goog-api-client and x-goog-user-project headers
393
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
394
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
395
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION,
396
+ transports_version_send: [:rest]
397
+
398
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
+
400
+ options.apply_defaults timeout: @config.rpcs.get_node_group.timeout,
401
+ metadata: call_metadata,
402
+ retry_policy: @config.rpcs.get_node_group.retry_policy
403
+
404
+ options.apply_defaults timeout: @config.timeout,
405
+ metadata: @config.metadata,
406
+ retry_policy: @config.retry_policy
407
+
408
+ @node_group_controller_stub.get_node_group request, options do |result, operation|
409
+ yield result, operation if block_given?
410
+ return result
411
+ end
412
+ rescue ::Gapic::Rest::Error => e
413
+ raise ::Google::Cloud::Error.from_error(e)
414
+ end
415
+
416
+ ##
417
+ # Configuration class for the NodeGroupController REST API.
418
+ #
419
+ # This class represents the configuration for NodeGroupController REST,
420
+ # providing control over timeouts, retry behavior, logging, transport
421
+ # parameters, and other low-level controls. Certain parameters can also be
422
+ # applied individually to specific RPCs. See
423
+ # {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration::Rpcs}
424
+ # for a list of RPCs that can be configured independently.
425
+ #
426
+ # Configuration can be applied globally to all clients, or to a single client
427
+ # on construction.
428
+ #
429
+ # @example
430
+ #
431
+ # # Modify the global config, setting the timeout for
432
+ # # create_node_group to 20 seconds,
433
+ # # and all remaining timeouts to 10 seconds.
434
+ # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config|
435
+ # config.timeout = 10.0
436
+ # config.rpcs.create_node_group.timeout = 20.0
437
+ # end
438
+ #
439
+ # # Apply the above configuration only to a new client.
440
+ # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config|
441
+ # config.timeout = 10.0
442
+ # config.rpcs.create_node_group.timeout = 20.0
443
+ # end
444
+ #
445
+ # @!attribute [rw] endpoint
446
+ # The hostname or hostname:port of the service endpoint.
447
+ # Defaults to `"dataproc.googleapis.com"`.
448
+ # @return [::String]
449
+ # @!attribute [rw] credentials
450
+ # Credentials to send with calls. You may provide any of the following types:
451
+ # * (`String`) The path to a service account key file in JSON format
452
+ # * (`Hash`) A service account key as a Hash
453
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
454
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
455
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
456
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
457
+ # * (`nil`) indicating no credentials
458
+ # @return [::Object]
459
+ # @!attribute [rw] scope
460
+ # The OAuth scopes
461
+ # @return [::Array<::String>]
462
+ # @!attribute [rw] lib_name
463
+ # The library name as recorded in instrumentation and logging
464
+ # @return [::String]
465
+ # @!attribute [rw] lib_version
466
+ # The library version as recorded in instrumentation and logging
467
+ # @return [::String]
468
+ # @!attribute [rw] timeout
469
+ # The call timeout in seconds.
470
+ # @return [::Numeric]
471
+ # @!attribute [rw] metadata
472
+ # Additional headers to be sent with the call.
473
+ # @return [::Hash{::Symbol=>::String}]
474
+ # @!attribute [rw] retry_policy
475
+ # The retry policy. The value is a hash with the following keys:
476
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
477
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
478
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
479
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
480
+ # trigger a retry.
481
+ # @return [::Hash]
482
+ # @!attribute [rw] quota_project
483
+ # A separate project against which to charge quota.
484
+ # @return [::String]
485
+ #
486
+ class Configuration
487
+ extend ::Gapic::Config
488
+
489
+ config_attr :endpoint, "dataproc.googleapis.com", ::String
490
+ config_attr :credentials, nil do |value|
491
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
492
+ allowed.any? { |klass| klass === value }
493
+ end
494
+ config_attr :scope, nil, ::String, ::Array, nil
495
+ config_attr :lib_name, nil, ::String, nil
496
+ config_attr :lib_version, nil, ::String, nil
497
+ config_attr :timeout, nil, ::Numeric, nil
498
+ config_attr :metadata, nil, ::Hash, nil
499
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
500
+ config_attr :quota_project, nil, ::String, nil
501
+
502
+ # @private
503
+ # Overrides for http bindings for the RPCs of this service
504
+ # are only used when this service is used as mixin, and only
505
+ # by the host service.
506
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
507
+ config_attr :bindings_override, {}, ::Hash, nil
508
+
509
+ # @private
510
+ def initialize parent_config = nil
511
+ @parent_config = parent_config unless parent_config.nil?
512
+
513
+ yield self if block_given?
514
+ end
515
+
516
+ ##
517
+ # Configurations for individual RPCs
518
+ # @return [Rpcs]
519
+ #
520
+ def rpcs
521
+ @rpcs ||= begin
522
+ parent_rpcs = nil
523
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
524
+ Rpcs.new parent_rpcs
525
+ end
526
+ end
527
+
528
+ ##
529
+ # Configuration RPC class for the NodeGroupController API.
530
+ #
531
+ # Includes fields providing the configuration for each RPC in this service.
532
+ # Each configuration object is of type `Gapic::Config::Method` and includes
533
+ # the following configuration fields:
534
+ #
535
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
536
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
537
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
538
+ # include the following keys:
539
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
540
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
541
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
542
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
543
+ # trigger a retry.
544
+ #
545
+ class Rpcs
546
+ ##
547
+ # RPC-specific configuration for `create_node_group`
548
+ # @return [::Gapic::Config::Method]
549
+ #
550
+ attr_reader :create_node_group
551
+ ##
552
+ # RPC-specific configuration for `resize_node_group`
553
+ # @return [::Gapic::Config::Method]
554
+ #
555
+ attr_reader :resize_node_group
556
+ ##
557
+ # RPC-specific configuration for `get_node_group`
558
+ # @return [::Gapic::Config::Method]
559
+ #
560
+ attr_reader :get_node_group
561
+
562
+ # @private
563
+ def initialize parent_rpcs = nil
564
+ create_node_group_config = parent_rpcs.create_node_group if parent_rpcs.respond_to? :create_node_group
565
+ @create_node_group = ::Gapic::Config::Method.new create_node_group_config
566
+ resize_node_group_config = parent_rpcs.resize_node_group if parent_rpcs.respond_to? :resize_node_group
567
+ @resize_node_group = ::Gapic::Config::Method.new resize_node_group_config
568
+ get_node_group_config = parent_rpcs.get_node_group if parent_rpcs.respond_to? :get_node_group
569
+ @get_node_group = ::Gapic::Config::Method.new get_node_group_config
570
+
571
+ yield self if block_given?
572
+ end
573
+ end
574
+ end
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ end