google-cloud-automl-v1beta1 0.5.1 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +15 -33
  4. data/README.md +1 -1
  5. data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +2 -2
  6. data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +2 -2
  7. data/lib/google/cloud/automl/v1beta1/automl/client.rb +693 -185
  8. data/lib/google/cloud/automl/v1beta1/automl/operations.rb +149 -37
  9. data/lib/google/cloud/automl/v1beta1/classification_pb.rb +2 -2
  10. data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +2 -2
  11. data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +2 -2
  12. data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +1 -1
  13. data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +1 -1
  14. data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +2 -2
  15. data/lib/google/cloud/automl/v1beta1/detection_pb.rb +2 -2
  16. data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +1 -1
  17. data/lib/google/cloud/automl/v1beta1/image_pb.rb +2 -2
  18. data/lib/google/cloud/automl/v1beta1/io_pb.rb +1 -1
  19. data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +2 -2
  20. data/lib/google/cloud/automl/v1beta1/model_pb.rb +2 -2
  21. data/lib/google/cloud/automl/v1beta1/operations_pb.rb +2 -2
  22. data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +84 -45
  23. data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +149 -37
  24. data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +2 -2
  25. data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +1 -1
  26. data/lib/google/cloud/automl/v1beta1/regression_pb.rb +1 -1
  27. data/lib/google/cloud/automl/v1beta1/service_pb.rb +2 -2
  28. data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +2 -2
  29. data/lib/google/cloud/automl/v1beta1/tables_pb.rb +2 -2
  30. data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +2 -2
  31. data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +2 -2
  32. data/lib/google/cloud/automl/v1beta1/text_pb.rb +2 -2
  33. data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +1 -1
  34. data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +2 -2
  35. data/lib/google/cloud/automl/v1beta1/translation_pb.rb +2 -2
  36. data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
  37. data/lib/google/cloud/automl/v1beta1/video_pb.rb +2 -2
  38. data/proto_docs/google/api/field_behavior.rb +7 -1
  39. data/proto_docs/google/api/resource.rb +10 -71
  40. data/proto_docs/google/cloud/automl/v1beta1/service.rb +5 -4
  41. metadata +5 -5
@@ -54,13 +54,12 @@ module Google
54
54
  # See {::Google::Cloud::AutoML::V1beta1::AutoML::Client::Configuration}
55
55
  # for a description of the configuration fields.
56
56
  #
57
- # ## Example
57
+ # @example
58
58
  #
59
- # To modify the configuration for all AutoMl clients:
60
- #
61
- # ::Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
62
- # config.timeout = 10.0
63
- # end
59
+ # # Modify the configuration for all AutoMl clients
60
+ # ::Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
61
+ # config.timeout = 10.0
62
+ # end
64
63
  #
65
64
  # @yield [config] Configure the Client client.
66
65
  # @yieldparam config [Client::Configuration]
@@ -82,28 +81,19 @@ module Google
82
81
 
83
82
  default_config.rpcs.get_dataset.timeout = 5.0
84
83
  default_config.rpcs.get_dataset.retry_policy = {
85
- initial_delay: 0.1,
86
- max_delay: 60.0,
87
- multiplier: 1.3,
88
- retry_codes: [14, 4]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
89
85
  }
90
86
 
91
87
  default_config.rpcs.list_datasets.timeout = 5.0
92
88
  default_config.rpcs.list_datasets.retry_policy = {
93
- initial_delay: 0.1,
94
- max_delay: 60.0,
95
- multiplier: 1.3,
96
- retry_codes: [14, 4]
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
97
90
  }
98
91
 
99
92
  default_config.rpcs.update_dataset.timeout = 5.0
100
93
 
101
94
  default_config.rpcs.delete_dataset.timeout = 5.0
102
95
  default_config.rpcs.delete_dataset.retry_policy = {
103
- initial_delay: 0.1,
104
- max_delay: 60.0,
105
- multiplier: 1.3,
106
- retry_codes: [14, 4]
96
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
107
97
  }
108
98
 
109
99
  default_config.rpcs.import_data.timeout = 5.0
@@ -112,44 +102,29 @@ module Google
112
102
 
113
103
  default_config.rpcs.get_annotation_spec.timeout = 5.0
114
104
  default_config.rpcs.get_annotation_spec.retry_policy = {
115
- initial_delay: 0.1,
116
- max_delay: 60.0,
117
- multiplier: 1.3,
118
- retry_codes: [14, 4]
105
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
119
106
  }
120
107
 
121
108
  default_config.rpcs.get_table_spec.timeout = 5.0
122
109
  default_config.rpcs.get_table_spec.retry_policy = {
123
- initial_delay: 0.1,
124
- max_delay: 60.0,
125
- multiplier: 1.3,
126
- retry_codes: [14, 4]
110
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
127
111
  }
128
112
 
129
113
  default_config.rpcs.list_table_specs.timeout = 5.0
130
114
  default_config.rpcs.list_table_specs.retry_policy = {
131
- initial_delay: 0.1,
132
- max_delay: 60.0,
133
- multiplier: 1.3,
134
- retry_codes: [14, 4]
115
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
135
116
  }
136
117
 
137
118
  default_config.rpcs.update_table_spec.timeout = 5.0
138
119
 
139
120
  default_config.rpcs.get_column_spec.timeout = 5.0
140
121
  default_config.rpcs.get_column_spec.retry_policy = {
141
- initial_delay: 0.1,
142
- max_delay: 60.0,
143
- multiplier: 1.3,
144
- retry_codes: [14, 4]
122
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
145
123
  }
146
124
 
147
125
  default_config.rpcs.list_column_specs.timeout = 5.0
148
126
  default_config.rpcs.list_column_specs.retry_policy = {
149
- initial_delay: 0.1,
150
- max_delay: 60.0,
151
- multiplier: 1.3,
152
- retry_codes: [14, 4]
127
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
153
128
  }
154
129
 
155
130
  default_config.rpcs.update_column_spec.timeout = 5.0
@@ -158,26 +133,17 @@ module Google
158
133
 
159
134
  default_config.rpcs.get_model.timeout = 5.0
160
135
  default_config.rpcs.get_model.retry_policy = {
161
- initial_delay: 0.1,
162
- max_delay: 60.0,
163
- multiplier: 1.3,
164
- retry_codes: [14, 4]
136
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
165
137
  }
166
138
 
167
139
  default_config.rpcs.list_models.timeout = 5.0
168
140
  default_config.rpcs.list_models.retry_policy = {
169
- initial_delay: 0.1,
170
- max_delay: 60.0,
171
- multiplier: 1.3,
172
- retry_codes: [14, 4]
141
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
173
142
  }
174
143
 
175
144
  default_config.rpcs.delete_model.timeout = 5.0
176
145
  default_config.rpcs.delete_model.retry_policy = {
177
- initial_delay: 0.1,
178
- max_delay: 60.0,
179
- multiplier: 1.3,
180
- retry_codes: [14, 4]
146
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
181
147
  }
182
148
 
183
149
  default_config.rpcs.deploy_model.timeout = 5.0
@@ -190,10 +156,7 @@ module Google
190
156
 
191
157
  default_config.rpcs.get_model_evaluation.timeout = 5.0
192
158
  default_config.rpcs.get_model_evaluation.retry_policy = {
193
- initial_delay: 0.1,
194
- max_delay: 60.0,
195
- multiplier: 1.3,
196
- retry_codes: [14, 4]
159
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
197
160
  }
198
161
 
199
162
  default_config.rpcs.list_model_evaluations.timeout = 5.0
@@ -227,19 +190,15 @@ module Google
227
190
  ##
228
191
  # Create a new AutoMl client object.
229
192
  #
230
- # ## Examples
231
- #
232
- # To create a new AutoMl client with the default
233
- # configuration:
193
+ # @example
234
194
  #
235
- # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new
195
+ # # Create a client using the default configuration
196
+ # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new
236
197
  #
237
- # To create a new AutoMl client with a custom
238
- # configuration:
239
- #
240
- # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config|
241
- # config.timeout = 10.0
242
- # end
198
+ # # Create a client using a custom configuration
199
+ # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config|
200
+ # config.timeout = 10.0
201
+ # end
243
202
  #
244
203
  # @yield [config] Configure the AutoMl client.
245
204
  # @yieldparam config [Client::Configuration]
@@ -259,14 +218,13 @@ module Google
259
218
 
260
219
  # Create credentials
261
220
  credentials = @config.credentials
262
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
221
+ # Use self-signed JWT if the endpoint is unchanged from default,
263
222
  # but only if the default endpoint does not have a region prefix.
264
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
265
- @config.endpoint == Client.configure.endpoint &&
223
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
266
224
  !@config.endpoint.split(".").first.include?("-")
267
225
  credentials ||= Credentials.default scope: @config.scope,
268
226
  enable_self_signed_jwt: enable_self_signed_jwt
269
- if credentials.is_a?(String) || credentials.is_a?(Hash)
227
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
270
228
  credentials = Credentials.new credentials, scope: @config.scope
271
229
  end
272
230
  @quota_project_id = @config.quota_project
@@ -274,6 +232,7 @@ module Google
274
232
 
275
233
  @operations_client = Operations.new do |config|
276
234
  config.credentials = credentials
235
+ config.quota_project = @quota_project_id
277
236
  config.endpoint = @config.endpoint
278
237
  end
279
238
 
@@ -326,6 +285,21 @@ module Google
326
285
  #
327
286
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
328
287
  #
288
+ # @example Basic example
289
+ # require "google/cloud/automl/v1beta1"
290
+ #
291
+ # # Create a client object. The client can be reused for multiple calls.
292
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
293
+ #
294
+ # # Create a request. To set request fields, pass in keyword arguments.
295
+ # request = Google::Cloud::AutoML::V1beta1::CreateDatasetRequest.new
296
+ #
297
+ # # Call the create_dataset method.
298
+ # result = client.create_dataset request
299
+ #
300
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset.
301
+ # p result
302
+ #
329
303
  def create_dataset request, options = nil
330
304
  raise ::ArgumentError, "request must be provided" if request.nil?
331
305
 
@@ -343,16 +317,20 @@ module Google
343
317
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
344
318
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
345
319
 
346
- header_params = {
347
- "parent" => request.parent
348
- }
320
+ header_params = {}
321
+ if request.parent
322
+ header_params["parent"] = request.parent
323
+ end
324
+
349
325
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
350
326
  metadata[:"x-goog-request-params"] ||= request_params_header
351
327
 
352
328
  options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
353
329
  metadata: metadata,
354
330
  retry_policy: @config.rpcs.create_dataset.retry_policy
355
- options.apply_defaults metadata: @config.metadata,
331
+
332
+ options.apply_defaults timeout: @config.timeout,
333
+ metadata: @config.metadata,
356
334
  retry_policy: @config.retry_policy
357
335
 
358
336
  @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
@@ -392,6 +370,21 @@ module Google
392
370
  #
393
371
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
394
372
  #
373
+ # @example Basic example
374
+ # require "google/cloud/automl/v1beta1"
375
+ #
376
+ # # Create a client object. The client can be reused for multiple calls.
377
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
378
+ #
379
+ # # Create a request. To set request fields, pass in keyword arguments.
380
+ # request = Google::Cloud::AutoML::V1beta1::GetDatasetRequest.new
381
+ #
382
+ # # Call the get_dataset method.
383
+ # result = client.get_dataset request
384
+ #
385
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset.
386
+ # p result
387
+ #
395
388
  def get_dataset request, options = nil
396
389
  raise ::ArgumentError, "request must be provided" if request.nil?
397
390
 
@@ -409,16 +402,20 @@ module Google
409
402
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
410
403
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
404
 
412
- header_params = {
413
- "name" => request.name
414
- }
405
+ header_params = {}
406
+ if request.name
407
+ header_params["name"] = request.name
408
+ end
409
+
415
410
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
416
411
  metadata[:"x-goog-request-params"] ||= request_params_header
417
412
 
418
413
  options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
419
414
  metadata: metadata,
420
415
  retry_policy: @config.rpcs.get_dataset.retry_policy
421
- options.apply_defaults metadata: @config.metadata,
416
+
417
+ options.apply_defaults timeout: @config.timeout,
418
+ metadata: @config.metadata,
422
419
  retry_policy: @config.retry_policy
423
420
 
424
421
  @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
@@ -453,10 +450,11 @@ module Google
453
450
  # An expression for filtering the results of the request.
454
451
  #
455
452
  # * `dataset_metadata` - for existence of the case (e.g.
456
- # image_classification_dataset_metadata:*). Some examples of using the filter are:
453
+ # `image_classification_dataset_metadata:*`). Some examples of
454
+ # using the filter are:
457
455
  #
458
456
  # * `translation_dataset_metadata:*` --> The dataset has
459
- # translation_dataset_metadata.
457
+ # `translation_dataset_metadata`.
460
458
  # @param page_size [::Integer]
461
459
  # Requested page size. Server may return fewer results than requested.
462
460
  # If unspecified, server will pick a default size.
@@ -474,6 +472,27 @@ module Google
474
472
  #
475
473
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
476
474
  #
475
+ # @example Basic example
476
+ # require "google/cloud/automl/v1beta1"
477
+ #
478
+ # # Create a client object. The client can be reused for multiple calls.
479
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
480
+ #
481
+ # # Create a request. To set request fields, pass in keyword arguments.
482
+ # request = Google::Cloud::AutoML::V1beta1::ListDatasetsRequest.new
483
+ #
484
+ # # Call the list_datasets method.
485
+ # result = client.list_datasets request
486
+ #
487
+ # # The returned object is of type Gapic::PagedEnumerable. You can
488
+ # # iterate over all elements by calling #each, and the enumerable
489
+ # # will lazily make API calls to fetch subsequent pages. Other
490
+ # # methods are also available for managing paging directly.
491
+ # result.each do |response|
492
+ # # Each element is of type ::Google::Cloud::AutoML::V1beta1::Dataset.
493
+ # p response
494
+ # end
495
+ #
477
496
  def list_datasets request, options = nil
478
497
  raise ::ArgumentError, "request must be provided" if request.nil?
479
498
 
@@ -491,16 +510,20 @@ module Google
491
510
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
492
511
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
493
512
 
494
- header_params = {
495
- "parent" => request.parent
496
- }
513
+ header_params = {}
514
+ if request.parent
515
+ header_params["parent"] = request.parent
516
+ end
517
+
497
518
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
498
519
  metadata[:"x-goog-request-params"] ||= request_params_header
499
520
 
500
521
  options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
501
522
  metadata: metadata,
502
523
  retry_policy: @config.rpcs.list_datasets.retry_policy
503
- options.apply_defaults metadata: @config.metadata,
524
+
525
+ options.apply_defaults timeout: @config.timeout,
526
+ metadata: @config.metadata,
504
527
  retry_policy: @config.retry_policy
505
528
 
506
529
  @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
@@ -543,6 +566,21 @@ module Google
543
566
  #
544
567
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
545
568
  #
569
+ # @example Basic example
570
+ # require "google/cloud/automl/v1beta1"
571
+ #
572
+ # # Create a client object. The client can be reused for multiple calls.
573
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
574
+ #
575
+ # # Create a request. To set request fields, pass in keyword arguments.
576
+ # request = Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest.new
577
+ #
578
+ # # Call the update_dataset method.
579
+ # result = client.update_dataset request
580
+ #
581
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset.
582
+ # p result
583
+ #
546
584
  def update_dataset request, options = nil
547
585
  raise ::ArgumentError, "request must be provided" if request.nil?
548
586
 
@@ -560,16 +598,20 @@ module Google
560
598
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
561
599
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
600
 
563
- header_params = {
564
- "dataset.name" => request.dataset.name
565
- }
601
+ header_params = {}
602
+ if request.dataset&.name
603
+ header_params["dataset.name"] = request.dataset.name
604
+ end
605
+
566
606
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
567
607
  metadata[:"x-goog-request-params"] ||= request_params_header
568
608
 
569
609
  options.apply_defaults timeout: @config.rpcs.update_dataset.timeout,
570
610
  metadata: metadata,
571
611
  retry_policy: @config.rpcs.update_dataset.retry_policy
572
- options.apply_defaults metadata: @config.metadata,
612
+
613
+ options.apply_defaults timeout: @config.timeout,
614
+ metadata: @config.metadata,
573
615
  retry_policy: @config.retry_policy
574
616
 
575
617
  @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
@@ -613,6 +655,28 @@ module Google
613
655
  #
614
656
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
615
657
  #
658
+ # @example Basic example
659
+ # require "google/cloud/automl/v1beta1"
660
+ #
661
+ # # Create a client object. The client can be reused for multiple calls.
662
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
663
+ #
664
+ # # Create a request. To set request fields, pass in keyword arguments.
665
+ # request = Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest.new
666
+ #
667
+ # # Call the delete_dataset method.
668
+ # result = client.delete_dataset request
669
+ #
670
+ # # The returned object is of type Gapic::Operation. You can use this
671
+ # # object to check the status of an operation, cancel it, or wait
672
+ # # for results. Here is how to block until completion:
673
+ # result.wait_until_done! timeout: 60
674
+ # if result.response?
675
+ # p result.response
676
+ # else
677
+ # puts "Error!"
678
+ # end
679
+ #
616
680
  def delete_dataset request, options = nil
617
681
  raise ::ArgumentError, "request must be provided" if request.nil?
618
682
 
@@ -630,16 +694,20 @@ module Google
630
694
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
631
695
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
632
696
 
633
- header_params = {
634
- "name" => request.name
635
- }
697
+ header_params = {}
698
+ if request.name
699
+ header_params["name"] = request.name
700
+ end
701
+
636
702
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
637
703
  metadata[:"x-goog-request-params"] ||= request_params_header
638
704
 
639
705
  options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
640
706
  metadata: metadata,
641
707
  retry_policy: @config.rpcs.delete_dataset.retry_policy
642
- options.apply_defaults metadata: @config.metadata,
708
+
709
+ options.apply_defaults timeout: @config.timeout,
710
+ metadata: @config.metadata,
643
711
  retry_policy: @config.retry_policy
644
712
 
645
713
  @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
@@ -692,6 +760,28 @@ module Google
692
760
  #
693
761
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
694
762
  #
763
+ # @example Basic example
764
+ # require "google/cloud/automl/v1beta1"
765
+ #
766
+ # # Create a client object. The client can be reused for multiple calls.
767
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
768
+ #
769
+ # # Create a request. To set request fields, pass in keyword arguments.
770
+ # request = Google::Cloud::AutoML::V1beta1::ImportDataRequest.new
771
+ #
772
+ # # Call the import_data method.
773
+ # result = client.import_data request
774
+ #
775
+ # # The returned object is of type Gapic::Operation. You can use this
776
+ # # object to check the status of an operation, cancel it, or wait
777
+ # # for results. Here is how to block until completion:
778
+ # result.wait_until_done! timeout: 60
779
+ # if result.response?
780
+ # p result.response
781
+ # else
782
+ # puts "Error!"
783
+ # end
784
+ #
695
785
  def import_data request, options = nil
696
786
  raise ::ArgumentError, "request must be provided" if request.nil?
697
787
 
@@ -709,16 +799,20 @@ module Google
709
799
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
710
800
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
711
801
 
712
- header_params = {
713
- "name" => request.name
714
- }
802
+ header_params = {}
803
+ if request.name
804
+ header_params["name"] = request.name
805
+ end
806
+
715
807
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
716
808
  metadata[:"x-goog-request-params"] ||= request_params_header
717
809
 
718
810
  options.apply_defaults timeout: @config.rpcs.import_data.timeout,
719
811
  metadata: metadata,
720
812
  retry_policy: @config.rpcs.import_data.retry_policy
721
- options.apply_defaults metadata: @config.metadata,
813
+
814
+ options.apply_defaults timeout: @config.timeout,
815
+ metadata: @config.metadata,
722
816
  retry_policy: @config.retry_policy
723
817
 
724
818
  @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
@@ -763,6 +857,28 @@ module Google
763
857
  #
764
858
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
765
859
  #
860
+ # @example Basic example
861
+ # require "google/cloud/automl/v1beta1"
862
+ #
863
+ # # Create a client object. The client can be reused for multiple calls.
864
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
865
+ #
866
+ # # Create a request. To set request fields, pass in keyword arguments.
867
+ # request = Google::Cloud::AutoML::V1beta1::ExportDataRequest.new
868
+ #
869
+ # # Call the export_data method.
870
+ # result = client.export_data request
871
+ #
872
+ # # The returned object is of type Gapic::Operation. You can use this
873
+ # # object to check the status of an operation, cancel it, or wait
874
+ # # for results. Here is how to block until completion:
875
+ # result.wait_until_done! timeout: 60
876
+ # if result.response?
877
+ # p result.response
878
+ # else
879
+ # puts "Error!"
880
+ # end
881
+ #
766
882
  def export_data request, options = nil
767
883
  raise ::ArgumentError, "request must be provided" if request.nil?
768
884
 
@@ -780,16 +896,20 @@ module Google
780
896
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
781
897
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
782
898
 
783
- header_params = {
784
- "name" => request.name
785
- }
899
+ header_params = {}
900
+ if request.name
901
+ header_params["name"] = request.name
902
+ end
903
+
786
904
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
787
905
  metadata[:"x-goog-request-params"] ||= request_params_header
788
906
 
789
907
  options.apply_defaults timeout: @config.rpcs.export_data.timeout,
790
908
  metadata: metadata,
791
909
  retry_policy: @config.rpcs.export_data.retry_policy
792
- options.apply_defaults metadata: @config.metadata,
910
+
911
+ options.apply_defaults timeout: @config.timeout,
912
+ metadata: @config.metadata,
793
913
  retry_policy: @config.retry_policy
794
914
 
795
915
  @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
@@ -830,6 +950,21 @@ module Google
830
950
  #
831
951
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
832
952
  #
953
+ # @example Basic example
954
+ # require "google/cloud/automl/v1beta1"
955
+ #
956
+ # # Create a client object. The client can be reused for multiple calls.
957
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
958
+ #
959
+ # # Create a request. To set request fields, pass in keyword arguments.
960
+ # request = Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest.new
961
+ #
962
+ # # Call the get_annotation_spec method.
963
+ # result = client.get_annotation_spec request
964
+ #
965
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::AnnotationSpec.
966
+ # p result
967
+ #
833
968
  def get_annotation_spec request, options = nil
834
969
  raise ::ArgumentError, "request must be provided" if request.nil?
835
970
 
@@ -847,16 +982,20 @@ module Google
847
982
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
848
983
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
849
984
 
850
- header_params = {
851
- "name" => request.name
852
- }
985
+ header_params = {}
986
+ if request.name
987
+ header_params["name"] = request.name
988
+ end
989
+
853
990
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
854
991
  metadata[:"x-goog-request-params"] ||= request_params_header
855
992
 
856
993
  options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout,
857
994
  metadata: metadata,
858
995
  retry_policy: @config.rpcs.get_annotation_spec.retry_policy
859
- options.apply_defaults metadata: @config.metadata,
996
+
997
+ options.apply_defaults timeout: @config.timeout,
998
+ metadata: @config.metadata,
860
999
  retry_policy: @config.retry_policy
861
1000
 
862
1001
  @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
@@ -898,6 +1037,21 @@ module Google
898
1037
  #
899
1038
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
900
1039
  #
1040
+ # @example Basic example
1041
+ # require "google/cloud/automl/v1beta1"
1042
+ #
1043
+ # # Create a client object. The client can be reused for multiple calls.
1044
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1045
+ #
1046
+ # # Create a request. To set request fields, pass in keyword arguments.
1047
+ # request = Google::Cloud::AutoML::V1beta1::GetTableSpecRequest.new
1048
+ #
1049
+ # # Call the get_table_spec method.
1050
+ # result = client.get_table_spec request
1051
+ #
1052
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec.
1053
+ # p result
1054
+ #
901
1055
  def get_table_spec request, options = nil
902
1056
  raise ::ArgumentError, "request must be provided" if request.nil?
903
1057
 
@@ -915,16 +1069,20 @@ module Google
915
1069
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
916
1070
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
917
1071
 
918
- header_params = {
919
- "name" => request.name
920
- }
1072
+ header_params = {}
1073
+ if request.name
1074
+ header_params["name"] = request.name
1075
+ end
1076
+
921
1077
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
922
1078
  metadata[:"x-goog-request-params"] ||= request_params_header
923
1079
 
924
1080
  options.apply_defaults timeout: @config.rpcs.get_table_spec.timeout,
925
1081
  metadata: metadata,
926
1082
  retry_policy: @config.rpcs.get_table_spec.retry_policy
927
- options.apply_defaults metadata: @config.metadata,
1083
+
1084
+ options.apply_defaults timeout: @config.timeout,
1085
+ metadata: @config.metadata,
928
1086
  retry_policy: @config.retry_policy
929
1087
 
930
1088
  @auto_ml_stub.call_rpc :get_table_spec, request, options: options do |response, operation|
@@ -976,6 +1134,27 @@ module Google
976
1134
  #
977
1135
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
978
1136
  #
1137
+ # @example Basic example
1138
+ # require "google/cloud/automl/v1beta1"
1139
+ #
1140
+ # # Create a client object. The client can be reused for multiple calls.
1141
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1142
+ #
1143
+ # # Create a request. To set request fields, pass in keyword arguments.
1144
+ # request = Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest.new
1145
+ #
1146
+ # # Call the list_table_specs method.
1147
+ # result = client.list_table_specs request
1148
+ #
1149
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1150
+ # # iterate over all elements by calling #each, and the enumerable
1151
+ # # will lazily make API calls to fetch subsequent pages. Other
1152
+ # # methods are also available for managing paging directly.
1153
+ # result.each do |response|
1154
+ # # Each element is of type ::Google::Cloud::AutoML::V1beta1::TableSpec.
1155
+ # p response
1156
+ # end
1157
+ #
979
1158
  def list_table_specs request, options = nil
980
1159
  raise ::ArgumentError, "request must be provided" if request.nil?
981
1160
 
@@ -993,16 +1172,20 @@ module Google
993
1172
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
994
1173
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
995
1174
 
996
- header_params = {
997
- "parent" => request.parent
998
- }
1175
+ header_params = {}
1176
+ if request.parent
1177
+ header_params["parent"] = request.parent
1178
+ end
1179
+
999
1180
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1000
1181
  metadata[:"x-goog-request-params"] ||= request_params_header
1001
1182
 
1002
1183
  options.apply_defaults timeout: @config.rpcs.list_table_specs.timeout,
1003
1184
  metadata: metadata,
1004
1185
  retry_policy: @config.rpcs.list_table_specs.retry_policy
1005
- options.apply_defaults metadata: @config.metadata,
1186
+
1187
+ options.apply_defaults timeout: @config.timeout,
1188
+ metadata: @config.metadata,
1006
1189
  retry_policy: @config.retry_policy
1007
1190
 
1008
1191
  @auto_ml_stub.call_rpc :list_table_specs, request, options: options do |response, operation|
@@ -1045,6 +1228,21 @@ module Google
1045
1228
  #
1046
1229
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1047
1230
  #
1231
+ # @example Basic example
1232
+ # require "google/cloud/automl/v1beta1"
1233
+ #
1234
+ # # Create a client object. The client can be reused for multiple calls.
1235
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1236
+ #
1237
+ # # Create a request. To set request fields, pass in keyword arguments.
1238
+ # request = Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest.new
1239
+ #
1240
+ # # Call the update_table_spec method.
1241
+ # result = client.update_table_spec request
1242
+ #
1243
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec.
1244
+ # p result
1245
+ #
1048
1246
  def update_table_spec request, options = nil
1049
1247
  raise ::ArgumentError, "request must be provided" if request.nil?
1050
1248
 
@@ -1062,16 +1260,20 @@ module Google
1062
1260
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1063
1261
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1064
1262
 
1065
- header_params = {
1066
- "table_spec.name" => request.table_spec.name
1067
- }
1263
+ header_params = {}
1264
+ if request.table_spec&.name
1265
+ header_params["table_spec.name"] = request.table_spec.name
1266
+ end
1267
+
1068
1268
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1069
1269
  metadata[:"x-goog-request-params"] ||= request_params_header
1070
1270
 
1071
1271
  options.apply_defaults timeout: @config.rpcs.update_table_spec.timeout,
1072
1272
  metadata: metadata,
1073
1273
  retry_policy: @config.rpcs.update_table_spec.retry_policy
1074
- options.apply_defaults metadata: @config.metadata,
1274
+
1275
+ options.apply_defaults timeout: @config.timeout,
1276
+ metadata: @config.metadata,
1075
1277
  retry_policy: @config.retry_policy
1076
1278
 
1077
1279
  @auto_ml_stub.call_rpc :update_table_spec, request, options: options do |response, operation|
@@ -1113,6 +1315,21 @@ module Google
1113
1315
  #
1114
1316
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1115
1317
  #
1318
+ # @example Basic example
1319
+ # require "google/cloud/automl/v1beta1"
1320
+ #
1321
+ # # Create a client object. The client can be reused for multiple calls.
1322
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1323
+ #
1324
+ # # Create a request. To set request fields, pass in keyword arguments.
1325
+ # request = Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest.new
1326
+ #
1327
+ # # Call the get_column_spec method.
1328
+ # result = client.get_column_spec request
1329
+ #
1330
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec.
1331
+ # p result
1332
+ #
1116
1333
  def get_column_spec request, options = nil
1117
1334
  raise ::ArgumentError, "request must be provided" if request.nil?
1118
1335
 
@@ -1130,16 +1347,20 @@ module Google
1130
1347
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1131
1348
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1132
1349
 
1133
- header_params = {
1134
- "name" => request.name
1135
- }
1350
+ header_params = {}
1351
+ if request.name
1352
+ header_params["name"] = request.name
1353
+ end
1354
+
1136
1355
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1137
1356
  metadata[:"x-goog-request-params"] ||= request_params_header
1138
1357
 
1139
1358
  options.apply_defaults timeout: @config.rpcs.get_column_spec.timeout,
1140
1359
  metadata: metadata,
1141
1360
  retry_policy: @config.rpcs.get_column_spec.retry_policy
1142
- options.apply_defaults metadata: @config.metadata,
1361
+
1362
+ options.apply_defaults timeout: @config.timeout,
1363
+ metadata: @config.metadata,
1143
1364
  retry_policy: @config.retry_policy
1144
1365
 
1145
1366
  @auto_ml_stub.call_rpc :get_column_spec, request, options: options do |response, operation|
@@ -1191,6 +1412,27 @@ module Google
1191
1412
  #
1192
1413
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1193
1414
  #
1415
+ # @example Basic example
1416
+ # require "google/cloud/automl/v1beta1"
1417
+ #
1418
+ # # Create a client object. The client can be reused for multiple calls.
1419
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1420
+ #
1421
+ # # Create a request. To set request fields, pass in keyword arguments.
1422
+ # request = Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest.new
1423
+ #
1424
+ # # Call the list_column_specs method.
1425
+ # result = client.list_column_specs request
1426
+ #
1427
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1428
+ # # iterate over all elements by calling #each, and the enumerable
1429
+ # # will lazily make API calls to fetch subsequent pages. Other
1430
+ # # methods are also available for managing paging directly.
1431
+ # result.each do |response|
1432
+ # # Each element is of type ::Google::Cloud::AutoML::V1beta1::ColumnSpec.
1433
+ # p response
1434
+ # end
1435
+ #
1194
1436
  def list_column_specs request, options = nil
1195
1437
  raise ::ArgumentError, "request must be provided" if request.nil?
1196
1438
 
@@ -1208,16 +1450,20 @@ module Google
1208
1450
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1209
1451
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1210
1452
 
1211
- header_params = {
1212
- "parent" => request.parent
1213
- }
1453
+ header_params = {}
1454
+ if request.parent
1455
+ header_params["parent"] = request.parent
1456
+ end
1457
+
1214
1458
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1215
1459
  metadata[:"x-goog-request-params"] ||= request_params_header
1216
1460
 
1217
1461
  options.apply_defaults timeout: @config.rpcs.list_column_specs.timeout,
1218
1462
  metadata: metadata,
1219
1463
  retry_policy: @config.rpcs.list_column_specs.retry_policy
1220
- options.apply_defaults metadata: @config.metadata,
1464
+
1465
+ options.apply_defaults timeout: @config.timeout,
1466
+ metadata: @config.metadata,
1221
1467
  retry_policy: @config.retry_policy
1222
1468
 
1223
1469
  @auto_ml_stub.call_rpc :list_column_specs, request, options: options do |response, operation|
@@ -1260,6 +1506,21 @@ module Google
1260
1506
  #
1261
1507
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1262
1508
  #
1509
+ # @example Basic example
1510
+ # require "google/cloud/automl/v1beta1"
1511
+ #
1512
+ # # Create a client object. The client can be reused for multiple calls.
1513
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1514
+ #
1515
+ # # Create a request. To set request fields, pass in keyword arguments.
1516
+ # request = Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest.new
1517
+ #
1518
+ # # Call the update_column_spec method.
1519
+ # result = client.update_column_spec request
1520
+ #
1521
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec.
1522
+ # p result
1523
+ #
1263
1524
  def update_column_spec request, options = nil
1264
1525
  raise ::ArgumentError, "request must be provided" if request.nil?
1265
1526
 
@@ -1277,16 +1538,20 @@ module Google
1277
1538
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1278
1539
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1279
1540
 
1280
- header_params = {
1281
- "column_spec.name" => request.column_spec.name
1282
- }
1541
+ header_params = {}
1542
+ if request.column_spec&.name
1543
+ header_params["column_spec.name"] = request.column_spec.name
1544
+ end
1545
+
1283
1546
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1284
1547
  metadata[:"x-goog-request-params"] ||= request_params_header
1285
1548
 
1286
1549
  options.apply_defaults timeout: @config.rpcs.update_column_spec.timeout,
1287
1550
  metadata: metadata,
1288
1551
  retry_policy: @config.rpcs.update_column_spec.retry_policy
1289
- options.apply_defaults metadata: @config.metadata,
1552
+
1553
+ options.apply_defaults timeout: @config.timeout,
1554
+ metadata: @config.metadata,
1290
1555
  retry_policy: @config.retry_policy
1291
1556
 
1292
1557
  @auto_ml_stub.call_rpc :update_column_spec, request, options: options do |response, operation|
@@ -1332,6 +1597,28 @@ module Google
1332
1597
  #
1333
1598
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1334
1599
  #
1600
+ # @example Basic example
1601
+ # require "google/cloud/automl/v1beta1"
1602
+ #
1603
+ # # Create a client object. The client can be reused for multiple calls.
1604
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1605
+ #
1606
+ # # Create a request. To set request fields, pass in keyword arguments.
1607
+ # request = Google::Cloud::AutoML::V1beta1::CreateModelRequest.new
1608
+ #
1609
+ # # Call the create_model method.
1610
+ # result = client.create_model request
1611
+ #
1612
+ # # The returned object is of type Gapic::Operation. You can use this
1613
+ # # object to check the status of an operation, cancel it, or wait
1614
+ # # for results. Here is how to block until completion:
1615
+ # result.wait_until_done! timeout: 60
1616
+ # if result.response?
1617
+ # p result.response
1618
+ # else
1619
+ # puts "Error!"
1620
+ # end
1621
+ #
1335
1622
  def create_model request, options = nil
1336
1623
  raise ::ArgumentError, "request must be provided" if request.nil?
1337
1624
 
@@ -1349,16 +1636,20 @@ module Google
1349
1636
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1350
1637
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1351
1638
 
1352
- header_params = {
1353
- "parent" => request.parent
1354
- }
1639
+ header_params = {}
1640
+ if request.parent
1641
+ header_params["parent"] = request.parent
1642
+ end
1643
+
1355
1644
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1356
1645
  metadata[:"x-goog-request-params"] ||= request_params_header
1357
1646
 
1358
1647
  options.apply_defaults timeout: @config.rpcs.create_model.timeout,
1359
1648
  metadata: metadata,
1360
1649
  retry_policy: @config.rpcs.create_model.retry_policy
1361
- options.apply_defaults metadata: @config.metadata,
1650
+
1651
+ options.apply_defaults timeout: @config.timeout,
1652
+ metadata: @config.metadata,
1362
1653
  retry_policy: @config.retry_policy
1363
1654
 
1364
1655
  @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
@@ -1399,6 +1690,21 @@ module Google
1399
1690
  #
1400
1691
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1401
1692
  #
1693
+ # @example Basic example
1694
+ # require "google/cloud/automl/v1beta1"
1695
+ #
1696
+ # # Create a client object. The client can be reused for multiple calls.
1697
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1698
+ #
1699
+ # # Create a request. To set request fields, pass in keyword arguments.
1700
+ # request = Google::Cloud::AutoML::V1beta1::GetModelRequest.new
1701
+ #
1702
+ # # Call the get_model method.
1703
+ # result = client.get_model request
1704
+ #
1705
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::Model.
1706
+ # p result
1707
+ #
1402
1708
  def get_model request, options = nil
1403
1709
  raise ::ArgumentError, "request must be provided" if request.nil?
1404
1710
 
@@ -1416,16 +1722,20 @@ module Google
1416
1722
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1417
1723
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1418
1724
 
1419
- header_params = {
1420
- "name" => request.name
1421
- }
1725
+ header_params = {}
1726
+ if request.name
1727
+ header_params["name"] = request.name
1728
+ end
1729
+
1422
1730
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1423
1731
  metadata[:"x-goog-request-params"] ||= request_params_header
1424
1732
 
1425
1733
  options.apply_defaults timeout: @config.rpcs.get_model.timeout,
1426
1734
  metadata: metadata,
1427
1735
  retry_policy: @config.rpcs.get_model.retry_policy
1428
- options.apply_defaults metadata: @config.metadata,
1736
+
1737
+ options.apply_defaults timeout: @config.timeout,
1738
+ metadata: @config.metadata,
1429
1739
  retry_policy: @config.retry_policy
1430
1740
 
1431
1741
  @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
@@ -1460,11 +1770,11 @@ module Google
1460
1770
  # An expression for filtering the results of the request.
1461
1771
  #
1462
1772
  # * `model_metadata` - for existence of the case (e.g.
1463
- # video_classification_model_metadata:*).
1773
+ # `video_classification_model_metadata:*`).
1464
1774
  # * `dataset_id` - for = or !=. Some examples of using the filter are:
1465
1775
  #
1466
1776
  # * `image_classification_model_metadata:*` --> The model has
1467
- # image_classification_model_metadata.
1777
+ # `image_classification_model_metadata`.
1468
1778
  # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1469
1779
  # @param page_size [::Integer]
1470
1780
  # Requested page size.
@@ -1482,6 +1792,27 @@ module Google
1482
1792
  #
1483
1793
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1484
1794
  #
1795
+ # @example Basic example
1796
+ # require "google/cloud/automl/v1beta1"
1797
+ #
1798
+ # # Create a client object. The client can be reused for multiple calls.
1799
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1800
+ #
1801
+ # # Create a request. To set request fields, pass in keyword arguments.
1802
+ # request = Google::Cloud::AutoML::V1beta1::ListModelsRequest.new
1803
+ #
1804
+ # # Call the list_models method.
1805
+ # result = client.list_models request
1806
+ #
1807
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1808
+ # # iterate over all elements by calling #each, and the enumerable
1809
+ # # will lazily make API calls to fetch subsequent pages. Other
1810
+ # # methods are also available for managing paging directly.
1811
+ # result.each do |response|
1812
+ # # Each element is of type ::Google::Cloud::AutoML::V1beta1::Model.
1813
+ # p response
1814
+ # end
1815
+ #
1485
1816
  def list_models request, options = nil
1486
1817
  raise ::ArgumentError, "request must be provided" if request.nil?
1487
1818
 
@@ -1499,16 +1830,20 @@ module Google
1499
1830
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1500
1831
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1501
1832
 
1502
- header_params = {
1503
- "parent" => request.parent
1504
- }
1833
+ header_params = {}
1834
+ if request.parent
1835
+ header_params["parent"] = request.parent
1836
+ end
1837
+
1505
1838
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1506
1839
  metadata[:"x-goog-request-params"] ||= request_params_header
1507
1840
 
1508
1841
  options.apply_defaults timeout: @config.rpcs.list_models.timeout,
1509
1842
  metadata: metadata,
1510
1843
  retry_policy: @config.rpcs.list_models.retry_policy
1511
- options.apply_defaults metadata: @config.metadata,
1844
+
1845
+ options.apply_defaults timeout: @config.timeout,
1846
+ metadata: @config.metadata,
1512
1847
  retry_policy: @config.retry_policy
1513
1848
 
1514
1849
  @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
@@ -1553,6 +1888,28 @@ module Google
1553
1888
  #
1554
1889
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1555
1890
  #
1891
+ # @example Basic example
1892
+ # require "google/cloud/automl/v1beta1"
1893
+ #
1894
+ # # Create a client object. The client can be reused for multiple calls.
1895
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
1896
+ #
1897
+ # # Create a request. To set request fields, pass in keyword arguments.
1898
+ # request = Google::Cloud::AutoML::V1beta1::DeleteModelRequest.new
1899
+ #
1900
+ # # Call the delete_model method.
1901
+ # result = client.delete_model request
1902
+ #
1903
+ # # The returned object is of type Gapic::Operation. You can use this
1904
+ # # object to check the status of an operation, cancel it, or wait
1905
+ # # for results. Here is how to block until completion:
1906
+ # result.wait_until_done! timeout: 60
1907
+ # if result.response?
1908
+ # p result.response
1909
+ # else
1910
+ # puts "Error!"
1911
+ # end
1912
+ #
1556
1913
  def delete_model request, options = nil
1557
1914
  raise ::ArgumentError, "request must be provided" if request.nil?
1558
1915
 
@@ -1570,16 +1927,20 @@ module Google
1570
1927
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1571
1928
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1572
1929
 
1573
- header_params = {
1574
- "name" => request.name
1575
- }
1930
+ header_params = {}
1931
+ if request.name
1932
+ header_params["name"] = request.name
1933
+ end
1934
+
1576
1935
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1577
1936
  metadata[:"x-goog-request-params"] ||= request_params_header
1578
1937
 
1579
1938
  options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
1580
1939
  metadata: metadata,
1581
1940
  retry_policy: @config.rpcs.delete_model.retry_policy
1582
- options.apply_defaults metadata: @config.metadata,
1941
+
1942
+ options.apply_defaults timeout: @config.timeout,
1943
+ metadata: @config.metadata,
1583
1944
  retry_policy: @config.retry_policy
1584
1945
 
1585
1946
  @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
@@ -1635,6 +1996,28 @@ module Google
1635
1996
  #
1636
1997
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1637
1998
  #
1999
+ # @example Basic example
2000
+ # require "google/cloud/automl/v1beta1"
2001
+ #
2002
+ # # Create a client object. The client can be reused for multiple calls.
2003
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2004
+ #
2005
+ # # Create a request. To set request fields, pass in keyword arguments.
2006
+ # request = Google::Cloud::AutoML::V1beta1::DeployModelRequest.new
2007
+ #
2008
+ # # Call the deploy_model method.
2009
+ # result = client.deploy_model request
2010
+ #
2011
+ # # The returned object is of type Gapic::Operation. You can use this
2012
+ # # object to check the status of an operation, cancel it, or wait
2013
+ # # for results. Here is how to block until completion:
2014
+ # result.wait_until_done! timeout: 60
2015
+ # if result.response?
2016
+ # p result.response
2017
+ # else
2018
+ # puts "Error!"
2019
+ # end
2020
+ #
1638
2021
  def deploy_model request, options = nil
1639
2022
  raise ::ArgumentError, "request must be provided" if request.nil?
1640
2023
 
@@ -1652,16 +2035,20 @@ module Google
1652
2035
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1653
2036
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1654
2037
 
1655
- header_params = {
1656
- "name" => request.name
1657
- }
2038
+ header_params = {}
2039
+ if request.name
2040
+ header_params["name"] = request.name
2041
+ end
2042
+
1658
2043
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1659
2044
  metadata[:"x-goog-request-params"] ||= request_params_header
1660
2045
 
1661
2046
  options.apply_defaults timeout: @config.rpcs.deploy_model.timeout,
1662
2047
  metadata: metadata,
1663
2048
  retry_policy: @config.rpcs.deploy_model.retry_policy
1664
- options.apply_defaults metadata: @config.metadata,
2049
+
2050
+ options.apply_defaults timeout: @config.timeout,
2051
+ metadata: @config.metadata,
1665
2052
  retry_policy: @config.retry_policy
1666
2053
 
1667
2054
  @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
@@ -1708,6 +2095,28 @@ module Google
1708
2095
  #
1709
2096
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1710
2097
  #
2098
+ # @example Basic example
2099
+ # require "google/cloud/automl/v1beta1"
2100
+ #
2101
+ # # Create a client object. The client can be reused for multiple calls.
2102
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2103
+ #
2104
+ # # Create a request. To set request fields, pass in keyword arguments.
2105
+ # request = Google::Cloud::AutoML::V1beta1::UndeployModelRequest.new
2106
+ #
2107
+ # # Call the undeploy_model method.
2108
+ # result = client.undeploy_model request
2109
+ #
2110
+ # # The returned object is of type Gapic::Operation. You can use this
2111
+ # # object to check the status of an operation, cancel it, or wait
2112
+ # # for results. Here is how to block until completion:
2113
+ # result.wait_until_done! timeout: 60
2114
+ # if result.response?
2115
+ # p result.response
2116
+ # else
2117
+ # puts "Error!"
2118
+ # end
2119
+ #
1711
2120
  def undeploy_model request, options = nil
1712
2121
  raise ::ArgumentError, "request must be provided" if request.nil?
1713
2122
 
@@ -1725,16 +2134,20 @@ module Google
1725
2134
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1726
2135
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1727
2136
 
1728
- header_params = {
1729
- "name" => request.name
1730
- }
2137
+ header_params = {}
2138
+ if request.name
2139
+ header_params["name"] = request.name
2140
+ end
2141
+
1731
2142
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1732
2143
  metadata[:"x-goog-request-params"] ||= request_params_header
1733
2144
 
1734
2145
  options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout,
1735
2146
  metadata: metadata,
1736
2147
  retry_policy: @config.rpcs.undeploy_model.retry_policy
1737
- options.apply_defaults metadata: @config.metadata,
2148
+
2149
+ options.apply_defaults timeout: @config.timeout,
2150
+ metadata: @config.metadata,
1738
2151
  retry_policy: @config.retry_policy
1739
2152
 
1740
2153
  @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
@@ -1784,6 +2197,28 @@ module Google
1784
2197
  #
1785
2198
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1786
2199
  #
2200
+ # @example Basic example
2201
+ # require "google/cloud/automl/v1beta1"
2202
+ #
2203
+ # # Create a client object. The client can be reused for multiple calls.
2204
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2205
+ #
2206
+ # # Create a request. To set request fields, pass in keyword arguments.
2207
+ # request = Google::Cloud::AutoML::V1beta1::ExportModelRequest.new
2208
+ #
2209
+ # # Call the export_model method.
2210
+ # result = client.export_model request
2211
+ #
2212
+ # # The returned object is of type Gapic::Operation. You can use this
2213
+ # # object to check the status of an operation, cancel it, or wait
2214
+ # # for results. Here is how to block until completion:
2215
+ # result.wait_until_done! timeout: 60
2216
+ # if result.response?
2217
+ # p result.response
2218
+ # else
2219
+ # puts "Error!"
2220
+ # end
2221
+ #
1787
2222
  def export_model request, options = nil
1788
2223
  raise ::ArgumentError, "request must be provided" if request.nil?
1789
2224
 
@@ -1801,16 +2236,20 @@ module Google
1801
2236
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1802
2237
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1803
2238
 
1804
- header_params = {
1805
- "name" => request.name
1806
- }
2239
+ header_params = {}
2240
+ if request.name
2241
+ header_params["name"] = request.name
2242
+ end
2243
+
1807
2244
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1808
2245
  metadata[:"x-goog-request-params"] ||= request_params_header
1809
2246
 
1810
2247
  options.apply_defaults timeout: @config.rpcs.export_model.timeout,
1811
2248
  metadata: metadata,
1812
2249
  retry_policy: @config.rpcs.export_model.retry_policy
1813
- options.apply_defaults metadata: @config.metadata,
2250
+
2251
+ options.apply_defaults timeout: @config.timeout,
2252
+ metadata: @config.metadata,
1814
2253
  retry_policy: @config.retry_policy
1815
2254
 
1816
2255
  @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
@@ -1867,6 +2306,28 @@ module Google
1867
2306
  #
1868
2307
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1869
2308
  #
2309
+ # @example Basic example
2310
+ # require "google/cloud/automl/v1beta1"
2311
+ #
2312
+ # # Create a client object. The client can be reused for multiple calls.
2313
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2314
+ #
2315
+ # # Create a request. To set request fields, pass in keyword arguments.
2316
+ # request = Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest.new
2317
+ #
2318
+ # # Call the export_evaluated_examples method.
2319
+ # result = client.export_evaluated_examples request
2320
+ #
2321
+ # # The returned object is of type Gapic::Operation. You can use this
2322
+ # # object to check the status of an operation, cancel it, or wait
2323
+ # # for results. Here is how to block until completion:
2324
+ # result.wait_until_done! timeout: 60
2325
+ # if result.response?
2326
+ # p result.response
2327
+ # else
2328
+ # puts "Error!"
2329
+ # end
2330
+ #
1870
2331
  def export_evaluated_examples request, options = nil
1871
2332
  raise ::ArgumentError, "request must be provided" if request.nil?
1872
2333
 
@@ -1884,16 +2345,20 @@ module Google
1884
2345
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1885
2346
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1886
2347
 
1887
- header_params = {
1888
- "name" => request.name
1889
- }
2348
+ header_params = {}
2349
+ if request.name
2350
+ header_params["name"] = request.name
2351
+ end
2352
+
1890
2353
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1891
2354
  metadata[:"x-goog-request-params"] ||= request_params_header
1892
2355
 
1893
2356
  options.apply_defaults timeout: @config.rpcs.export_evaluated_examples.timeout,
1894
2357
  metadata: metadata,
1895
2358
  retry_policy: @config.rpcs.export_evaluated_examples.retry_policy
1896
- options.apply_defaults metadata: @config.metadata,
2359
+
2360
+ options.apply_defaults timeout: @config.timeout,
2361
+ metadata: @config.metadata,
1897
2362
  retry_policy: @config.retry_policy
1898
2363
 
1899
2364
  @auto_ml_stub.call_rpc :export_evaluated_examples, request, options: options do |response, operation|
@@ -1934,6 +2399,21 @@ module Google
1934
2399
  #
1935
2400
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1936
2401
  #
2402
+ # @example Basic example
2403
+ # require "google/cloud/automl/v1beta1"
2404
+ #
2405
+ # # Create a client object. The client can be reused for multiple calls.
2406
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2407
+ #
2408
+ # # Create a request. To set request fields, pass in keyword arguments.
2409
+ # request = Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest.new
2410
+ #
2411
+ # # Call the get_model_evaluation method.
2412
+ # result = client.get_model_evaluation request
2413
+ #
2414
+ # # The returned object is of type Google::Cloud::AutoML::V1beta1::ModelEvaluation.
2415
+ # p result
2416
+ #
1937
2417
  def get_model_evaluation request, options = nil
1938
2418
  raise ::ArgumentError, "request must be provided" if request.nil?
1939
2419
 
@@ -1951,16 +2431,20 @@ module Google
1951
2431
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
1952
2432
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1953
2433
 
1954
- header_params = {
1955
- "name" => request.name
1956
- }
2434
+ header_params = {}
2435
+ if request.name
2436
+ header_params["name"] = request.name
2437
+ end
2438
+
1957
2439
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1958
2440
  metadata[:"x-goog-request-params"] ||= request_params_header
1959
2441
 
1960
2442
  options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout,
1961
2443
  metadata: metadata,
1962
2444
  retry_policy: @config.rpcs.get_model_evaluation.retry_policy
1963
- options.apply_defaults metadata: @config.metadata,
2445
+
2446
+ options.apply_defaults timeout: @config.timeout,
2447
+ metadata: @config.metadata,
1964
2448
  retry_policy: @config.retry_policy
1965
2449
 
1966
2450
  @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
@@ -2021,6 +2505,27 @@ module Google
2021
2505
  #
2022
2506
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2023
2507
  #
2508
+ # @example Basic example
2509
+ # require "google/cloud/automl/v1beta1"
2510
+ #
2511
+ # # Create a client object. The client can be reused for multiple calls.
2512
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
2513
+ #
2514
+ # # Create a request. To set request fields, pass in keyword arguments.
2515
+ # request = Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest.new
2516
+ #
2517
+ # # Call the list_model_evaluations method.
2518
+ # result = client.list_model_evaluations request
2519
+ #
2520
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2521
+ # # iterate over all elements by calling #each, and the enumerable
2522
+ # # will lazily make API calls to fetch subsequent pages. Other
2523
+ # # methods are also available for managing paging directly.
2524
+ # result.each do |response|
2525
+ # # Each element is of type ::Google::Cloud::AutoML::V1beta1::ModelEvaluation.
2526
+ # p response
2527
+ # end
2528
+ #
2024
2529
  def list_model_evaluations request, options = nil
2025
2530
  raise ::ArgumentError, "request must be provided" if request.nil?
2026
2531
 
@@ -2038,16 +2543,20 @@ module Google
2038
2543
  gapic_version: ::Google::Cloud::AutoML::V1beta1::VERSION
2039
2544
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2040
2545
 
2041
- header_params = {
2042
- "parent" => request.parent
2043
- }
2546
+ header_params = {}
2547
+ if request.parent
2548
+ header_params["parent"] = request.parent
2549
+ end
2550
+
2044
2551
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2045
2552
  metadata[:"x-goog-request-params"] ||= request_params_header
2046
2553
 
2047
2554
  options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout,
2048
2555
  metadata: metadata,
2049
2556
  retry_policy: @config.rpcs.list_model_evaluations.retry_policy
2050
- options.apply_defaults metadata: @config.metadata,
2557
+
2558
+ options.apply_defaults timeout: @config.timeout,
2559
+ metadata: @config.metadata,
2051
2560
  retry_policy: @config.retry_policy
2052
2561
 
2053
2562
  @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
@@ -2072,22 +2581,21 @@ module Google
2072
2581
  # Configuration can be applied globally to all clients, or to a single client
2073
2582
  # on construction.
2074
2583
  #
2075
- # # Examples
2076
- #
2077
- # To modify the global config, setting the timeout for create_dataset
2078
- # to 20 seconds, and all remaining timeouts to 10 seconds:
2079
- #
2080
- # ::Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
2081
- # config.timeout = 10.0
2082
- # config.rpcs.create_dataset.timeout = 20.0
2083
- # end
2084
- #
2085
- # To apply the above configuration only to a new client:
2086
- #
2087
- # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config|
2088
- # config.timeout = 10.0
2089
- # config.rpcs.create_dataset.timeout = 20.0
2090
- # end
2584
+ # @example
2585
+ #
2586
+ # # Modify the global config, setting the timeout for
2587
+ # # create_dataset to 20 seconds,
2588
+ # # and all remaining timeouts to 10 seconds.
2589
+ # ::Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
2590
+ # config.timeout = 10.0
2591
+ # config.rpcs.create_dataset.timeout = 20.0
2592
+ # end
2593
+ #
2594
+ # # Apply the above configuration only to a new client.
2595
+ # client = ::Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config|
2596
+ # config.timeout = 10.0
2597
+ # config.rpcs.create_dataset.timeout = 20.0
2598
+ # end
2091
2599
  #
2092
2600
  # @!attribute [rw] endpoint
2093
2601
  # The hostname or hostname:port of the service endpoint.