google-cloud-dataform-v1 0.2.1 → 0.4.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +5 -5
  4. data/lib/google/cloud/dataform/v1/bindings_override.rb +0 -57
  5. data/lib/google/cloud/dataform/v1/dataform/client.rb +2061 -48
  6. data/lib/google/cloud/dataform/v1/dataform/operations.rb +843 -0
  7. data/lib/google/cloud/dataform/v1/dataform/paths.rb +38 -0
  8. data/lib/google/cloud/dataform/v1/dataform/rest/client.rb +1944 -65
  9. data/lib/google/cloud/dataform/v1/dataform/rest/operations.rb +927 -0
  10. data/lib/google/cloud/dataform/v1/dataform/rest/service_stub.rb +1719 -481
  11. data/lib/google/cloud/dataform/v1/dataform/rest.rb +1 -0
  12. data/lib/google/cloud/dataform/v1/dataform.rb +1 -0
  13. data/lib/google/cloud/dataform/v1/dataform_pb.rb +44 -28
  14. data/lib/google/cloud/dataform/v1/dataform_services_pb.rb +54 -0
  15. data/lib/google/cloud/dataform/v1/version.rb +1 -1
  16. data/lib/google/longrunning/bindings_override.rb +71 -0
  17. data/lib/google/longrunning/operations/client.rb +954 -0
  18. data/lib/google/longrunning/operations/credentials.rb +40 -0
  19. data/lib/google/longrunning/operations/operations.rb +839 -0
  20. data/lib/google/longrunning/operations/rest/client.rb +777 -0
  21. data/lib/google/longrunning/operations/rest/operations.rb +923 -0
  22. data/lib/google/longrunning/operations/rest/service_stub.rb +322 -0
  23. data/lib/google/longrunning/operations/rest.rb +57 -0
  24. data/lib/google/longrunning/operations.rb +59 -0
  25. data/lib/google/longrunning/rest.rb +34 -0
  26. data/lib/google/longrunning.rb +41 -0
  27. data/lib/google-cloud-dataform-v1.rb +1 -0
  28. data/proto_docs/google/api/client.rb +149 -29
  29. data/proto_docs/google/cloud/dataform/v1/dataform.rb +759 -3
  30. data/proto_docs/google/longrunning/operations.rb +191 -0
  31. metadata +18 -4
@@ -0,0 +1,839 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/operation"
20
+ require "google/longrunning/operations_pb"
21
+
22
+ module Google
23
+ module Longrunning
24
+ module Operations
25
+ # Service that implements Longrunning Operations API.
26
+ class Operations
27
+ # @private
28
+ API_VERSION = ""
29
+
30
+ # @private
31
+ DEFAULT_ENDPOINT_TEMPLATE = "longrunning.$UNIVERSE_DOMAIN$"
32
+
33
+ # @private
34
+ attr_reader :operations_stub
35
+
36
+ ##
37
+ # Configuration for the Operations Operations API.
38
+ #
39
+ # @yield [config] Configure the Operations client.
40
+ # @yieldparam config [Operations::Configuration]
41
+ #
42
+ # @return [Operations::Configuration]
43
+ #
44
+ def self.configure
45
+ @configure ||= Operations::Configuration.new
46
+ yield @configure if block_given?
47
+ @configure
48
+ end
49
+
50
+ ##
51
+ # Configure the Operations Operations instance.
52
+ #
53
+ # The configuration is set to the derived mode, meaning that values can be changed,
54
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
55
+ # should be made on {Operations.configure}.
56
+ #
57
+ # @yield [config] Configure the Operations client.
58
+ # @yieldparam config [Operations::Configuration]
59
+ #
60
+ # @return [Operations::Configuration]
61
+ #
62
+ def configure
63
+ yield @config if block_given?
64
+ @config
65
+ end
66
+
67
+ ##
68
+ # The effective universe domain
69
+ #
70
+ # @return [String]
71
+ #
72
+ def universe_domain
73
+ @operations_stub.universe_domain
74
+ end
75
+
76
+ ##
77
+ # Create a new Operations client object.
78
+ #
79
+ # @yield [config] Configure the Client client.
80
+ # @yieldparam config [Operations::Configuration]
81
+ #
82
+ def initialize
83
+ # These require statements are intentionally placed here to initialize
84
+ # the gRPC module only when it's required.
85
+ # See https://github.com/googleapis/toolkit/issues/446
86
+ require "gapic/grpc"
87
+ require "google/longrunning/operations_services_pb"
88
+
89
+ # Create the configuration object
90
+ @config = Configuration.new Operations.configure
91
+
92
+ # Yield the configuration if needed
93
+ yield @config if block_given?
94
+
95
+ # Create credentials
96
+ credentials = @config.credentials
97
+ credentials ||= Credentials.default scope: @config.scope
98
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
99
+ credentials = Credentials.new credentials, scope: @config.scope
100
+ end
101
+ @quota_project_id = @config.quota_project
102
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
103
+
104
+ @operations_stub = ::Gapic::ServiceStub.new(
105
+ ::Google::Longrunning::Operations::Stub,
106
+ credentials: credentials,
107
+ endpoint: @config.endpoint,
108
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
109
+ universe_domain: @config.universe_domain,
110
+ channel_args: @config.channel_args,
111
+ interceptors: @config.interceptors,
112
+ channel_pool_config: @config.channel_pool
113
+ )
114
+
115
+ # Used by an LRO wrapper for some methods of this service
116
+ @operations_client = self
117
+ end
118
+
119
+ # Service calls
120
+
121
+ ##
122
+ # Lists operations that match the specified filter in the request. If the
123
+ # server doesn't support this method, it returns `UNIMPLEMENTED`.
124
+ #
125
+ # @overload list_operations(request, options = nil)
126
+ # Pass arguments to `list_operations` via a request object, either of type
127
+ # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
128
+ #
129
+ # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash]
130
+ # A request object representing the call parameters. Required. To specify no
131
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
132
+ # @param options [::Gapic::CallOptions, ::Hash]
133
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
134
+ #
135
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
136
+ # Pass arguments to `list_operations` via keyword arguments. Note that at
137
+ # least one keyword argument is required. To specify no parameters, or to keep all
138
+ # the default parameter values, pass an empty Hash as a request object (see above).
139
+ #
140
+ # @param name [::String]
141
+ # The name of the operation's parent resource.
142
+ # @param filter [::String]
143
+ # The standard list filter.
144
+ # @param page_size [::Integer]
145
+ # The standard list page size.
146
+ # @param page_token [::String]
147
+ # The standard list page token.
148
+ # @param return_partial_success [::Boolean]
149
+ # When set to `true`, operations that are reachable are returned as normal,
150
+ # and those that are unreachable are returned in the
151
+ # [ListOperationsResponse.unreachable] field.
152
+ #
153
+ # This can only be `true` when reading across collections e.g. when `parent`
154
+ # is set to `"projects/example/locations/-"`.
155
+ #
156
+ # This field is not by default supported and will result in an
157
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
158
+ # service or product specific documentation.
159
+ #
160
+ # @yield [response, operation] Access the result along with the RPC operation
161
+ # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
162
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
163
+ #
164
+ # @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
165
+ #
166
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
167
+ #
168
+ # @example Basic example
169
+ # require "google/longrunning"
170
+ #
171
+ # # Create a client object. The client can be reused for multiple calls.
172
+ # client = Google::Longrunning::Operations::Client.new
173
+ #
174
+ # # Create a request. To set request fields, pass in keyword arguments.
175
+ # request = Google::Longrunning::ListOperationsRequest.new
176
+ #
177
+ # # Call the list_operations method.
178
+ # result = client.list_operations request
179
+ #
180
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
181
+ # # over elements, and API calls will be issued to fetch pages as needed.
182
+ # result.each do |item|
183
+ # # Each element is of type ::Google::Longrunning::Operation.
184
+ # p item
185
+ # end
186
+ #
187
+ def list_operations request, options = nil
188
+ raise ::ArgumentError, "request must be provided" if request.nil?
189
+
190
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest
191
+
192
+ # Converts hash and nil to an options object
193
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
194
+
195
+ # Customize the options with defaults
196
+ metadata = @config.rpcs.list_operations.metadata.to_h
197
+
198
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
199
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
200
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
201
+ gapic_version: ::Google::Cloud::Dataform::V1::VERSION
202
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
203
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
204
+
205
+ header_params = {}
206
+ if request.name
207
+ header_params["name"] = request.name
208
+ end
209
+
210
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
211
+ metadata[:"x-goog-request-params"] ||= request_params_header
212
+
213
+ options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
214
+ metadata: metadata,
215
+ retry_policy: @config.rpcs.list_operations.retry_policy
216
+
217
+ options.apply_defaults timeout: @config.timeout,
218
+ metadata: @config.metadata,
219
+ retry_policy: @config.retry_policy
220
+
221
+ @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
222
+ wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
+ response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
+ yield response, operation if block_given?
225
+ throw :response, response
226
+ end
227
+ rescue ::GRPC::BadStatus => e
228
+ raise ::Google::Cloud::Error.from_error(e)
229
+ end
230
+
231
+ ##
232
+ # Gets the latest state of a long-running operation. Clients can use this
233
+ # method to poll the operation result at intervals as recommended by the API
234
+ # service.
235
+ #
236
+ # @overload get_operation(request, options = nil)
237
+ # Pass arguments to `get_operation` via a request object, either of type
238
+ # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash.
239
+ #
240
+ # @param request [::Google::Longrunning::GetOperationRequest, ::Hash]
241
+ # A request object representing the call parameters. Required. To specify no
242
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
243
+ # @param options [::Gapic::CallOptions, ::Hash]
244
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
245
+ #
246
+ # @overload get_operation(name: nil)
247
+ # Pass arguments to `get_operation` via keyword arguments. Note that at
248
+ # least one keyword argument is required. To specify no parameters, or to keep all
249
+ # the default parameter values, pass an empty Hash as a request object (see above).
250
+ #
251
+ # @param name [::String]
252
+ # The name of the operation resource.
253
+ #
254
+ # @yield [response, operation] Access the result along with the RPC operation
255
+ # @yieldparam response [::Gapic::Operation]
256
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
257
+ #
258
+ # @return [::Gapic::Operation]
259
+ #
260
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
261
+ #
262
+ # @example Basic example
263
+ # require "google/longrunning"
264
+ #
265
+ # # Create a client object. The client can be reused for multiple calls.
266
+ # client = Google::Longrunning::Operations::Client.new
267
+ #
268
+ # # Create a request. To set request fields, pass in keyword arguments.
269
+ # request = Google::Longrunning::GetOperationRequest.new
270
+ #
271
+ # # Call the get_operation method.
272
+ # result = client.get_operation request
273
+ #
274
+ # # The returned object is of type Gapic::Operation. You can use it to
275
+ # # check the status of an operation, cancel it, or wait for results.
276
+ # # Here is how to wait for a response.
277
+ # result.wait_until_done! timeout: 60
278
+ # if result.response?
279
+ # p result.response
280
+ # else
281
+ # puts "No response received."
282
+ # end
283
+ #
284
+ def get_operation request, options = nil
285
+ raise ::ArgumentError, "request must be provided" if request.nil?
286
+
287
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest
288
+
289
+ # Converts hash and nil to an options object
290
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
291
+
292
+ # Customize the options with defaults
293
+ metadata = @config.rpcs.get_operation.metadata.to_h
294
+
295
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
296
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
297
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
298
+ gapic_version: ::Google::Cloud::Dataform::V1::VERSION
299
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
300
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
+
302
+ header_params = {}
303
+ if request.name
304
+ header_params["name"] = request.name
305
+ end
306
+
307
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
308
+ metadata[:"x-goog-request-params"] ||= request_params_header
309
+
310
+ options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
311
+ metadata: metadata,
312
+ retry_policy: @config.rpcs.get_operation.retry_policy
313
+
314
+ options.apply_defaults timeout: @config.timeout,
315
+ metadata: @config.metadata,
316
+ retry_policy: @config.retry_policy
317
+
318
+ @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
+ response = ::Gapic::Operation.new response, @operations_client, options: options
320
+ yield response, operation if block_given?
321
+ throw :response, response
322
+ end
323
+ rescue ::GRPC::BadStatus => e
324
+ raise ::Google::Cloud::Error.from_error(e)
325
+ end
326
+
327
+ ##
328
+ # Deletes a long-running operation. This method indicates that the client is
329
+ # no longer interested in the operation result. It does not cancel the
330
+ # operation. If the server doesn't support this method, it returns
331
+ # `google.rpc.Code.UNIMPLEMENTED`.
332
+ #
333
+ # @overload delete_operation(request, options = nil)
334
+ # Pass arguments to `delete_operation` via a request object, either of type
335
+ # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash.
336
+ #
337
+ # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash]
338
+ # A request object representing the call parameters. Required. To specify no
339
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
340
+ # @param options [::Gapic::CallOptions, ::Hash]
341
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
342
+ #
343
+ # @overload delete_operation(name: nil)
344
+ # Pass arguments to `delete_operation` via keyword arguments. Note that at
345
+ # least one keyword argument is required. To specify no parameters, or to keep all
346
+ # the default parameter values, pass an empty Hash as a request object (see above).
347
+ #
348
+ # @param name [::String]
349
+ # The name of the operation resource to be deleted.
350
+ #
351
+ # @yield [response, operation] Access the result along with the RPC operation
352
+ # @yieldparam response [::Google::Protobuf::Empty]
353
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
354
+ #
355
+ # @return [::Google::Protobuf::Empty]
356
+ #
357
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
358
+ #
359
+ # @example Basic example
360
+ # require "google/longrunning"
361
+ #
362
+ # # Create a client object. The client can be reused for multiple calls.
363
+ # client = Google::Longrunning::Operations::Client.new
364
+ #
365
+ # # Create a request. To set request fields, pass in keyword arguments.
366
+ # request = Google::Longrunning::DeleteOperationRequest.new
367
+ #
368
+ # # Call the delete_operation method.
369
+ # result = client.delete_operation request
370
+ #
371
+ # # The returned object is of type Google::Protobuf::Empty.
372
+ # p result
373
+ #
374
+ def delete_operation request, options = nil
375
+ raise ::ArgumentError, "request must be provided" if request.nil?
376
+
377
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest
378
+
379
+ # Converts hash and nil to an options object
380
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
381
+
382
+ # Customize the options with defaults
383
+ metadata = @config.rpcs.delete_operation.metadata.to_h
384
+
385
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
386
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
387
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
388
+ gapic_version: ::Google::Cloud::Dataform::V1::VERSION
389
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
390
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
391
+
392
+ header_params = {}
393
+ if request.name
394
+ header_params["name"] = request.name
395
+ end
396
+
397
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
398
+ metadata[:"x-goog-request-params"] ||= request_params_header
399
+
400
+ options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
401
+ metadata: metadata,
402
+ retry_policy: @config.rpcs.delete_operation.retry_policy
403
+
404
+ options.apply_defaults timeout: @config.timeout,
405
+ metadata: @config.metadata,
406
+ retry_policy: @config.retry_policy
407
+
408
+ @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
+ yield response, operation if block_given?
410
+ end
411
+ rescue ::GRPC::BadStatus => e
412
+ raise ::Google::Cloud::Error.from_error(e)
413
+ end
414
+
415
+ ##
416
+ # Starts asynchronous cancellation on a long-running operation. The server
417
+ # makes a best effort to cancel the operation, but success is not
418
+ # guaranteed. If the server doesn't support this method, it returns
419
+ # `google.rpc.Code.UNIMPLEMENTED`. Clients can use
420
+ # Operations.GetOperation or
421
+ # other methods to check whether the cancellation succeeded or whether the
422
+ # operation completed despite cancellation. On successful cancellation,
423
+ # the operation is not deleted; instead, it becomes an operation with
424
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
425
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
426
+ # `Code.CANCELLED`.
427
+ #
428
+ # @overload cancel_operation(request, options = nil)
429
+ # Pass arguments to `cancel_operation` via a request object, either of type
430
+ # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash.
431
+ #
432
+ # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash]
433
+ # A request object representing the call parameters. Required. To specify no
434
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
435
+ # @param options [::Gapic::CallOptions, ::Hash]
436
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
437
+ #
438
+ # @overload cancel_operation(name: nil)
439
+ # Pass arguments to `cancel_operation` via keyword arguments. Note that at
440
+ # least one keyword argument is required. To specify no parameters, or to keep all
441
+ # the default parameter values, pass an empty Hash as a request object (see above).
442
+ #
443
+ # @param name [::String]
444
+ # The name of the operation resource to be cancelled.
445
+ #
446
+ # @yield [response, operation] Access the result along with the RPC operation
447
+ # @yieldparam response [::Google::Protobuf::Empty]
448
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
449
+ #
450
+ # @return [::Google::Protobuf::Empty]
451
+ #
452
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
453
+ #
454
+ # @example Basic example
455
+ # require "google/longrunning"
456
+ #
457
+ # # Create a client object. The client can be reused for multiple calls.
458
+ # client = Google::Longrunning::Operations::Client.new
459
+ #
460
+ # # Create a request. To set request fields, pass in keyword arguments.
461
+ # request = Google::Longrunning::CancelOperationRequest.new
462
+ #
463
+ # # Call the cancel_operation method.
464
+ # result = client.cancel_operation request
465
+ #
466
+ # # The returned object is of type Google::Protobuf::Empty.
467
+ # p result
468
+ #
469
+ def cancel_operation request, options = nil
470
+ raise ::ArgumentError, "request must be provided" if request.nil?
471
+
472
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest
473
+
474
+ # Converts hash and nil to an options object
475
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
476
+
477
+ # Customize the options with defaults
478
+ metadata = @config.rpcs.cancel_operation.metadata.to_h
479
+
480
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
481
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
482
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
483
+ gapic_version: ::Google::Cloud::Dataform::V1::VERSION
484
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
485
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
486
+
487
+ header_params = {}
488
+ if request.name
489
+ header_params["name"] = request.name
490
+ end
491
+
492
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
493
+ metadata[:"x-goog-request-params"] ||= request_params_header
494
+
495
+ options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
496
+ metadata: metadata,
497
+ retry_policy: @config.rpcs.cancel_operation.retry_policy
498
+
499
+ options.apply_defaults timeout: @config.timeout,
500
+ metadata: @config.metadata,
501
+ retry_policy: @config.retry_policy
502
+
503
+ @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
+ yield response, operation if block_given?
505
+ end
506
+ rescue ::GRPC::BadStatus => e
507
+ raise ::Google::Cloud::Error.from_error(e)
508
+ end
509
+
510
+ ##
511
+ # Waits until the specified long-running operation is done or reaches at most
512
+ # a specified timeout, returning the latest state. If the operation is
513
+ # already done, the latest state is immediately returned. If the timeout
514
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
515
+ # timeout is used. If the server does not support this method, it returns
516
+ # `google.rpc.Code.UNIMPLEMENTED`.
517
+ # Note that this method is on a best-effort basis. It may return the latest
518
+ # state before the specified timeout (including immediately), meaning even an
519
+ # immediate response is no guarantee that the operation is done.
520
+ #
521
+ # @overload wait_operation(request, options = nil)
522
+ # Pass arguments to `wait_operation` via a request object, either of type
523
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
524
+ #
525
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
526
+ # A request object representing the call parameters. Required. To specify no
527
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
528
+ # @param options [::Gapic::CallOptions, ::Hash]
529
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
530
+ #
531
+ # @overload wait_operation(name: nil, timeout: nil)
532
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
533
+ # least one keyword argument is required. To specify no parameters, or to keep all
534
+ # the default parameter values, pass an empty Hash as a request object (see above).
535
+ #
536
+ # @param name [::String]
537
+ # The name of the operation resource to wait on.
538
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
539
+ # The maximum duration to wait before timing out. If left blank, the wait
540
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
541
+ # If RPC context deadline is also specified, the shorter one will be used.
542
+ #
543
+ # @yield [response, operation] Access the result along with the RPC operation
544
+ # @yieldparam response [::Gapic::Operation]
545
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
546
+ #
547
+ # @return [::Gapic::Operation]
548
+ #
549
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
550
+ #
551
+ # @example Basic example
552
+ # require "google/longrunning"
553
+ #
554
+ # # Create a client object. The client can be reused for multiple calls.
555
+ # client = Google::Longrunning::Operations::Client.new
556
+ #
557
+ # # Create a request. To set request fields, pass in keyword arguments.
558
+ # request = Google::Longrunning::WaitOperationRequest.new
559
+ #
560
+ # # Call the wait_operation method.
561
+ # result = client.wait_operation request
562
+ #
563
+ # # The returned object is of type Gapic::Operation. You can use it to
564
+ # # check the status of an operation, cancel it, or wait for results.
565
+ # # Here is how to wait for a response.
566
+ # result.wait_until_done! timeout: 60
567
+ # if result.response?
568
+ # p result.response
569
+ # else
570
+ # puts "No response received."
571
+ # end
572
+ #
573
+ def wait_operation request, options = nil
574
+ raise ::ArgumentError, "request must be provided" if request.nil?
575
+
576
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
577
+
578
+ # Converts hash and nil to an options object
579
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
580
+
581
+ # Customize the options with defaults
582
+ metadata = @config.rpcs.wait_operation.metadata.to_h
583
+
584
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
585
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
586
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
587
+ gapic_version: ::Google::Cloud::Dataform::V1::VERSION
588
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
589
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
590
+
591
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
592
+ metadata: metadata,
593
+ retry_policy: @config.rpcs.wait_operation.retry_policy
594
+
595
+ options.apply_defaults timeout: @config.timeout,
596
+ metadata: @config.metadata,
597
+ retry_policy: @config.retry_policy
598
+
599
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
600
+ response = ::Gapic::Operation.new response, @operations_client, options: options
601
+ yield response, operation if block_given?
602
+ throw :response, response
603
+ end
604
+ rescue ::GRPC::BadStatus => e
605
+ raise ::Google::Cloud::Error.from_error(e)
606
+ end
607
+
608
+ ##
609
+ # Configuration class for the Operations API.
610
+ #
611
+ # This class represents the configuration for Operations,
612
+ # providing control over timeouts, retry behavior, logging, transport
613
+ # parameters, and other low-level controls. Certain parameters can also be
614
+ # applied individually to specific RPCs. See
615
+ # {::Google::Longrunning::Operations::Client::Configuration::Rpcs}
616
+ # for a list of RPCs that can be configured independently.
617
+ #
618
+ # Configuration can be applied globally to all clients, or to a single client
619
+ # on construction.
620
+ #
621
+ # @example
622
+ #
623
+ # # Modify the global config, setting the timeout for
624
+ # # list_operations to 20 seconds,
625
+ # # and all remaining timeouts to 10 seconds.
626
+ # ::Google::Longrunning::Operations::Client.configure do |config|
627
+ # config.timeout = 10.0
628
+ # config.rpcs.list_operations.timeout = 20.0
629
+ # end
630
+ #
631
+ # # Apply the above configuration only to a new client.
632
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
633
+ # config.timeout = 10.0
634
+ # config.rpcs.list_operations.timeout = 20.0
635
+ # end
636
+ #
637
+ # @!attribute [rw] endpoint
638
+ # A custom service endpoint, as a hostname or hostname:port. The default is
639
+ # nil, indicating to use the default endpoint in the current universe domain.
640
+ # @return [::String,nil]
641
+ # @!attribute [rw] credentials
642
+ # Credentials to send with calls. You may provide any of the following types:
643
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
644
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
645
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
646
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
647
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
648
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
649
+ # * (`nil`) indicating no credentials
650
+ #
651
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
652
+ # is deprecated. Providing an unvalidated credential configuration to
653
+ # Google APIs can compromise the security of your systems and data.
654
+ #
655
+ # @example
656
+ #
657
+ # # The recommended way to provide credentials is to use the `make_creds` method
658
+ # # on the appropriate credentials class for your environment.
659
+ #
660
+ # require "googleauth"
661
+ #
662
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
663
+ # json_key_io: ::File.open("/path/to/keyfile.json")
664
+ # )
665
+ #
666
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
667
+ # config.credentials = credentials
668
+ # end
669
+ #
670
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
671
+ # external source for authentication to Google Cloud, you must validate it before
672
+ # providing it to a Google API client library. Providing an unvalidated credential
673
+ # configuration to Google APIs can compromise the security of your systems and data.
674
+ # For more information, refer to [Validate credential configurations from external
675
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
676
+ # @return [::Object]
677
+ # @!attribute [rw] scope
678
+ # The OAuth scopes
679
+ # @return [::Array<::String>]
680
+ # @!attribute [rw] lib_name
681
+ # The library name as recorded in instrumentation and logging
682
+ # @return [::String]
683
+ # @!attribute [rw] lib_version
684
+ # The library version as recorded in instrumentation and logging
685
+ # @return [::String]
686
+ # @!attribute [rw] channel_args
687
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
688
+ # `GRPC::Core::Channel` object is provided as the credential.
689
+ # @return [::Hash]
690
+ # @!attribute [rw] interceptors
691
+ # An array of interceptors that are run before calls are executed.
692
+ # @return [::Array<::GRPC::ClientInterceptor>]
693
+ # @!attribute [rw] timeout
694
+ # The call timeout in seconds.
695
+ # @return [::Numeric]
696
+ # @!attribute [rw] metadata
697
+ # Additional gRPC headers to be sent with the call.
698
+ # @return [::Hash{::Symbol=>::String}]
699
+ # @!attribute [rw] retry_policy
700
+ # The retry policy. The value is a hash with the following keys:
701
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
702
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
703
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
704
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
705
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
706
+ # trigger a retry.
707
+ # @return [::Hash]
708
+ # @!attribute [rw] quota_project
709
+ # A separate project against which to charge quota.
710
+ # @return [::String]
711
+ # @!attribute [rw] universe_domain
712
+ # The universe domain within which to make requests. This determines the
713
+ # default endpoint URL. The default value of nil uses the environment
714
+ # universe (usually the default "googleapis.com" universe).
715
+ # @return [::String,nil]
716
+ # @!attribute [rw] logger
717
+ # A custom logger to use for request/response debug logging, or the value
718
+ # `:default` (the default) to construct a default logger, or `nil` to
719
+ # explicitly disable logging.
720
+ # @return [::Logger,:default,nil]
721
+ #
722
+ class Configuration
723
+ extend ::Gapic::Config
724
+
725
+ # @private
726
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
727
+ DEFAULT_ENDPOINT = "longrunning.googleapis.com"
728
+
729
+ config_attr :endpoint, nil, ::String, nil
730
+ config_attr :credentials, nil do |value|
731
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
732
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
733
+ allowed.any? { |klass| klass === value }
734
+ end
735
+ config_attr :scope, nil, ::String, ::Array, nil
736
+ config_attr :lib_name, nil, ::String, nil
737
+ config_attr :lib_version, nil, ::String, nil
738
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
739
+ config_attr :interceptors, nil, ::Array, nil
740
+ config_attr :timeout, nil, ::Numeric, nil
741
+ config_attr :metadata, nil, ::Hash, nil
742
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
743
+ config_attr :quota_project, nil, ::String, nil
744
+ config_attr :universe_domain, nil, ::String, nil
745
+ config_attr :logger, :default, ::Logger, nil, :default
746
+
747
+ # @private
748
+ def initialize parent_config = nil
749
+ @parent_config = parent_config unless parent_config.nil?
750
+
751
+ yield self if block_given?
752
+ end
753
+
754
+ ##
755
+ # Configurations for individual RPCs
756
+ # @return [Rpcs]
757
+ #
758
+ def rpcs
759
+ @rpcs ||= begin
760
+ parent_rpcs = nil
761
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
762
+ Rpcs.new parent_rpcs
763
+ end
764
+ end
765
+
766
+ ##
767
+ # Configuration for the channel pool
768
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
769
+ #
770
+ def channel_pool
771
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
772
+ end
773
+
774
+ ##
775
+ # Configuration RPC class for the Operations API.
776
+ #
777
+ # Includes fields providing the configuration for each RPC in this service.
778
+ # Each configuration object is of type `Gapic::Config::Method` and includes
779
+ # the following configuration fields:
780
+ #
781
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
782
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
783
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
784
+ # include the following keys:
785
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
786
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
787
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
788
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
789
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
790
+ # trigger a retry.
791
+ #
792
+ class Rpcs
793
+ ##
794
+ # RPC-specific configuration for `list_operations`
795
+ # @return [::Gapic::Config::Method]
796
+ #
797
+ attr_reader :list_operations
798
+ ##
799
+ # RPC-specific configuration for `get_operation`
800
+ # @return [::Gapic::Config::Method]
801
+ #
802
+ attr_reader :get_operation
803
+ ##
804
+ # RPC-specific configuration for `delete_operation`
805
+ # @return [::Gapic::Config::Method]
806
+ #
807
+ attr_reader :delete_operation
808
+ ##
809
+ # RPC-specific configuration for `cancel_operation`
810
+ # @return [::Gapic::Config::Method]
811
+ #
812
+ attr_reader :cancel_operation
813
+ ##
814
+ # RPC-specific configuration for `wait_operation`
815
+ # @return [::Gapic::Config::Method]
816
+ #
817
+ attr_reader :wait_operation
818
+
819
+ # @private
820
+ def initialize parent_rpcs = nil
821
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
822
+ @list_operations = ::Gapic::Config::Method.new list_operations_config
823
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
824
+ @get_operation = ::Gapic::Config::Method.new get_operation_config
825
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
826
+ @delete_operation = ::Gapic::Config::Method.new delete_operation_config
827
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
828
+ @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
829
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
830
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
831
+
832
+ yield self if block_given?
833
+ end
834
+ end
835
+ end
836
+ end
837
+ end
838
+ end
839
+ end