google-cloud-automl-v1 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +2 -2
  3. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +2 -2
  4. data/lib/google/cloud/automl/v1/automl/client.rb +441 -54
  5. data/lib/google/cloud/automl/v1/automl/operations.rb +115 -12
  6. data/lib/google/cloud/automl/v1/classification_pb.rb +1 -1
  7. data/lib/google/cloud/automl/v1/data_items_pb.rb +2 -2
  8. data/lib/google/cloud/automl/v1/dataset_pb.rb +2 -2
  9. data/lib/google/cloud/automl/v1/detection_pb.rb +2 -2
  10. data/lib/google/cloud/automl/v1/geometry_pb.rb +1 -1
  11. data/lib/google/cloud/automl/v1/image_pb.rb +2 -2
  12. data/lib/google/cloud/automl/v1/io_pb.rb +2 -2
  13. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +2 -2
  14. data/lib/google/cloud/automl/v1/model_pb.rb +2 -2
  15. data/lib/google/cloud/automl/v1/operations_pb.rb +2 -2
  16. data/lib/google/cloud/automl/v1/prediction_service/client.rb +47 -6
  17. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +115 -12
  18. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +2 -2
  19. data/lib/google/cloud/automl/v1/prediction_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/automl/v1/service_pb.rb +2 -2
  21. data/lib/google/cloud/automl/v1/service_services_pb.rb +1 -1
  22. data/lib/google/cloud/automl/v1/text_extraction_pb.rb +2 -2
  23. data/lib/google/cloud/automl/v1/text_pb.rb +2 -2
  24. data/lib/google/cloud/automl/v1/text_segment_pb.rb +1 -1
  25. data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +2 -2
  26. data/lib/google/cloud/automl/v1/translation_pb.rb +2 -2
  27. data/lib/google/cloud/automl/v1/version.rb +1 -1
  28. metadata +2 -2
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552
 
@@ -1,9 +1,9 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/classification.proto
3
3
 
4
+ require 'google/api/annotations_pb'
4
5
  require 'google/protobuf'
5
6
 
6
- require 'google/api/annotations_pb'
7
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
8
  add_file("google/cloud/automl/v1/classification.proto", :syntax => :proto3) do
9
9
  add_message "google.cloud.automl.v1.ClassificationAnnotation" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/data_items.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/cloud/automl/v1/geometry_pb'
7
5
  require 'google/cloud/automl/v1/io_pb'
8
6
  require 'google/cloud/automl/v1/text_segment_pb'
@@ -10,6 +8,8 @@ require 'google/protobuf/any_pb'
10
8
  require 'google/protobuf/duration_pb'
11
9
  require 'google/protobuf/struct_pb'
12
10
  require 'google/api/annotations_pb'
11
+ require 'google/protobuf'
12
+
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/cloud/automl/v1/data_items.proto", :syntax => :proto3) do
15
15
  add_message "google.cloud.automl.v1.Image" do
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/dataset.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/cloud/automl/v1/image_pb'
8
6
  require 'google/cloud/automl/v1/text_pb'
9
7
  require 'google/cloud/automl/v1/translation_pb'
10
8
  require 'google/protobuf/timestamp_pb'
11
9
  require 'google/api/annotations_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/automl/v1/dataset.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.automl.v1.Dataset" do
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/detection.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/cloud/automl/v1/geometry_pb'
7
5
  require 'google/protobuf/duration_pb'
8
6
  require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/cloud/automl/v1/detection.proto", :syntax => :proto3) do
11
11
  add_message "google.cloud.automl.v1.ImageObjectDetectionAnnotation" do
@@ -1,9 +1,9 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/geometry.proto
3
3
 
4
+ require 'google/api/annotations_pb'
4
5
  require 'google/protobuf'
5
6
 
6
- require 'google/api/annotations_pb'
7
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
8
  add_file("google/cloud/automl/v1/geometry.proto", :syntax => :proto3) do
9
9
  add_message "google.cloud.automl.v1.NormalizedVertex" do
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/image.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/cloud/automl/v1/annotation_spec_pb'
8
6
  require 'google/cloud/automl/v1/classification_pb'
9
7
  require 'google/protobuf/timestamp_pb'
10
8
  require 'google/api/annotations_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/automl/v1/image.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.automl.v1.ImageClassificationDatasetMetadata" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/io.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/annotations_pb'
6
+ require 'google/protobuf'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/automl/v1/io.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.automl.v1.InputConfig" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/model_evaluation.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/cloud/automl/v1/classification_pb'
8
6
  require 'google/cloud/automl/v1/detection_pb'
@@ -11,6 +9,8 @@ require 'google/cloud/automl/v1/text_sentiment_pb'
11
9
  require 'google/cloud/automl/v1/translation_pb'
12
10
  require 'google/protobuf/timestamp_pb'
13
11
  require 'google/api/annotations_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/automl/v1/model_evaluation.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.automl.v1.ModelEvaluation" do
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/model.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/cloud/automl/v1/image_pb'
8
6
  require 'google/cloud/automl/v1/text_pb'
9
7
  require 'google/cloud/automl/v1/translation_pb'
10
8
  require 'google/protobuf/timestamp_pb'
11
9
  require 'google/api/annotations_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/automl/v1/model.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.automl.v1.Model" do
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/operations.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/cloud/automl/v1/dataset_pb'
7
5
  require 'google/cloud/automl/v1/io_pb'
8
6
  require 'google/protobuf/timestamp_pb'
9
7
  require 'google/rpc/status_pb'
10
8
  require 'google/api/annotations_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/automl/v1/operations.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.automl.v1.OperationMetadata" do
@@ -262,6 +262,21 @@ module Google
262
262
  #
263
263
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
264
  #
265
+ # @example Basic example
266
+ # require "google/cloud/automl/v1"
267
+ #
268
+ # # Create a client object. The client can be reused for multiple calls.
269
+ # client = Google::Cloud::AutoML::V1::PredictionService::Client.new
270
+ #
271
+ # # Create a request. To set request fields, pass in keyword arguments.
272
+ # request = Google::Cloud::AutoML::V1::PredictRequest.new
273
+ #
274
+ # # Call the predict method.
275
+ # result = client.predict request
276
+ #
277
+ # # The returned object is of type Google::Cloud::AutoML::V1::PredictResponse.
278
+ # p result
279
+ #
265
280
  def predict request, options = nil
266
281
  raise ::ArgumentError, "request must be provided" if request.nil?
267
282
 
@@ -279,9 +294,11 @@ module Google
279
294
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
280
295
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
296
 
282
- header_params = {
283
- "name" => request.name
284
- }
297
+ header_params = {}
298
+ if request.name
299
+ header_params["name"] = request.name
300
+ end
301
+
285
302
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
303
  metadata[:"x-goog-request-params"] ||= request_params_header
287
304
 
@@ -433,6 +450,28 @@ module Google
433
450
  #
434
451
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
435
452
  #
453
+ # @example Basic example
454
+ # require "google/cloud/automl/v1"
455
+ #
456
+ # # Create a client object. The client can be reused for multiple calls.
457
+ # client = Google::Cloud::AutoML::V1::PredictionService::Client.new
458
+ #
459
+ # # Create a request. To set request fields, pass in keyword arguments.
460
+ # request = Google::Cloud::AutoML::V1::BatchPredictRequest.new
461
+ #
462
+ # # Call the batch_predict method.
463
+ # result = client.batch_predict request
464
+ #
465
+ # # The returned object is of type Gapic::Operation. You can use this
466
+ # # object to check the status of an operation, cancel it, or wait
467
+ # # for results. Here is how to block until completion:
468
+ # result.wait_until_done! timeout: 60
469
+ # if result.response?
470
+ # p result.response
471
+ # else
472
+ # puts "Error!"
473
+ # end
474
+ #
436
475
  def batch_predict request, options = nil
437
476
  raise ::ArgumentError, "request must be provided" if request.nil?
438
477
 
@@ -450,9 +489,11 @@ module Google
450
489
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
451
490
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
452
491
 
453
- header_params = {
454
- "name" => request.name
455
- }
492
+ header_params = {}
493
+ if request.name
494
+ header_params["name"] = request.name
495
+ end
496
+
456
497
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
457
498
  metadata[:"x-goog-request-params"] ||= request_params_header
458
499
 
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552
 
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/prediction_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -12,6 +10,8 @@ require 'google/cloud/automl/v1/data_items_pb'
12
10
  require 'google/cloud/automl/v1/io_pb'
13
11
  require 'google/cloud/automl/v1/operations_pb'
14
12
  require 'google/longrunning/operations_pb'
13
+ require 'google/protobuf'
14
+
15
15
  Google::Protobuf::DescriptorPool.generated_pool.build do
16
16
  add_file("google/cloud/automl/v1/prediction_service.proto", :syntax => :proto3) do
17
17
  add_message "google.cloud.automl.v1.PredictRequest" do
@@ -30,7 +30,7 @@ module Google
30
30
  # snake_case or kebab-case, either of those cases is accepted.
31
31
  class Service
32
32
 
33
- include GRPC::GenericService
33
+ include ::GRPC::GenericService
34
34
 
35
35
  self.marshal_class_method = :encode
36
36
  self.unmarshal_class_method = :decode
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/automl/v1/service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -17,6 +15,8 @@ require 'google/cloud/automl/v1/model_evaluation_pb'
17
15
  require 'google/cloud/automl/v1/operations_pb'
18
16
  require 'google/longrunning/operations_pb'
19
17
  require 'google/protobuf/field_mask_pb'
18
+ require 'google/protobuf'
19
+
20
20
  Google::Protobuf::DescriptorPool.generated_pool.build do
21
21
  add_file("google/cloud/automl/v1/service.proto", :syntax => :proto3) do
22
22
  add_message "google.cloud.automl.v1.CreateDatasetRequest" do