google-cloud-automl-v1 0.4.1 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +2 -2
  5. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +2 -2
  6. data/lib/google/cloud/automl/v1/automl/client.rb +539 -149
  7. data/lib/google/cloud/automl/v1/automl/operations.rb +149 -37
  8. data/lib/google/cloud/automl/v1/classification_pb.rb +1 -1
  9. data/lib/google/cloud/automl/v1/data_items_pb.rb +2 -2
  10. data/lib/google/cloud/automl/v1/dataset_pb.rb +2 -2
  11. data/lib/google/cloud/automl/v1/detection_pb.rb +2 -2
  12. data/lib/google/cloud/automl/v1/geometry_pb.rb +1 -1
  13. data/lib/google/cloud/automl/v1/image_pb.rb +2 -2
  14. data/lib/google/cloud/automl/v1/io_pb.rb +2 -2
  15. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +2 -2
  16. data/lib/google/cloud/automl/v1/model_pb.rb +2 -2
  17. data/lib/google/cloud/automl/v1/operations_pb.rb +2 -2
  18. data/lib/google/cloud/automl/v1/prediction_service/client.rb +83 -45
  19. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +149 -37
  20. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +2 -2
  21. data/lib/google/cloud/automl/v1/service_pb.rb +2 -2
  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. data/proto_docs/google/api/field_behavior.rb +7 -1
  29. data/proto_docs/google/cloud/automl/v1/service.rb +5 -4
  30. metadata +4 -4
@@ -54,13 +54,12 @@ module Google
54
54
  # See {::Google::Cloud::AutoML::V1::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::V1::AutoML::Client.configure do |config|
62
- # config.timeout = 10.0
63
- # end
59
+ # # Modify the configuration for all AutoMl clients
60
+ # ::Google::Cloud::AutoML::V1::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: [4, 14]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
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: [4, 14]
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
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: [4, 14]
96
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
107
97
  }
108
98
 
109
99
  default_config.rpcs.import_data.timeout = 5.0
@@ -112,36 +102,24 @@ 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: [4, 14]
105
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
119
106
  }
120
107
 
121
108
  default_config.rpcs.create_model.timeout = 5.0
122
109
 
123
110
  default_config.rpcs.get_model.timeout = 5.0
124
111
  default_config.rpcs.get_model.retry_policy = {
125
- initial_delay: 0.1,
126
- max_delay: 60.0,
127
- multiplier: 1.3,
128
- retry_codes: [4, 14]
112
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
129
113
  }
130
114
 
131
115
  default_config.rpcs.list_models.timeout = 5.0
132
116
  default_config.rpcs.list_models.retry_policy = {
133
- initial_delay: 0.1,
134
- max_delay: 60.0,
135
- multiplier: 1.3,
136
- retry_codes: [4, 14]
117
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
137
118
  }
138
119
 
139
120
  default_config.rpcs.delete_model.timeout = 5.0
140
121
  default_config.rpcs.delete_model.retry_policy = {
141
- initial_delay: 0.1,
142
- max_delay: 60.0,
143
- multiplier: 1.3,
144
- retry_codes: [4, 14]
122
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
145
123
  }
146
124
 
147
125
  default_config.rpcs.update_model.timeout = 5.0
@@ -154,18 +132,12 @@ module Google
154
132
 
155
133
  default_config.rpcs.get_model_evaluation.timeout = 5.0
156
134
  default_config.rpcs.get_model_evaluation.retry_policy = {
157
- initial_delay: 0.1,
158
- max_delay: 60.0,
159
- multiplier: 1.3,
160
- retry_codes: [4, 14]
135
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
161
136
  }
162
137
 
163
138
  default_config.rpcs.list_model_evaluations.timeout = 5.0
164
139
  default_config.rpcs.list_model_evaluations.retry_policy = {
165
- initial_delay: 0.1,
166
- max_delay: 60.0,
167
- multiplier: 1.3,
168
- retry_codes: [4, 14]
140
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
169
141
  }
170
142
 
171
143
  default_config
@@ -197,19 +169,15 @@ module Google
197
169
  ##
198
170
  # Create a new AutoMl client object.
199
171
  #
200
- # ## Examples
201
- #
202
- # To create a new AutoMl client with the default
203
- # configuration:
204
- #
205
- # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new
172
+ # @example
206
173
  #
207
- # To create a new AutoMl client with a custom
208
- # configuration:
174
+ # # Create a client using the default configuration
175
+ # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new
209
176
  #
210
- # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
211
- # config.timeout = 10.0
212
- # end
177
+ # # Create a client using a custom configuration
178
+ # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
179
+ # config.timeout = 10.0
180
+ # end
213
181
  #
214
182
  # @yield [config] Configure the AutoMl client.
215
183
  # @yieldparam config [Client::Configuration]
@@ -229,14 +197,13 @@ module Google
229
197
 
230
198
  # Create credentials
231
199
  credentials = @config.credentials
232
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
200
+ # Use self-signed JWT if the endpoint is unchanged from default,
233
201
  # but only if the default endpoint does not have a region prefix.
234
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
235
- @config.endpoint == Client.configure.endpoint &&
202
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
236
203
  !@config.endpoint.split(".").first.include?("-")
237
204
  credentials ||= Credentials.default scope: @config.scope,
238
205
  enable_self_signed_jwt: enable_self_signed_jwt
239
- if credentials.is_a?(String) || credentials.is_a?(Hash)
206
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
240
207
  credentials = Credentials.new credentials, scope: @config.scope
241
208
  end
242
209
  @quota_project_id = @config.quota_project
@@ -296,6 +263,28 @@ module Google
296
263
  #
297
264
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
298
265
  #
266
+ # @example Basic example
267
+ # require "google/cloud/automl/v1"
268
+ #
269
+ # # Create a client object. The client can be reused for multiple calls.
270
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
271
+ #
272
+ # # Create a request. To set request fields, pass in keyword arguments.
273
+ # request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new
274
+ #
275
+ # # Call the create_dataset method.
276
+ # result = client.create_dataset request
277
+ #
278
+ # # The returned object is of type Gapic::Operation. You can use this
279
+ # # object to check the status of an operation, cancel it, or wait
280
+ # # for results. Here is how to block until completion:
281
+ # result.wait_until_done! timeout: 60
282
+ # if result.response?
283
+ # p result.response
284
+ # else
285
+ # puts "Error!"
286
+ # end
287
+ #
299
288
  def create_dataset request, options = nil
300
289
  raise ::ArgumentError, "request must be provided" if request.nil?
301
290
 
@@ -313,16 +302,20 @@ module Google
313
302
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
314
303
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
315
304
 
316
- header_params = {
317
- "parent" => request.parent
318
- }
305
+ header_params = {}
306
+ if request.parent
307
+ header_params["parent"] = request.parent
308
+ end
309
+
319
310
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
311
  metadata[:"x-goog-request-params"] ||= request_params_header
321
312
 
322
313
  options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
323
314
  metadata: metadata,
324
315
  retry_policy: @config.rpcs.create_dataset.retry_policy
325
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
326
319
  retry_policy: @config.retry_policy
327
320
 
328
321
  @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
@@ -363,6 +356,21 @@ module Google
363
356
  #
364
357
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
365
358
  #
359
+ # @example Basic example
360
+ # require "google/cloud/automl/v1"
361
+ #
362
+ # # Create a client object. The client can be reused for multiple calls.
363
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
364
+ #
365
+ # # Create a request. To set request fields, pass in keyword arguments.
366
+ # request = Google::Cloud::AutoML::V1::GetDatasetRequest.new
367
+ #
368
+ # # Call the get_dataset method.
369
+ # result = client.get_dataset request
370
+ #
371
+ # # The returned object is of type Google::Cloud::AutoML::V1::Dataset.
372
+ # p result
373
+ #
366
374
  def get_dataset request, options = nil
367
375
  raise ::ArgumentError, "request must be provided" if request.nil?
368
376
 
@@ -380,16 +388,20 @@ module Google
380
388
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
381
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
390
 
383
- header_params = {
384
- "name" => request.name
385
- }
391
+ header_params = {}
392
+ if request.name
393
+ header_params["name"] = request.name
394
+ end
395
+
386
396
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
387
397
  metadata[:"x-goog-request-params"] ||= request_params_header
388
398
 
389
399
  options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
390
400
  metadata: metadata,
391
401
  retry_policy: @config.rpcs.get_dataset.retry_policy
392
- options.apply_defaults metadata: @config.metadata,
402
+
403
+ options.apply_defaults timeout: @config.timeout,
404
+ metadata: @config.metadata,
393
405
  retry_policy: @config.retry_policy
394
406
 
395
407
  @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
@@ -424,10 +436,11 @@ module Google
424
436
  # An expression for filtering the results of the request.
425
437
  #
426
438
  # * `dataset_metadata` - for existence of the case (e.g.
427
- # image_classification_dataset_metadata:*). Some examples of using the filter are:
439
+ # `image_classification_dataset_metadata:*`). Some examples of
440
+ # using the filter are:
428
441
  #
429
442
  # * `translation_dataset_metadata:*` --> The dataset has
430
- # translation_dataset_metadata.
443
+ # `translation_dataset_metadata`.
431
444
  # @param page_size [::Integer]
432
445
  # Requested page size. Server may return fewer results than requested.
433
446
  # If unspecified, server will pick a default size.
@@ -445,6 +458,27 @@ module Google
445
458
  #
446
459
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
447
460
  #
461
+ # @example Basic example
462
+ # require "google/cloud/automl/v1"
463
+ #
464
+ # # Create a client object. The client can be reused for multiple calls.
465
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
466
+ #
467
+ # # Create a request. To set request fields, pass in keyword arguments.
468
+ # request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new
469
+ #
470
+ # # Call the list_datasets method.
471
+ # result = client.list_datasets request
472
+ #
473
+ # # The returned object is of type Gapic::PagedEnumerable. You can
474
+ # # iterate over all elements by calling #each, and the enumerable
475
+ # # will lazily make API calls to fetch subsequent pages. Other
476
+ # # methods are also available for managing paging directly.
477
+ # result.each do |response|
478
+ # # Each element is of type ::Google::Cloud::AutoML::V1::Dataset.
479
+ # p response
480
+ # end
481
+ #
448
482
  def list_datasets request, options = nil
449
483
  raise ::ArgumentError, "request must be provided" if request.nil?
450
484
 
@@ -462,16 +496,20 @@ module Google
462
496
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
463
497
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
498
 
465
- header_params = {
466
- "parent" => request.parent
467
- }
499
+ header_params = {}
500
+ if request.parent
501
+ header_params["parent"] = request.parent
502
+ end
503
+
468
504
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
469
505
  metadata[:"x-goog-request-params"] ||= request_params_header
470
506
 
471
507
  options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
472
508
  metadata: metadata,
473
509
  retry_policy: @config.rpcs.list_datasets.retry_policy
474
- options.apply_defaults metadata: @config.metadata,
510
+
511
+ options.apply_defaults timeout: @config.timeout,
512
+ metadata: @config.metadata,
475
513
  retry_policy: @config.retry_policy
476
514
 
477
515
  @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
@@ -514,6 +552,21 @@ module Google
514
552
  #
515
553
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
516
554
  #
555
+ # @example Basic example
556
+ # require "google/cloud/automl/v1"
557
+ #
558
+ # # Create a client object. The client can be reused for multiple calls.
559
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
560
+ #
561
+ # # Create a request. To set request fields, pass in keyword arguments.
562
+ # request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new
563
+ #
564
+ # # Call the update_dataset method.
565
+ # result = client.update_dataset request
566
+ #
567
+ # # The returned object is of type Google::Cloud::AutoML::V1::Dataset.
568
+ # p result
569
+ #
517
570
  def update_dataset request, options = nil
518
571
  raise ::ArgumentError, "request must be provided" if request.nil?
519
572
 
@@ -531,16 +584,20 @@ module Google
531
584
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
532
585
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
533
586
 
534
- header_params = {
535
- "dataset.name" => request.dataset.name
536
- }
587
+ header_params = {}
588
+ if request.dataset&.name
589
+ header_params["dataset.name"] = request.dataset.name
590
+ end
591
+
537
592
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
538
593
  metadata[:"x-goog-request-params"] ||= request_params_header
539
594
 
540
595
  options.apply_defaults timeout: @config.rpcs.update_dataset.timeout,
541
596
  metadata: metadata,
542
597
  retry_policy: @config.rpcs.update_dataset.retry_policy
543
- options.apply_defaults metadata: @config.metadata,
598
+
599
+ options.apply_defaults timeout: @config.timeout,
600
+ metadata: @config.metadata,
544
601
  retry_policy: @config.retry_policy
545
602
 
546
603
  @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
@@ -584,6 +641,28 @@ module Google
584
641
  #
585
642
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
586
643
  #
644
+ # @example Basic example
645
+ # require "google/cloud/automl/v1"
646
+ #
647
+ # # Create a client object. The client can be reused for multiple calls.
648
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
649
+ #
650
+ # # Create a request. To set request fields, pass in keyword arguments.
651
+ # request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new
652
+ #
653
+ # # Call the delete_dataset method.
654
+ # result = client.delete_dataset request
655
+ #
656
+ # # The returned object is of type Gapic::Operation. You can use this
657
+ # # object to check the status of an operation, cancel it, or wait
658
+ # # for results. Here is how to block until completion:
659
+ # result.wait_until_done! timeout: 60
660
+ # if result.response?
661
+ # p result.response
662
+ # else
663
+ # puts "Error!"
664
+ # end
665
+ #
587
666
  def delete_dataset request, options = nil
588
667
  raise ::ArgumentError, "request must be provided" if request.nil?
589
668
 
@@ -601,16 +680,20 @@ module Google
601
680
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
602
681
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
603
682
 
604
- header_params = {
605
- "name" => request.name
606
- }
683
+ header_params = {}
684
+ if request.name
685
+ header_params["name"] = request.name
686
+ end
687
+
607
688
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
608
689
  metadata[:"x-goog-request-params"] ||= request_params_header
609
690
 
610
691
  options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
611
692
  metadata: metadata,
612
693
  retry_policy: @config.rpcs.delete_dataset.retry_policy
613
- options.apply_defaults metadata: @config.metadata,
694
+
695
+ options.apply_defaults timeout: @config.timeout,
696
+ metadata: @config.metadata,
614
697
  retry_policy: @config.retry_policy
615
698
 
616
699
  @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
@@ -663,6 +746,28 @@ module Google
663
746
  #
664
747
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
665
748
  #
749
+ # @example Basic example
750
+ # require "google/cloud/automl/v1"
751
+ #
752
+ # # Create a client object. The client can be reused for multiple calls.
753
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
754
+ #
755
+ # # Create a request. To set request fields, pass in keyword arguments.
756
+ # request = Google::Cloud::AutoML::V1::ImportDataRequest.new
757
+ #
758
+ # # Call the import_data method.
759
+ # result = client.import_data request
760
+ #
761
+ # # The returned object is of type Gapic::Operation. You can use this
762
+ # # object to check the status of an operation, cancel it, or wait
763
+ # # for results. Here is how to block until completion:
764
+ # result.wait_until_done! timeout: 60
765
+ # if result.response?
766
+ # p result.response
767
+ # else
768
+ # puts "Error!"
769
+ # end
770
+ #
666
771
  def import_data request, options = nil
667
772
  raise ::ArgumentError, "request must be provided" if request.nil?
668
773
 
@@ -680,16 +785,20 @@ module Google
680
785
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
681
786
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
682
787
 
683
- header_params = {
684
- "name" => request.name
685
- }
788
+ header_params = {}
789
+ if request.name
790
+ header_params["name"] = request.name
791
+ end
792
+
686
793
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
687
794
  metadata[:"x-goog-request-params"] ||= request_params_header
688
795
 
689
796
  options.apply_defaults timeout: @config.rpcs.import_data.timeout,
690
797
  metadata: metadata,
691
798
  retry_policy: @config.rpcs.import_data.retry_policy
692
- options.apply_defaults metadata: @config.metadata,
799
+
800
+ options.apply_defaults timeout: @config.timeout,
801
+ metadata: @config.metadata,
693
802
  retry_policy: @config.retry_policy
694
803
 
695
804
  @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
@@ -734,6 +843,28 @@ module Google
734
843
  #
735
844
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
736
845
  #
846
+ # @example Basic example
847
+ # require "google/cloud/automl/v1"
848
+ #
849
+ # # Create a client object. The client can be reused for multiple calls.
850
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
851
+ #
852
+ # # Create a request. To set request fields, pass in keyword arguments.
853
+ # request = Google::Cloud::AutoML::V1::ExportDataRequest.new
854
+ #
855
+ # # Call the export_data method.
856
+ # result = client.export_data request
857
+ #
858
+ # # The returned object is of type Gapic::Operation. You can use this
859
+ # # object to check the status of an operation, cancel it, or wait
860
+ # # for results. Here is how to block until completion:
861
+ # result.wait_until_done! timeout: 60
862
+ # if result.response?
863
+ # p result.response
864
+ # else
865
+ # puts "Error!"
866
+ # end
867
+ #
737
868
  def export_data request, options = nil
738
869
  raise ::ArgumentError, "request must be provided" if request.nil?
739
870
 
@@ -751,16 +882,20 @@ module Google
751
882
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
752
883
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
753
884
 
754
- header_params = {
755
- "name" => request.name
756
- }
885
+ header_params = {}
886
+ if request.name
887
+ header_params["name"] = request.name
888
+ end
889
+
757
890
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
758
891
  metadata[:"x-goog-request-params"] ||= request_params_header
759
892
 
760
893
  options.apply_defaults timeout: @config.rpcs.export_data.timeout,
761
894
  metadata: metadata,
762
895
  retry_policy: @config.rpcs.export_data.retry_policy
763
- options.apply_defaults metadata: @config.metadata,
896
+
897
+ options.apply_defaults timeout: @config.timeout,
898
+ metadata: @config.metadata,
764
899
  retry_policy: @config.retry_policy
765
900
 
766
901
  @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
@@ -801,6 +936,21 @@ module Google
801
936
  #
802
937
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
803
938
  #
939
+ # @example Basic example
940
+ # require "google/cloud/automl/v1"
941
+ #
942
+ # # Create a client object. The client can be reused for multiple calls.
943
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
944
+ #
945
+ # # Create a request. To set request fields, pass in keyword arguments.
946
+ # request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new
947
+ #
948
+ # # Call the get_annotation_spec method.
949
+ # result = client.get_annotation_spec request
950
+ #
951
+ # # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec.
952
+ # p result
953
+ #
804
954
  def get_annotation_spec request, options = nil
805
955
  raise ::ArgumentError, "request must be provided" if request.nil?
806
956
 
@@ -818,16 +968,20 @@ module Google
818
968
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
819
969
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
820
970
 
821
- header_params = {
822
- "name" => request.name
823
- }
971
+ header_params = {}
972
+ if request.name
973
+ header_params["name"] = request.name
974
+ end
975
+
824
976
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
825
977
  metadata[:"x-goog-request-params"] ||= request_params_header
826
978
 
827
979
  options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout,
828
980
  metadata: metadata,
829
981
  retry_policy: @config.rpcs.get_annotation_spec.retry_policy
830
- options.apply_defaults metadata: @config.metadata,
982
+
983
+ options.apply_defaults timeout: @config.timeout,
984
+ metadata: @config.metadata,
831
985
  retry_policy: @config.retry_policy
832
986
 
833
987
  @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
@@ -873,6 +1027,28 @@ module Google
873
1027
  #
874
1028
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
875
1029
  #
1030
+ # @example Basic example
1031
+ # require "google/cloud/automl/v1"
1032
+ #
1033
+ # # Create a client object. The client can be reused for multiple calls.
1034
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1035
+ #
1036
+ # # Create a request. To set request fields, pass in keyword arguments.
1037
+ # request = Google::Cloud::AutoML::V1::CreateModelRequest.new
1038
+ #
1039
+ # # Call the create_model method.
1040
+ # result = client.create_model request
1041
+ #
1042
+ # # The returned object is of type Gapic::Operation. You can use this
1043
+ # # object to check the status of an operation, cancel it, or wait
1044
+ # # for results. Here is how to block until completion:
1045
+ # result.wait_until_done! timeout: 60
1046
+ # if result.response?
1047
+ # p result.response
1048
+ # else
1049
+ # puts "Error!"
1050
+ # end
1051
+ #
876
1052
  def create_model request, options = nil
877
1053
  raise ::ArgumentError, "request must be provided" if request.nil?
878
1054
 
@@ -890,16 +1066,20 @@ module Google
890
1066
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
891
1067
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
892
1068
 
893
- header_params = {
894
- "parent" => request.parent
895
- }
1069
+ header_params = {}
1070
+ if request.parent
1071
+ header_params["parent"] = request.parent
1072
+ end
1073
+
896
1074
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
897
1075
  metadata[:"x-goog-request-params"] ||= request_params_header
898
1076
 
899
1077
  options.apply_defaults timeout: @config.rpcs.create_model.timeout,
900
1078
  metadata: metadata,
901
1079
  retry_policy: @config.rpcs.create_model.retry_policy
902
- options.apply_defaults metadata: @config.metadata,
1080
+
1081
+ options.apply_defaults timeout: @config.timeout,
1082
+ metadata: @config.metadata,
903
1083
  retry_policy: @config.retry_policy
904
1084
 
905
1085
  @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
@@ -940,6 +1120,21 @@ module Google
940
1120
  #
941
1121
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
942
1122
  #
1123
+ # @example Basic example
1124
+ # require "google/cloud/automl/v1"
1125
+ #
1126
+ # # Create a client object. The client can be reused for multiple calls.
1127
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1128
+ #
1129
+ # # Create a request. To set request fields, pass in keyword arguments.
1130
+ # request = Google::Cloud::AutoML::V1::GetModelRequest.new
1131
+ #
1132
+ # # Call the get_model method.
1133
+ # result = client.get_model request
1134
+ #
1135
+ # # The returned object is of type Google::Cloud::AutoML::V1::Model.
1136
+ # p result
1137
+ #
943
1138
  def get_model request, options = nil
944
1139
  raise ::ArgumentError, "request must be provided" if request.nil?
945
1140
 
@@ -957,16 +1152,20 @@ module Google
957
1152
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
958
1153
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
959
1154
 
960
- header_params = {
961
- "name" => request.name
962
- }
1155
+ header_params = {}
1156
+ if request.name
1157
+ header_params["name"] = request.name
1158
+ end
1159
+
963
1160
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
964
1161
  metadata[:"x-goog-request-params"] ||= request_params_header
965
1162
 
966
1163
  options.apply_defaults timeout: @config.rpcs.get_model.timeout,
967
1164
  metadata: metadata,
968
1165
  retry_policy: @config.rpcs.get_model.retry_policy
969
- options.apply_defaults metadata: @config.metadata,
1166
+
1167
+ options.apply_defaults timeout: @config.timeout,
1168
+ metadata: @config.metadata,
970
1169
  retry_policy: @config.retry_policy
971
1170
 
972
1171
  @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
@@ -1001,11 +1200,11 @@ module Google
1001
1200
  # An expression for filtering the results of the request.
1002
1201
  #
1003
1202
  # * `model_metadata` - for existence of the case (e.g.
1004
- # video_classification_model_metadata:*).
1203
+ # `video_classification_model_metadata:*`).
1005
1204
  # * `dataset_id` - for = or !=. Some examples of using the filter are:
1006
1205
  #
1007
1206
  # * `image_classification_model_metadata:*` --> The model has
1008
- # image_classification_model_metadata.
1207
+ # `image_classification_model_metadata`.
1009
1208
  # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1010
1209
  # @param page_size [::Integer]
1011
1210
  # Requested page size.
@@ -1023,6 +1222,27 @@ module Google
1023
1222
  #
1024
1223
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1025
1224
  #
1225
+ # @example Basic example
1226
+ # require "google/cloud/automl/v1"
1227
+ #
1228
+ # # Create a client object. The client can be reused for multiple calls.
1229
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1230
+ #
1231
+ # # Create a request. To set request fields, pass in keyword arguments.
1232
+ # request = Google::Cloud::AutoML::V1::ListModelsRequest.new
1233
+ #
1234
+ # # Call the list_models method.
1235
+ # result = client.list_models request
1236
+ #
1237
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1238
+ # # iterate over all elements by calling #each, and the enumerable
1239
+ # # will lazily make API calls to fetch subsequent pages. Other
1240
+ # # methods are also available for managing paging directly.
1241
+ # result.each do |response|
1242
+ # # Each element is of type ::Google::Cloud::AutoML::V1::Model.
1243
+ # p response
1244
+ # end
1245
+ #
1026
1246
  def list_models request, options = nil
1027
1247
  raise ::ArgumentError, "request must be provided" if request.nil?
1028
1248
 
@@ -1040,16 +1260,20 @@ module Google
1040
1260
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1041
1261
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1042
1262
 
1043
- header_params = {
1044
- "parent" => request.parent
1045
- }
1263
+ header_params = {}
1264
+ if request.parent
1265
+ header_params["parent"] = request.parent
1266
+ end
1267
+
1046
1268
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1047
1269
  metadata[:"x-goog-request-params"] ||= request_params_header
1048
1270
 
1049
1271
  options.apply_defaults timeout: @config.rpcs.list_models.timeout,
1050
1272
  metadata: metadata,
1051
1273
  retry_policy: @config.rpcs.list_models.retry_policy
1052
- options.apply_defaults metadata: @config.metadata,
1274
+
1275
+ options.apply_defaults timeout: @config.timeout,
1276
+ metadata: @config.metadata,
1053
1277
  retry_policy: @config.retry_policy
1054
1278
 
1055
1279
  @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
@@ -1094,6 +1318,28 @@ module Google
1094
1318
  #
1095
1319
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1096
1320
  #
1321
+ # @example Basic example
1322
+ # require "google/cloud/automl/v1"
1323
+ #
1324
+ # # Create a client object. The client can be reused for multiple calls.
1325
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1326
+ #
1327
+ # # Create a request. To set request fields, pass in keyword arguments.
1328
+ # request = Google::Cloud::AutoML::V1::DeleteModelRequest.new
1329
+ #
1330
+ # # Call the delete_model method.
1331
+ # result = client.delete_model request
1332
+ #
1333
+ # # The returned object is of type Gapic::Operation. You can use this
1334
+ # # object to check the status of an operation, cancel it, or wait
1335
+ # # for results. Here is how to block until completion:
1336
+ # result.wait_until_done! timeout: 60
1337
+ # if result.response?
1338
+ # p result.response
1339
+ # else
1340
+ # puts "Error!"
1341
+ # end
1342
+ #
1097
1343
  def delete_model request, options = nil
1098
1344
  raise ::ArgumentError, "request must be provided" if request.nil?
1099
1345
 
@@ -1111,16 +1357,20 @@ module Google
1111
1357
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1112
1358
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1113
1359
 
1114
- header_params = {
1115
- "name" => request.name
1116
- }
1360
+ header_params = {}
1361
+ if request.name
1362
+ header_params["name"] = request.name
1363
+ end
1364
+
1117
1365
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1118
1366
  metadata[:"x-goog-request-params"] ||= request_params_header
1119
1367
 
1120
1368
  options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
1121
1369
  metadata: metadata,
1122
1370
  retry_policy: @config.rpcs.delete_model.retry_policy
1123
- options.apply_defaults metadata: @config.metadata,
1371
+
1372
+ options.apply_defaults timeout: @config.timeout,
1373
+ metadata: @config.metadata,
1124
1374
  retry_policy: @config.retry_policy
1125
1375
 
1126
1376
  @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
@@ -1163,6 +1413,21 @@ module Google
1163
1413
  #
1164
1414
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1165
1415
  #
1416
+ # @example Basic example
1417
+ # require "google/cloud/automl/v1"
1418
+ #
1419
+ # # Create a client object. The client can be reused for multiple calls.
1420
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1421
+ #
1422
+ # # Create a request. To set request fields, pass in keyword arguments.
1423
+ # request = Google::Cloud::AutoML::V1::UpdateModelRequest.new
1424
+ #
1425
+ # # Call the update_model method.
1426
+ # result = client.update_model request
1427
+ #
1428
+ # # The returned object is of type Google::Cloud::AutoML::V1::Model.
1429
+ # p result
1430
+ #
1166
1431
  def update_model request, options = nil
1167
1432
  raise ::ArgumentError, "request must be provided" if request.nil?
1168
1433
 
@@ -1180,16 +1445,20 @@ module Google
1180
1445
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1181
1446
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1182
1447
 
1183
- header_params = {
1184
- "model.name" => request.model.name
1185
- }
1448
+ header_params = {}
1449
+ if request.model&.name
1450
+ header_params["model.name"] = request.model.name
1451
+ end
1452
+
1186
1453
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1187
1454
  metadata[:"x-goog-request-params"] ||= request_params_header
1188
1455
 
1189
1456
  options.apply_defaults timeout: @config.rpcs.update_model.timeout,
1190
1457
  metadata: metadata,
1191
1458
  retry_policy: @config.rpcs.update_model.retry_policy
1192
- options.apply_defaults metadata: @config.metadata,
1459
+
1460
+ options.apply_defaults timeout: @config.timeout,
1461
+ metadata: @config.metadata,
1193
1462
  retry_policy: @config.retry_policy
1194
1463
 
1195
1464
  @auto_ml_stub.call_rpc :update_model, request, options: options do |response, operation|
@@ -1244,6 +1513,28 @@ module Google
1244
1513
  #
1245
1514
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1246
1515
  #
1516
+ # @example Basic example
1517
+ # require "google/cloud/automl/v1"
1518
+ #
1519
+ # # Create a client object. The client can be reused for multiple calls.
1520
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1521
+ #
1522
+ # # Create a request. To set request fields, pass in keyword arguments.
1523
+ # request = Google::Cloud::AutoML::V1::DeployModelRequest.new
1524
+ #
1525
+ # # Call the deploy_model method.
1526
+ # result = client.deploy_model request
1527
+ #
1528
+ # # The returned object is of type Gapic::Operation. You can use this
1529
+ # # object to check the status of an operation, cancel it, or wait
1530
+ # # for results. Here is how to block until completion:
1531
+ # result.wait_until_done! timeout: 60
1532
+ # if result.response?
1533
+ # p result.response
1534
+ # else
1535
+ # puts "Error!"
1536
+ # end
1537
+ #
1247
1538
  def deploy_model request, options = nil
1248
1539
  raise ::ArgumentError, "request must be provided" if request.nil?
1249
1540
 
@@ -1261,16 +1552,20 @@ module Google
1261
1552
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1262
1553
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1263
1554
 
1264
- header_params = {
1265
- "name" => request.name
1266
- }
1555
+ header_params = {}
1556
+ if request.name
1557
+ header_params["name"] = request.name
1558
+ end
1559
+
1267
1560
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1268
1561
  metadata[:"x-goog-request-params"] ||= request_params_header
1269
1562
 
1270
1563
  options.apply_defaults timeout: @config.rpcs.deploy_model.timeout,
1271
1564
  metadata: metadata,
1272
1565
  retry_policy: @config.rpcs.deploy_model.retry_policy
1273
- options.apply_defaults metadata: @config.metadata,
1566
+
1567
+ options.apply_defaults timeout: @config.timeout,
1568
+ metadata: @config.metadata,
1274
1569
  retry_policy: @config.retry_policy
1275
1570
 
1276
1571
  @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
@@ -1317,6 +1612,28 @@ module Google
1317
1612
  #
1318
1613
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1319
1614
  #
1615
+ # @example Basic example
1616
+ # require "google/cloud/automl/v1"
1617
+ #
1618
+ # # Create a client object. The client can be reused for multiple calls.
1619
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1620
+ #
1621
+ # # Create a request. To set request fields, pass in keyword arguments.
1622
+ # request = Google::Cloud::AutoML::V1::UndeployModelRequest.new
1623
+ #
1624
+ # # Call the undeploy_model method.
1625
+ # result = client.undeploy_model request
1626
+ #
1627
+ # # The returned object is of type Gapic::Operation. You can use this
1628
+ # # object to check the status of an operation, cancel it, or wait
1629
+ # # for results. Here is how to block until completion:
1630
+ # result.wait_until_done! timeout: 60
1631
+ # if result.response?
1632
+ # p result.response
1633
+ # else
1634
+ # puts "Error!"
1635
+ # end
1636
+ #
1320
1637
  def undeploy_model request, options = nil
1321
1638
  raise ::ArgumentError, "request must be provided" if request.nil?
1322
1639
 
@@ -1334,16 +1651,20 @@ module Google
1334
1651
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1335
1652
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1336
1653
 
1337
- header_params = {
1338
- "name" => request.name
1339
- }
1654
+ header_params = {}
1655
+ if request.name
1656
+ header_params["name"] = request.name
1657
+ end
1658
+
1340
1659
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1341
1660
  metadata[:"x-goog-request-params"] ||= request_params_header
1342
1661
 
1343
1662
  options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout,
1344
1663
  metadata: metadata,
1345
1664
  retry_policy: @config.rpcs.undeploy_model.retry_policy
1346
- options.apply_defaults metadata: @config.metadata,
1665
+
1666
+ options.apply_defaults timeout: @config.timeout,
1667
+ metadata: @config.metadata,
1347
1668
  retry_policy: @config.retry_policy
1348
1669
 
1349
1670
  @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
@@ -1392,6 +1713,28 @@ module Google
1392
1713
  #
1393
1714
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1394
1715
  #
1716
+ # @example Basic example
1717
+ # require "google/cloud/automl/v1"
1718
+ #
1719
+ # # Create a client object. The client can be reused for multiple calls.
1720
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1721
+ #
1722
+ # # Create a request. To set request fields, pass in keyword arguments.
1723
+ # request = Google::Cloud::AutoML::V1::ExportModelRequest.new
1724
+ #
1725
+ # # Call the export_model method.
1726
+ # result = client.export_model request
1727
+ #
1728
+ # # The returned object is of type Gapic::Operation. You can use this
1729
+ # # object to check the status of an operation, cancel it, or wait
1730
+ # # for results. Here is how to block until completion:
1731
+ # result.wait_until_done! timeout: 60
1732
+ # if result.response?
1733
+ # p result.response
1734
+ # else
1735
+ # puts "Error!"
1736
+ # end
1737
+ #
1395
1738
  def export_model request, options = nil
1396
1739
  raise ::ArgumentError, "request must be provided" if request.nil?
1397
1740
 
@@ -1409,16 +1752,20 @@ module Google
1409
1752
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1410
1753
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1411
1754
 
1412
- header_params = {
1413
- "name" => request.name
1414
- }
1755
+ header_params = {}
1756
+ if request.name
1757
+ header_params["name"] = request.name
1758
+ end
1759
+
1415
1760
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1416
1761
  metadata[:"x-goog-request-params"] ||= request_params_header
1417
1762
 
1418
1763
  options.apply_defaults timeout: @config.rpcs.export_model.timeout,
1419
1764
  metadata: metadata,
1420
1765
  retry_policy: @config.rpcs.export_model.retry_policy
1421
- options.apply_defaults metadata: @config.metadata,
1766
+
1767
+ options.apply_defaults timeout: @config.timeout,
1768
+ metadata: @config.metadata,
1422
1769
  retry_policy: @config.retry_policy
1423
1770
 
1424
1771
  @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
@@ -1459,6 +1806,21 @@ module Google
1459
1806
  #
1460
1807
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1461
1808
  #
1809
+ # @example Basic example
1810
+ # require "google/cloud/automl/v1"
1811
+ #
1812
+ # # Create a client object. The client can be reused for multiple calls.
1813
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1814
+ #
1815
+ # # Create a request. To set request fields, pass in keyword arguments.
1816
+ # request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new
1817
+ #
1818
+ # # Call the get_model_evaluation method.
1819
+ # result = client.get_model_evaluation request
1820
+ #
1821
+ # # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation.
1822
+ # p result
1823
+ #
1462
1824
  def get_model_evaluation request, options = nil
1463
1825
  raise ::ArgumentError, "request must be provided" if request.nil?
1464
1826
 
@@ -1476,16 +1838,20 @@ module Google
1476
1838
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1477
1839
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1478
1840
 
1479
- header_params = {
1480
- "name" => request.name
1481
- }
1841
+ header_params = {}
1842
+ if request.name
1843
+ header_params["name"] = request.name
1844
+ end
1845
+
1482
1846
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1483
1847
  metadata[:"x-goog-request-params"] ||= request_params_header
1484
1848
 
1485
1849
  options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout,
1486
1850
  metadata: metadata,
1487
1851
  retry_policy: @config.rpcs.get_model_evaluation.retry_policy
1488
- options.apply_defaults metadata: @config.metadata,
1852
+
1853
+ options.apply_defaults timeout: @config.timeout,
1854
+ metadata: @config.metadata,
1489
1855
  retry_policy: @config.retry_policy
1490
1856
 
1491
1857
  @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
@@ -1546,6 +1912,27 @@ module Google
1546
1912
  #
1547
1913
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1548
1914
  #
1915
+ # @example Basic example
1916
+ # require "google/cloud/automl/v1"
1917
+ #
1918
+ # # Create a client object. The client can be reused for multiple calls.
1919
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1920
+ #
1921
+ # # Create a request. To set request fields, pass in keyword arguments.
1922
+ # request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new
1923
+ #
1924
+ # # Call the list_model_evaluations method.
1925
+ # result = client.list_model_evaluations request
1926
+ #
1927
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1928
+ # # iterate over all elements by calling #each, and the enumerable
1929
+ # # will lazily make API calls to fetch subsequent pages. Other
1930
+ # # methods are also available for managing paging directly.
1931
+ # result.each do |response|
1932
+ # # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation.
1933
+ # p response
1934
+ # end
1935
+ #
1549
1936
  def list_model_evaluations request, options = nil
1550
1937
  raise ::ArgumentError, "request must be provided" if request.nil?
1551
1938
 
@@ -1563,16 +1950,20 @@ module Google
1563
1950
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1564
1951
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1565
1952
 
1566
- header_params = {
1567
- "parent" => request.parent
1568
- }
1953
+ header_params = {}
1954
+ if request.parent
1955
+ header_params["parent"] = request.parent
1956
+ end
1957
+
1569
1958
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1570
1959
  metadata[:"x-goog-request-params"] ||= request_params_header
1571
1960
 
1572
1961
  options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout,
1573
1962
  metadata: metadata,
1574
1963
  retry_policy: @config.rpcs.list_model_evaluations.retry_policy
1575
- options.apply_defaults metadata: @config.metadata,
1964
+
1965
+ options.apply_defaults timeout: @config.timeout,
1966
+ metadata: @config.metadata,
1576
1967
  retry_policy: @config.retry_policy
1577
1968
 
1578
1969
  @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
@@ -1597,22 +1988,21 @@ module Google
1597
1988
  # Configuration can be applied globally to all clients, or to a single client
1598
1989
  # on construction.
1599
1990
  #
1600
- # # Examples
1601
- #
1602
- # To modify the global config, setting the timeout for create_dataset
1603
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1604
- #
1605
- # ::Google::Cloud::AutoML::V1::AutoML::Client.configure do |config|
1606
- # config.timeout = 10.0
1607
- # config.rpcs.create_dataset.timeout = 20.0
1608
- # end
1609
- #
1610
- # To apply the above configuration only to a new client:
1611
- #
1612
- # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
1613
- # config.timeout = 10.0
1614
- # config.rpcs.create_dataset.timeout = 20.0
1615
- # end
1991
+ # @example
1992
+ #
1993
+ # # Modify the global config, setting the timeout for
1994
+ # # create_dataset to 20 seconds,
1995
+ # # and all remaining timeouts to 10 seconds.
1996
+ # ::Google::Cloud::AutoML::V1::AutoML::Client.configure do |config|
1997
+ # config.timeout = 10.0
1998
+ # config.rpcs.create_dataset.timeout = 20.0
1999
+ # end
2000
+ #
2001
+ # # Apply the above configuration only to a new client.
2002
+ # client = ::Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
2003
+ # config.timeout = 10.0
2004
+ # config.rpcs.create_dataset.timeout = 20.0
2005
+ # end
1616
2006
  #
1617
2007
  # @!attribute [rw] endpoint
1618
2008
  # The hostname or hostname:port of the service endpoint.