google-cloud-dataproc-v1beta2 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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-dataproc-v1beta2.rb +21 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/dataproc/v1beta2.rb +38 -0
  9. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_pb.rb +81 -0
  10. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_services_pb.rb +58 -0
  11. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service.rb +50 -0
  12. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/client.rb +734 -0
  13. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/credentials.rb +51 -0
  14. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/paths.rb +110 -0
  15. data/lib/google/cloud/dataproc/v1beta2/cluster_controller.rb +50 -0
  16. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/client.rb +979 -0
  17. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/credentials.rb +51 -0
  18. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/operations.rb +564 -0
  19. data/lib/google/cloud/dataproc/v1beta2/clusters_pb.rb +255 -0
  20. data/lib/google/cloud/dataproc/v1beta2/clusters_services_pb.rb +68 -0
  21. data/lib/google/cloud/dataproc/v1beta2/job_controller.rb +49 -0
  22. data/lib/google/cloud/dataproc/v1beta2/job_controller/client.rb +980 -0
  23. data/lib/google/cloud/dataproc/v1beta2/job_controller/credentials.rb +51 -0
  24. data/lib/google/cloud/dataproc/v1beta2/job_controller/operations.rb +564 -0
  25. data/lib/google/cloud/dataproc/v1beta2/jobs_pb.rb +283 -0
  26. data/lib/google/cloud/dataproc/v1beta2/jobs_services_pb.rb +62 -0
  27. data/lib/google/cloud/dataproc/v1beta2/operations_pb.rb +45 -0
  28. data/lib/google/cloud/dataproc/v1beta2/shared_pb.rb +35 -0
  29. data/lib/google/cloud/dataproc/v1beta2/version.rb +28 -0
  30. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service.rb +51 -0
  31. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/client.rb +1028 -0
  32. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/credentials.rb +51 -0
  33. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/operations.rb +564 -0
  34. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb +110 -0
  35. data/lib/google/cloud/dataproc/v1beta2/workflow_templates_pb.rb +189 -0
  36. data/lib/google/cloud/dataproc/v1beta2/workflow_templates_services_pb.rb +104 -0
  37. data/proto_docs/README.md +4 -0
  38. data/proto_docs/google/api/field_behavior.rb +59 -0
  39. data/proto_docs/google/api/resource.rb +247 -0
  40. data/proto_docs/google/cloud/dataproc/v1beta2/autoscaling_policies.rb +272 -0
  41. data/proto_docs/google/cloud/dataproc/v1beta2/clusters.rb +1032 -0
  42. data/proto_docs/google/cloud/dataproc/v1beta2/jobs.rb +984 -0
  43. data/proto_docs/google/cloud/dataproc/v1beta2/operations.rb +98 -0
  44. data/proto_docs/google/cloud/dataproc/v1beta2/shared.rb +68 -0
  45. data/proto_docs/google/cloud/dataproc/v1beta2/workflow_templates.rb +706 -0
  46. data/proto_docs/google/longrunning/operations.rb +150 -0
  47. data/proto_docs/google/protobuf/any.rb +138 -0
  48. data/proto_docs/google/protobuf/duration.rb +98 -0
  49. data/proto_docs/google/protobuf/empty.rb +36 -0
  50. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  51. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  52. data/proto_docs/google/rpc/status.rb +46 -0
  53. metadata +205 -0
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dataproc/v1beta2/version"
24
+
25
+ require "google/cloud/dataproc/v1beta2/workflow_template_service/credentials"
26
+ require "google/cloud/dataproc/v1beta2/workflow_template_service/paths"
27
+ require "google/cloud/dataproc/v1beta2/workflow_template_service/operations"
28
+ require "google/cloud/dataproc/v1beta2/workflow_template_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Dataproc
33
+ module V1beta2
34
+ ##
35
+ # The API interface for managing Workflow Templates in the
36
+ # Dataproc API.
37
+ #
38
+ # To load this service and instantiate a client:
39
+ #
40
+ # require "google/cloud/dataproc/v1beta2/workflow_template_service"
41
+ # client = Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.new
42
+ #
43
+ module WorkflowTemplateService
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "workflow_template_service", "helpers.rb"
51
+ require "google/cloud/dataproc/v1beta2/workflow_template_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1028 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/v1beta2/workflow_templates_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dataproc
25
+ module V1beta2
26
+ module WorkflowTemplateService
27
+ ##
28
+ # Client for the WorkflowTemplateService service.
29
+ #
30
+ # The API interface for managing Workflow Templates in the
31
+ # Dataproc API.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :workflow_template_service_stub
38
+
39
+ ##
40
+ # Configure the WorkflowTemplateService Client class.
41
+ #
42
+ # See {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all WorkflowTemplateService clients:
48
+ #
49
+ # Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.configure do |config|
50
+ # config.timeout = 10_000
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Dataproc", "V1beta2"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const&.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_workflow_template.timeout = 600.0
70
+ default_config.rpcs.create_workflow_template.retry_policy = {
71
+ initial_delay: 0.1,
72
+ max_delay: 60.0,
73
+ multiplier: 1.3,
74
+ retry_codes: ["UNAVAILABLE"]
75
+ }
76
+
77
+ default_config.rpcs.get_workflow_template.timeout = 600.0
78
+ default_config.rpcs.get_workflow_template.retry_policy = {
79
+ initial_delay: 0.1,
80
+ max_delay: 60.0,
81
+ multiplier: 1.3,
82
+ retry_codes: ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"]
83
+ }
84
+
85
+ default_config.rpcs.instantiate_workflow_template.timeout = 600.0
86
+ default_config.rpcs.instantiate_workflow_template.retry_policy = {
87
+ initial_delay: 0.1,
88
+ max_delay: 60.0,
89
+ multiplier: 1.3,
90
+ retry_codes: ["UNAVAILABLE"]
91
+ }
92
+
93
+ default_config.rpcs.instantiate_inline_workflow_template.timeout = 600.0
94
+ default_config.rpcs.instantiate_inline_workflow_template.retry_policy = {
95
+ initial_delay: 0.1,
96
+ max_delay: 60.0,
97
+ multiplier: 1.3,
98
+ retry_codes: ["UNAVAILABLE"]
99
+ }
100
+
101
+ default_config.rpcs.update_workflow_template.timeout = 600.0
102
+ default_config.rpcs.update_workflow_template.retry_policy = {
103
+ initial_delay: 0.1,
104
+ max_delay: 60.0,
105
+ multiplier: 1.3,
106
+ retry_codes: ["UNAVAILABLE"]
107
+ }
108
+
109
+ default_config.rpcs.list_workflow_templates.timeout = 600.0
110
+ default_config.rpcs.list_workflow_templates.retry_policy = {
111
+ initial_delay: 0.1,
112
+ max_delay: 60.0,
113
+ multiplier: 1.3,
114
+ retry_codes: ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"]
115
+ }
116
+
117
+ default_config.rpcs.delete_workflow_template.timeout = 600.0
118
+ default_config.rpcs.delete_workflow_template.retry_policy = {
119
+ initial_delay: 0.1,
120
+ max_delay: 60.0,
121
+ multiplier: 1.3,
122
+ retry_codes: ["UNAVAILABLE"]
123
+ }
124
+
125
+ default_config
126
+ end
127
+ yield @configure if block_given?
128
+ @configure
129
+ end
130
+
131
+ ##
132
+ # Configure the WorkflowTemplateService Client instance.
133
+ #
134
+ # The configuration is set to the derived mode, meaning that values can be changed,
135
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
136
+ # should be made on {Client.configure}.
137
+ #
138
+ # See {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client::Configuration}
139
+ # for a description of the configuration fields.
140
+ #
141
+ # @yield [config] Configure the Client client.
142
+ # @yieldparam config [Client::Configuration]
143
+ #
144
+ # @return [Client::Configuration]
145
+ #
146
+ def configure
147
+ yield @config if block_given?
148
+ @config
149
+ end
150
+
151
+ ##
152
+ # Create a new WorkflowTemplateService client object.
153
+ #
154
+ # ## Examples
155
+ #
156
+ # To create a new WorkflowTemplateService client with the default
157
+ # configuration:
158
+ #
159
+ # client = Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.new
160
+ #
161
+ # To create a new WorkflowTemplateService client with a custom
162
+ # configuration:
163
+ #
164
+ # client = Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.new do |config|
165
+ # config.timeout = 10_000
166
+ # end
167
+ #
168
+ # @yield [config] Configure the WorkflowTemplateService client.
169
+ # @yieldparam config [Client::Configuration]
170
+ #
171
+ def initialize
172
+ # These require statements are intentionally placed here to initialize
173
+ # the gRPC module only when it's required.
174
+ # See https://github.com/googleapis/toolkit/issues/446
175
+ require "gapic/grpc"
176
+ require "google/cloud/dataproc/v1beta2/workflow_templates_services_pb"
177
+
178
+ # Create the configuration object
179
+ @config = Configuration.new Client.configure
180
+
181
+ # Yield the configuration if needed
182
+ yield @config if block_given?
183
+
184
+ # Create credentials
185
+ credentials = @config.credentials
186
+ credentials ||= Credentials.default scope: @config.scope
187
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
188
+ credentials = Credentials.new credentials, scope: @config.scope
189
+ end
190
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
191
+
192
+ @operations_client = Operations.new do |config|
193
+ config.credentials = credentials
194
+ config.endpoint = @config.endpoint
195
+ end
196
+
197
+ @workflow_template_service_stub = Gapic::ServiceStub.new(
198
+ Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Stub,
199
+ credentials: credentials,
200
+ endpoint: @config.endpoint,
201
+ channel_args: @config.channel_args,
202
+ interceptors: @config.interceptors
203
+ )
204
+ end
205
+
206
+ ##
207
+ # Get the associated client for long-running operations.
208
+ #
209
+ # @return [Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Operations]
210
+ #
211
+ attr_reader :operations_client
212
+
213
+ # Service calls
214
+
215
+ ##
216
+ # Creates new workflow template.
217
+ #
218
+ # @overload create_workflow_template(request, options = nil)
219
+ # Pass arguments to `create_workflow_template` via a request object, either of type
220
+ # {Google::Cloud::Dataproc::V1beta2::CreateWorkflowTemplateRequest} or an equivalent Hash.
221
+ #
222
+ # @param request [Google::Cloud::Dataproc::V1beta2::CreateWorkflowTemplateRequest, Hash]
223
+ # A request object representing the call parameters. Required. To specify no
224
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
225
+ # @param options [Gapic::CallOptions, Hash]
226
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
227
+ #
228
+ # @overload create_workflow_template(parent: nil, template: nil)
229
+ # Pass arguments to `create_workflow_template` via keyword arguments. Note that at
230
+ # least one keyword argument is required. To specify no parameters, or to keep all
231
+ # the default parameter values, pass an empty Hash as a request object (see above).
232
+ #
233
+ # @param parent [String]
234
+ # Required. The resource name of the region or location, as described
235
+ # in https://cloud.google.com/apis/design/resource_names.
236
+ #
237
+ # * For `projects.regions.workflowTemplates,create`, the resource name of the
238
+ # region has the following format:
239
+ # `projects/{project_id}/regions/{region}`
240
+ #
241
+ # * For `projects.locations.workflowTemplates.create`, the resource name of
242
+ # the location has the following format:
243
+ # `projects/{project_id}/locations/{location}`
244
+ # @param template [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate, Hash]
245
+ # Required. The Dataproc workflow template to create.
246
+ #
247
+ # @yield [response, operation] Access the result along with the RPC operation
248
+ # @yieldparam response [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
249
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
250
+ #
251
+ # @return [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
252
+ #
253
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
254
+ #
255
+ def create_workflow_template request, options = nil
256
+ raise ArgumentError, "request must be provided" if request.nil?
257
+
258
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::CreateWorkflowTemplateRequest
259
+
260
+ # Converts hash and nil to an options object
261
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
262
+
263
+ # Customize the options with defaults
264
+ metadata = @config.rpcs.create_workflow_template.metadata.to_h
265
+
266
+ # Set x-goog-api-client and x-goog-user-project headers
267
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
269
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
270
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
271
+
272
+ header_params = {
273
+ "parent" => request.parent
274
+ }
275
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
276
+ metadata[:"x-goog-request-params"] ||= request_params_header
277
+
278
+ options.apply_defaults timeout: @config.rpcs.create_workflow_template.timeout,
279
+ metadata: metadata,
280
+ retry_policy: @config.rpcs.create_workflow_template.retry_policy
281
+ options.apply_defaults metadata: @config.metadata,
282
+ retry_policy: @config.retry_policy
283
+
284
+ @workflow_template_service_stub.call_rpc :create_workflow_template, request, options: options do |response, operation|
285
+ yield response, operation if block_given?
286
+ return response
287
+ end
288
+ rescue GRPC::BadStatus => e
289
+ raise Google::Cloud::Error.from_error(e)
290
+ end
291
+
292
+ ##
293
+ # Retrieves the latest workflow template.
294
+ #
295
+ # Can retrieve previously instantiated template by specifying optional
296
+ # version parameter.
297
+ #
298
+ # @overload get_workflow_template(request, options = nil)
299
+ # Pass arguments to `get_workflow_template` via a request object, either of type
300
+ # {Google::Cloud::Dataproc::V1beta2::GetWorkflowTemplateRequest} or an equivalent Hash.
301
+ #
302
+ # @param request [Google::Cloud::Dataproc::V1beta2::GetWorkflowTemplateRequest, Hash]
303
+ # A request object representing the call parameters. Required. To specify no
304
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
305
+ # @param options [Gapic::CallOptions, Hash]
306
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
307
+ #
308
+ # @overload get_workflow_template(name: nil, version: nil)
309
+ # Pass arguments to `get_workflow_template` via keyword arguments. Note that at
310
+ # least one keyword argument is required. To specify no parameters, or to keep all
311
+ # the default parameter values, pass an empty Hash as a request object (see above).
312
+ #
313
+ # @param name [String]
314
+ # Required. The resource name of the workflow template, as described
315
+ # in https://cloud.google.com/apis/design/resource_names.
316
+ #
317
+ # * For `projects.regions.workflowTemplates.get`, the resource name of the
318
+ # template has the following format:
319
+ # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
320
+ #
321
+ # * For `projects.locations.workflowTemplates.get`, the resource name of the
322
+ # template has the following format:
323
+ # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
324
+ # @param version [Integer]
325
+ # Optional. The version of workflow template to retrieve. Only previously
326
+ # instantiated versions can be retrieved.
327
+ #
328
+ # If unspecified, retrieves the current version.
329
+ #
330
+ # @yield [response, operation] Access the result along with the RPC operation
331
+ # @yieldparam response [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
332
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
333
+ #
334
+ # @return [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
335
+ #
336
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
337
+ #
338
+ def get_workflow_template request, options = nil
339
+ raise ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::GetWorkflowTemplateRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ metadata = @config.rpcs.get_workflow_template.metadata.to_h
348
+
349
+ # Set x-goog-api-client and x-goog-user-project headers
350
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
353
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
+
355
+ header_params = {
356
+ "name" => request.name
357
+ }
358
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
+ metadata[:"x-goog-request-params"] ||= request_params_header
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_workflow_template.timeout,
362
+ metadata: metadata,
363
+ retry_policy: @config.rpcs.get_workflow_template.retry_policy
364
+ options.apply_defaults metadata: @config.metadata,
365
+ retry_policy: @config.retry_policy
366
+
367
+ @workflow_template_service_stub.call_rpc :get_workflow_template, request, options: options do |response, operation|
368
+ yield response, operation if block_given?
369
+ return response
370
+ end
371
+ rescue GRPC::BadStatus => e
372
+ raise Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Instantiates a template and begins execution.
377
+ #
378
+ # The returned Operation can be used to track execution of
379
+ # workflow by polling
380
+ # operations.get.
381
+ # The Operation will complete when entire workflow is finished.
382
+ #
383
+ # The running workflow can be aborted via
384
+ # operations.cancel.
385
+ # This will cause any inflight jobs to be cancelled and workflow-owned
386
+ # clusters to be deleted.
387
+ #
388
+ # The {Google::Longrunning::Operation#metadata Operation.metadata} will be
389
+ # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata).
390
+ # Also see [Using
391
+ # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
392
+ #
393
+ # On successful completion,
394
+ # {Google::Longrunning::Operation#response Operation.response} will be
395
+ # {Google::Protobuf::Empty Empty}.
396
+ #
397
+ # @overload instantiate_workflow_template(request, options = nil)
398
+ # Pass arguments to `instantiate_workflow_template` via a request object, either of type
399
+ # {Google::Cloud::Dataproc::V1beta2::InstantiateWorkflowTemplateRequest} or an equivalent Hash.
400
+ #
401
+ # @param request [Google::Cloud::Dataproc::V1beta2::InstantiateWorkflowTemplateRequest, Hash]
402
+ # A request object representing the call parameters. Required. To specify no
403
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
404
+ # @param options [Gapic::CallOptions, Hash]
405
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
406
+ #
407
+ # @overload instantiate_workflow_template(name: nil, version: nil, instance_id: nil, request_id: nil, parameters: nil)
408
+ # Pass arguments to `instantiate_workflow_template` via keyword arguments. Note that at
409
+ # least one keyword argument is required. To specify no parameters, or to keep all
410
+ # the default parameter values, pass an empty Hash as a request object (see above).
411
+ #
412
+ # @param name [String]
413
+ # Required. The resource name of the workflow template, as described
414
+ # in https://cloud.google.com/apis/design/resource_names.
415
+ #
416
+ # * For `projects.regions.workflowTemplates.instantiate`, the resource name
417
+ # of the template has the following format:
418
+ # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
419
+ #
420
+ # * For `projects.locations.workflowTemplates.instantiate`, the resource name
421
+ # of the template has the following format:
422
+ # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
423
+ # @param version [Integer]
424
+ # Optional. The version of workflow template to instantiate. If specified,
425
+ # the workflow will be instantiated only if the current version of
426
+ # the workflow template has the supplied version.
427
+ #
428
+ # This option cannot be used to instantiate a previous version of
429
+ # workflow template.
430
+ # @param instance_id [String]
431
+ # Deprecated. Please use `request_id` field instead.
432
+ # @param request_id [String]
433
+ # Optional. A tag that prevents multiple concurrent workflow
434
+ # instances with the same tag from running. This mitigates risk of
435
+ # concurrent instances started due to retries.
436
+ #
437
+ # It is recommended to always set this value to a
438
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
439
+ #
440
+ # The tag must contain only letters (a-z, A-Z), numbers (0-9),
441
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
442
+ # @param parameters [Hash{String => String}]
443
+ # Optional. Map from parameter names to values that should be used for those
444
+ # parameters. Values may not exceed 100 characters.
445
+ #
446
+ # @yield [response, operation] Access the result along with the RPC operation
447
+ # @yieldparam response [Gapic::Operation]
448
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
449
+ #
450
+ # @return [Gapic::Operation]
451
+ #
452
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
453
+ #
454
+ def instantiate_workflow_template request, options = nil
455
+ raise ArgumentError, "request must be provided" if request.nil?
456
+
457
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::InstantiateWorkflowTemplateRequest
458
+
459
+ # Converts hash and nil to an options object
460
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
461
+
462
+ # Customize the options with defaults
463
+ metadata = @config.rpcs.instantiate_workflow_template.metadata.to_h
464
+
465
+ # Set x-goog-api-client and x-goog-user-project headers
466
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
467
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
468
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
469
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
470
+
471
+ header_params = {
472
+ "name" => request.name
473
+ }
474
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
475
+ metadata[:"x-goog-request-params"] ||= request_params_header
476
+
477
+ options.apply_defaults timeout: @config.rpcs.instantiate_workflow_template.timeout,
478
+ metadata: metadata,
479
+ retry_policy: @config.rpcs.instantiate_workflow_template.retry_policy
480
+ options.apply_defaults metadata: @config.metadata,
481
+ retry_policy: @config.retry_policy
482
+
483
+ @workflow_template_service_stub.call_rpc :instantiate_workflow_template, request, options: options do |response, operation|
484
+ response = Gapic::Operation.new response, @operations_client, options: options
485
+ yield response, operation if block_given?
486
+ return response
487
+ end
488
+ rescue GRPC::BadStatus => e
489
+ raise Google::Cloud::Error.from_error(e)
490
+ end
491
+
492
+ ##
493
+ # Instantiates a template and begins execution.
494
+ #
495
+ # This method is equivalent to executing the sequence
496
+ # {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client#create_workflow_template CreateWorkflowTemplate}, {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client#instantiate_workflow_template InstantiateWorkflowTemplate},
497
+ # {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client#delete_workflow_template DeleteWorkflowTemplate}.
498
+ #
499
+ # The returned Operation can be used to track execution of
500
+ # workflow by polling
501
+ # operations.get.
502
+ # The Operation will complete when entire workflow is finished.
503
+ #
504
+ # The running workflow can be aborted via
505
+ # operations.cancel.
506
+ # This will cause any inflight jobs to be cancelled and workflow-owned
507
+ # clusters to be deleted.
508
+ #
509
+ # The {Google::Longrunning::Operation#metadata Operation.metadata} will be
510
+ # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
511
+ # Also see [Using
512
+ # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
513
+ #
514
+ # On successful completion,
515
+ # {Google::Longrunning::Operation#response Operation.response} will be
516
+ # {Google::Protobuf::Empty Empty}.
517
+ #
518
+ # @overload instantiate_inline_workflow_template(request, options = nil)
519
+ # Pass arguments to `instantiate_inline_workflow_template` via a request object, either of type
520
+ # {Google::Cloud::Dataproc::V1beta2::InstantiateInlineWorkflowTemplateRequest} or an equivalent Hash.
521
+ #
522
+ # @param request [Google::Cloud::Dataproc::V1beta2::InstantiateInlineWorkflowTemplateRequest, Hash]
523
+ # A request object representing the call parameters. Required. To specify no
524
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
525
+ # @param options [Gapic::CallOptions, Hash]
526
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
527
+ #
528
+ # @overload instantiate_inline_workflow_template(parent: nil, template: nil, instance_id: nil, request_id: nil)
529
+ # Pass arguments to `instantiate_inline_workflow_template` via keyword arguments. Note that at
530
+ # least one keyword argument is required. To specify no parameters, or to keep all
531
+ # the default parameter values, pass an empty Hash as a request object (see above).
532
+ #
533
+ # @param parent [String]
534
+ # Required. The resource name of the region or location, as described
535
+ # in https://cloud.google.com/apis/design/resource_names.
536
+ #
537
+ # * For `projects.regions.workflowTemplates,instantiateinline`, the resource
538
+ # name of the region has the following format:
539
+ # `projects/{project_id}/regions/{region}`
540
+ #
541
+ # * For `projects.locations.workflowTemplates.instantiateinline`, the
542
+ # resource name of the location has the following format:
543
+ # `projects/{project_id}/locations/{location}`
544
+ # @param template [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate, Hash]
545
+ # Required. The workflow template to instantiate.
546
+ # @param instance_id [String]
547
+ # Deprecated. Please use `request_id` field instead.
548
+ # @param request_id [String]
549
+ # Optional. A tag that prevents multiple concurrent workflow
550
+ # instances with the same tag from running. This mitigates risk of
551
+ # concurrent instances started due to retries.
552
+ #
553
+ # It is recommended to always set this value to a
554
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
555
+ #
556
+ # The tag must contain only letters (a-z, A-Z), numbers (0-9),
557
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
558
+ #
559
+ # @yield [response, operation] Access the result along with the RPC operation
560
+ # @yieldparam response [Gapic::Operation]
561
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
562
+ #
563
+ # @return [Gapic::Operation]
564
+ #
565
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
566
+ #
567
+ def instantiate_inline_workflow_template request, options = nil
568
+ raise ArgumentError, "request must be provided" if request.nil?
569
+
570
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::InstantiateInlineWorkflowTemplateRequest
571
+
572
+ # Converts hash and nil to an options object
573
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
574
+
575
+ # Customize the options with defaults
576
+ metadata = @config.rpcs.instantiate_inline_workflow_template.metadata.to_h
577
+
578
+ # Set x-goog-api-client and x-goog-user-project headers
579
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
581
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
582
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
583
+
584
+ header_params = {
585
+ "parent" => request.parent
586
+ }
587
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
588
+ metadata[:"x-goog-request-params"] ||= request_params_header
589
+
590
+ options.apply_defaults timeout: @config.rpcs.instantiate_inline_workflow_template.timeout,
591
+ metadata: metadata,
592
+ retry_policy: @config.rpcs.instantiate_inline_workflow_template.retry_policy
593
+ options.apply_defaults metadata: @config.metadata,
594
+ retry_policy: @config.retry_policy
595
+
596
+ @workflow_template_service_stub.call_rpc :instantiate_inline_workflow_template, request, options: options do |response, operation|
597
+ response = Gapic::Operation.new response, @operations_client, options: options
598
+ yield response, operation if block_given?
599
+ return response
600
+ end
601
+ rescue GRPC::BadStatus => e
602
+ raise Google::Cloud::Error.from_error(e)
603
+ end
604
+
605
+ ##
606
+ # Updates (replaces) workflow template. The updated template
607
+ # must contain version that matches the current server version.
608
+ #
609
+ # @overload update_workflow_template(request, options = nil)
610
+ # Pass arguments to `update_workflow_template` via a request object, either of type
611
+ # {Google::Cloud::Dataproc::V1beta2::UpdateWorkflowTemplateRequest} or an equivalent Hash.
612
+ #
613
+ # @param request [Google::Cloud::Dataproc::V1beta2::UpdateWorkflowTemplateRequest, Hash]
614
+ # A request object representing the call parameters. Required. To specify no
615
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
616
+ # @param options [Gapic::CallOptions, Hash]
617
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
618
+ #
619
+ # @overload update_workflow_template(template: nil)
620
+ # Pass arguments to `update_workflow_template` via keyword arguments. Note that at
621
+ # least one keyword argument is required. To specify no parameters, or to keep all
622
+ # the default parameter values, pass an empty Hash as a request object (see above).
623
+ #
624
+ # @param template [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate, Hash]
625
+ # Required. The updated workflow template.
626
+ #
627
+ # The `template.version` field must match the current version.
628
+ #
629
+ # @yield [response, operation] Access the result along with the RPC operation
630
+ # @yieldparam response [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
631
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
632
+ #
633
+ # @return [Google::Cloud::Dataproc::V1beta2::WorkflowTemplate]
634
+ #
635
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
636
+ #
637
+ def update_workflow_template request, options = nil
638
+ raise ArgumentError, "request must be provided" if request.nil?
639
+
640
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::UpdateWorkflowTemplateRequest
641
+
642
+ # Converts hash and nil to an options object
643
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
644
+
645
+ # Customize the options with defaults
646
+ metadata = @config.rpcs.update_workflow_template.metadata.to_h
647
+
648
+ # Set x-goog-api-client and x-goog-user-project headers
649
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
650
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
651
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
652
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
653
+
654
+ header_params = {
655
+ "template.name" => request.template.name
656
+ }
657
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
658
+ metadata[:"x-goog-request-params"] ||= request_params_header
659
+
660
+ options.apply_defaults timeout: @config.rpcs.update_workflow_template.timeout,
661
+ metadata: metadata,
662
+ retry_policy: @config.rpcs.update_workflow_template.retry_policy
663
+ options.apply_defaults metadata: @config.metadata,
664
+ retry_policy: @config.retry_policy
665
+
666
+ @workflow_template_service_stub.call_rpc :update_workflow_template, request, options: options do |response, operation|
667
+ yield response, operation if block_given?
668
+ return response
669
+ end
670
+ rescue GRPC::BadStatus => e
671
+ raise Google::Cloud::Error.from_error(e)
672
+ end
673
+
674
+ ##
675
+ # Lists workflows that match the specified filter in the request.
676
+ #
677
+ # @overload list_workflow_templates(request, options = nil)
678
+ # Pass arguments to `list_workflow_templates` via a request object, either of type
679
+ # {Google::Cloud::Dataproc::V1beta2::ListWorkflowTemplatesRequest} or an equivalent Hash.
680
+ #
681
+ # @param request [Google::Cloud::Dataproc::V1beta2::ListWorkflowTemplatesRequest, Hash]
682
+ # A request object representing the call parameters. Required. To specify no
683
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
684
+ # @param options [Gapic::CallOptions, Hash]
685
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
686
+ #
687
+ # @overload list_workflow_templates(parent: nil, page_size: nil, page_token: nil)
688
+ # Pass arguments to `list_workflow_templates` via keyword arguments. Note that at
689
+ # least one keyword argument is required. To specify no parameters, or to keep all
690
+ # the default parameter values, pass an empty Hash as a request object (see above).
691
+ #
692
+ # @param parent [String]
693
+ # Required. The resource name of the region or location, as described
694
+ # in https://cloud.google.com/apis/design/resource_names.
695
+ #
696
+ # * For `projects.regions.workflowTemplates,list`, the resource
697
+ # name of the region has the following format:
698
+ # `projects/{project_id}/regions/{region}`
699
+ #
700
+ # * For `projects.locations.workflowTemplates.list`, the
701
+ # resource name of the location has the following format:
702
+ # `projects/{project_id}/locations/{location}`
703
+ # @param page_size [Integer]
704
+ # Optional. The maximum number of results to return in each response.
705
+ # @param page_token [String]
706
+ # Optional. The page token, returned by a previous call, to request the
707
+ # next page of results.
708
+ #
709
+ # @yield [response, operation] Access the result along with the RPC operation
710
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>]
711
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
712
+ #
713
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>]
714
+ #
715
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
716
+ #
717
+ def list_workflow_templates request, options = nil
718
+ raise ArgumentError, "request must be provided" if request.nil?
719
+
720
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::ListWorkflowTemplatesRequest
721
+
722
+ # Converts hash and nil to an options object
723
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
724
+
725
+ # Customize the options with defaults
726
+ metadata = @config.rpcs.list_workflow_templates.metadata.to_h
727
+
728
+ # Set x-goog-api-client and x-goog-user-project headers
729
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
730
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
731
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
732
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
733
+
734
+ header_params = {
735
+ "parent" => request.parent
736
+ }
737
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
738
+ metadata[:"x-goog-request-params"] ||= request_params_header
739
+
740
+ options.apply_defaults timeout: @config.rpcs.list_workflow_templates.timeout,
741
+ metadata: metadata,
742
+ retry_policy: @config.rpcs.list_workflow_templates.retry_policy
743
+ options.apply_defaults metadata: @config.metadata,
744
+ retry_policy: @config.retry_policy
745
+
746
+ @workflow_template_service_stub.call_rpc :list_workflow_templates, request, options: options do |response, operation|
747
+ response = Gapic::PagedEnumerable.new @workflow_template_service_stub, :list_workflow_templates, request, response, operation, options
748
+ yield response, operation if block_given?
749
+ return response
750
+ end
751
+ rescue GRPC::BadStatus => e
752
+ raise Google::Cloud::Error.from_error(e)
753
+ end
754
+
755
+ ##
756
+ # Deletes a workflow template. It does not cancel in-progress workflows.
757
+ #
758
+ # @overload delete_workflow_template(request, options = nil)
759
+ # Pass arguments to `delete_workflow_template` via a request object, either of type
760
+ # {Google::Cloud::Dataproc::V1beta2::DeleteWorkflowTemplateRequest} or an equivalent Hash.
761
+ #
762
+ # @param request [Google::Cloud::Dataproc::V1beta2::DeleteWorkflowTemplateRequest, Hash]
763
+ # A request object representing the call parameters. Required. To specify no
764
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
765
+ # @param options [Gapic::CallOptions, Hash]
766
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
767
+ #
768
+ # @overload delete_workflow_template(name: nil, version: nil)
769
+ # Pass arguments to `delete_workflow_template` via keyword arguments. Note that at
770
+ # least one keyword argument is required. To specify no parameters, or to keep all
771
+ # the default parameter values, pass an empty Hash as a request object (see above).
772
+ #
773
+ # @param name [String]
774
+ # Required. The resource name of the workflow template, as described
775
+ # in https://cloud.google.com/apis/design/resource_names.
776
+ #
777
+ # * For `projects.regions.workflowTemplates.delete`, the resource name
778
+ # of the template has the following format:
779
+ # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
780
+ #
781
+ # * For `projects.locations.workflowTemplates.instantiate`, the resource name
782
+ # of the template has the following format:
783
+ # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
784
+ # @param version [Integer]
785
+ # Optional. The version of workflow template to delete. If specified,
786
+ # will only delete the template if the current server version matches
787
+ # specified version.
788
+ #
789
+ # @yield [response, operation] Access the result along with the RPC operation
790
+ # @yieldparam response [Google::Protobuf::Empty]
791
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
792
+ #
793
+ # @return [Google::Protobuf::Empty]
794
+ #
795
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
796
+ #
797
+ def delete_workflow_template request, options = nil
798
+ raise ArgumentError, "request must be provided" if request.nil?
799
+
800
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::DeleteWorkflowTemplateRequest
801
+
802
+ # Converts hash and nil to an options object
803
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
804
+
805
+ # Customize the options with defaults
806
+ metadata = @config.rpcs.delete_workflow_template.metadata.to_h
807
+
808
+ # Set x-goog-api-client and x-goog-user-project headers
809
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
810
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
811
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
812
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
813
+
814
+ header_params = {
815
+ "name" => request.name
816
+ }
817
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
818
+ metadata[:"x-goog-request-params"] ||= request_params_header
819
+
820
+ options.apply_defaults timeout: @config.rpcs.delete_workflow_template.timeout,
821
+ metadata: metadata,
822
+ retry_policy: @config.rpcs.delete_workflow_template.retry_policy
823
+ options.apply_defaults metadata: @config.metadata,
824
+ retry_policy: @config.retry_policy
825
+
826
+ @workflow_template_service_stub.call_rpc :delete_workflow_template, request, options: options do |response, operation|
827
+ yield response, operation if block_given?
828
+ return response
829
+ end
830
+ rescue GRPC::BadStatus => e
831
+ raise Google::Cloud::Error.from_error(e)
832
+ end
833
+
834
+ ##
835
+ # Configuration class for the WorkflowTemplateService API.
836
+ #
837
+ # This class represents the configuration for WorkflowTemplateService,
838
+ # providing control over timeouts, retry behavior, logging, transport
839
+ # parameters, and other low-level controls. Certain parameters can also be
840
+ # applied individually to specific RPCs. See
841
+ # {Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client::Configuration::Rpcs}
842
+ # for a list of RPCs that can be configured independently.
843
+ #
844
+ # Configuration can be applied globally to all clients, or to a single client
845
+ # on construction.
846
+ #
847
+ # # Examples
848
+ #
849
+ # To modify the global config, setting the timeout for create_workflow_template
850
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
851
+ #
852
+ # Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.configure do |config|
853
+ # config.timeout = 10_000
854
+ # config.rpcs.create_workflow_template.timeout = 20_000
855
+ # end
856
+ #
857
+ # To apply the above configuration only to a new client:
858
+ #
859
+ # client = Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.new do |config|
860
+ # config.timeout = 10_000
861
+ # config.rpcs.create_workflow_template.timeout = 20_000
862
+ # end
863
+ #
864
+ # @!attribute [rw] endpoint
865
+ # The hostname or hostname:port of the service endpoint.
866
+ # Defaults to `"dataproc.googleapis.com"`.
867
+ # @return [String]
868
+ # @!attribute [rw] credentials
869
+ # Credentials to send with calls. You may provide any of the following types:
870
+ # * (`String`) The path to a service account key file in JSON format
871
+ # * (`Hash`) A service account key as a Hash
872
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
873
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
874
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
875
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
876
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
877
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
878
+ # * (`nil`) indicating no credentials
879
+ # @return [Object]
880
+ # @!attribute [rw] scope
881
+ # The OAuth scopes
882
+ # @return [Array<String>]
883
+ # @!attribute [rw] lib_name
884
+ # The library name as recorded in instrumentation and logging
885
+ # @return [String]
886
+ # @!attribute [rw] lib_version
887
+ # The library version as recorded in instrumentation and logging
888
+ # @return [String]
889
+ # @!attribute [rw] channel_args
890
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
891
+ # `GRPC::Core::Channel` object is provided as the credential.
892
+ # @return [Hash]
893
+ # @!attribute [rw] interceptors
894
+ # An array of interceptors that are run before calls are executed.
895
+ # @return [Array<GRPC::ClientInterceptor>]
896
+ # @!attribute [rw] timeout
897
+ # The call timeout in milliseconds.
898
+ # @return [Numeric]
899
+ # @!attribute [rw] metadata
900
+ # Additional gRPC headers to be sent with the call.
901
+ # @return [Hash{Symbol=>String}]
902
+ # @!attribute [rw] retry_policy
903
+ # The retry policy. The value is a hash with the following keys:
904
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
905
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
906
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
907
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
908
+ # trigger a retry.
909
+ # @return [Hash]
910
+ #
911
+ class Configuration
912
+ extend Gapic::Config
913
+
914
+ config_attr :endpoint, "dataproc.googleapis.com", String
915
+ config_attr :credentials, nil do |value|
916
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
917
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
918
+ allowed.any? { |klass| klass === value }
919
+ end
920
+ config_attr :scope, nil, String, Array, nil
921
+ config_attr :lib_name, nil, String, nil
922
+ config_attr :lib_version, nil, String, nil
923
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
924
+ config_attr :interceptors, nil, Array, nil
925
+ config_attr :timeout, nil, Numeric, nil
926
+ config_attr :metadata, nil, Hash, nil
927
+ config_attr :retry_policy, nil, Hash, Proc, nil
928
+
929
+ # @private
930
+ def initialize parent_config = nil
931
+ @parent_config = parent_config unless parent_config.nil?
932
+
933
+ yield self if block_given?
934
+ end
935
+
936
+ ##
937
+ # Configurations for individual RPCs
938
+ # @return [Rpcs]
939
+ #
940
+ def rpcs
941
+ @rpcs ||= begin
942
+ parent_rpcs = nil
943
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
944
+ Rpcs.new parent_rpcs
945
+ end
946
+ end
947
+
948
+ ##
949
+ # Configuration RPC class for the WorkflowTemplateService API.
950
+ #
951
+ # Includes fields providing the configuration for each RPC in this service.
952
+ # Each configuration object is of type `Gapic::Config::Method` and includes
953
+ # the following configuration fields:
954
+ #
955
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
956
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
957
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
958
+ # include the following keys:
959
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
960
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
961
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
962
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
963
+ # trigger a retry.
964
+ #
965
+ class Rpcs
966
+ ##
967
+ # RPC-specific configuration for `create_workflow_template`
968
+ # @return [Gapic::Config::Method]
969
+ #
970
+ attr_reader :create_workflow_template
971
+ ##
972
+ # RPC-specific configuration for `get_workflow_template`
973
+ # @return [Gapic::Config::Method]
974
+ #
975
+ attr_reader :get_workflow_template
976
+ ##
977
+ # RPC-specific configuration for `instantiate_workflow_template`
978
+ # @return [Gapic::Config::Method]
979
+ #
980
+ attr_reader :instantiate_workflow_template
981
+ ##
982
+ # RPC-specific configuration for `instantiate_inline_workflow_template`
983
+ # @return [Gapic::Config::Method]
984
+ #
985
+ attr_reader :instantiate_inline_workflow_template
986
+ ##
987
+ # RPC-specific configuration for `update_workflow_template`
988
+ # @return [Gapic::Config::Method]
989
+ #
990
+ attr_reader :update_workflow_template
991
+ ##
992
+ # RPC-specific configuration for `list_workflow_templates`
993
+ # @return [Gapic::Config::Method]
994
+ #
995
+ attr_reader :list_workflow_templates
996
+ ##
997
+ # RPC-specific configuration for `delete_workflow_template`
998
+ # @return [Gapic::Config::Method]
999
+ #
1000
+ attr_reader :delete_workflow_template
1001
+
1002
+ # @private
1003
+ def initialize parent_rpcs = nil
1004
+ create_workflow_template_config = parent_rpcs&.create_workflow_template if parent_rpcs&.respond_to? :create_workflow_template
1005
+ @create_workflow_template = Gapic::Config::Method.new create_workflow_template_config
1006
+ get_workflow_template_config = parent_rpcs&.get_workflow_template if parent_rpcs&.respond_to? :get_workflow_template
1007
+ @get_workflow_template = Gapic::Config::Method.new get_workflow_template_config
1008
+ instantiate_workflow_template_config = parent_rpcs&.instantiate_workflow_template if parent_rpcs&.respond_to? :instantiate_workflow_template
1009
+ @instantiate_workflow_template = Gapic::Config::Method.new instantiate_workflow_template_config
1010
+ instantiate_inline_workflow_template_config = parent_rpcs&.instantiate_inline_workflow_template if parent_rpcs&.respond_to? :instantiate_inline_workflow_template
1011
+ @instantiate_inline_workflow_template = Gapic::Config::Method.new instantiate_inline_workflow_template_config
1012
+ update_workflow_template_config = parent_rpcs&.update_workflow_template if parent_rpcs&.respond_to? :update_workflow_template
1013
+ @update_workflow_template = Gapic::Config::Method.new update_workflow_template_config
1014
+ list_workflow_templates_config = parent_rpcs&.list_workflow_templates if parent_rpcs&.respond_to? :list_workflow_templates
1015
+ @list_workflow_templates = Gapic::Config::Method.new list_workflow_templates_config
1016
+ delete_workflow_template_config = parent_rpcs&.delete_workflow_template if parent_rpcs&.respond_to? :delete_workflow_template
1017
+ @delete_workflow_template = Gapic::Config::Method.new delete_workflow_template_config
1018
+
1019
+ yield self if block_given?
1020
+ end
1021
+ end
1022
+ end
1023
+ end
1024
+ end
1025
+ end
1026
+ end
1027
+ end
1028
+ end