google-cloud-automl-v1 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +2 -2
  3. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +2 -2
  4. data/lib/google/cloud/automl/v1/automl/client.rb +441 -54
  5. data/lib/google/cloud/automl/v1/automl/operations.rb +115 -12
  6. data/lib/google/cloud/automl/v1/classification_pb.rb +1 -1
  7. data/lib/google/cloud/automl/v1/data_items_pb.rb +2 -2
  8. data/lib/google/cloud/automl/v1/dataset_pb.rb +2 -2
  9. data/lib/google/cloud/automl/v1/detection_pb.rb +2 -2
  10. data/lib/google/cloud/automl/v1/geometry_pb.rb +1 -1
  11. data/lib/google/cloud/automl/v1/image_pb.rb +2 -2
  12. data/lib/google/cloud/automl/v1/io_pb.rb +2 -2
  13. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +2 -2
  14. data/lib/google/cloud/automl/v1/model_pb.rb +2 -2
  15. data/lib/google/cloud/automl/v1/operations_pb.rb +2 -2
  16. data/lib/google/cloud/automl/v1/prediction_service/client.rb +47 -6
  17. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +115 -12
  18. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +2 -2
  19. data/lib/google/cloud/automl/v1/prediction_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/automl/v1/service_pb.rb +2 -2
  21. data/lib/google/cloud/automl/v1/service_services_pb.rb +1 -1
  22. data/lib/google/cloud/automl/v1/text_extraction_pb.rb +2 -2
  23. data/lib/google/cloud/automl/v1/text_pb.rb +2 -2
  24. data/lib/google/cloud/automl/v1/text_segment_pb.rb +1 -1
  25. data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +2 -2
  26. data/lib/google/cloud/automl/v1/translation_pb.rb +2 -2
  27. data/lib/google/cloud/automl/v1/version.rb +1 -1
  28. metadata +2 -2
@@ -263,6 +263,28 @@ module Google
263
263
  #
264
264
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
265
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
+ #
266
288
  def create_dataset request, options = nil
267
289
  raise ::ArgumentError, "request must be provided" if request.nil?
268
290
 
@@ -280,9 +302,11 @@ module Google
280
302
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
281
303
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
282
304
 
283
- header_params = {
284
- "parent" => request.parent
285
- }
305
+ header_params = {}
306
+ if request.parent
307
+ header_params["parent"] = request.parent
308
+ end
309
+
286
310
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
287
311
  metadata[:"x-goog-request-params"] ||= request_params_header
288
312
 
@@ -332,6 +356,21 @@ module Google
332
356
  #
333
357
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
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
+ #
335
374
  def get_dataset request, options = nil
336
375
  raise ::ArgumentError, "request must be provided" if request.nil?
337
376
 
@@ -349,9 +388,11 @@ module Google
349
388
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
350
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
351
390
 
352
- header_params = {
353
- "name" => request.name
354
- }
391
+ header_params = {}
392
+ if request.name
393
+ header_params["name"] = request.name
394
+ end
395
+
355
396
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
356
397
  metadata[:"x-goog-request-params"] ||= request_params_header
357
398
 
@@ -416,6 +457,27 @@ module Google
416
457
  #
417
458
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
418
459
  #
460
+ # @example Basic example
461
+ # require "google/cloud/automl/v1"
462
+ #
463
+ # # Create a client object. The client can be reused for multiple calls.
464
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
465
+ #
466
+ # # Create a request. To set request fields, pass in keyword arguments.
467
+ # request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new
468
+ #
469
+ # # Call the list_datasets method.
470
+ # result = client.list_datasets request
471
+ #
472
+ # # The returned object is of type Gapic::PagedEnumerable. You can
473
+ # # iterate over all elements by calling #each, and the enumerable
474
+ # # will lazily make API calls to fetch subsequent pages. Other
475
+ # # methods are also available for managing paging directly.
476
+ # result.each do |response|
477
+ # # Each element is of type ::Google::Cloud::AutoML::V1::Dataset.
478
+ # p response
479
+ # end
480
+ #
419
481
  def list_datasets request, options = nil
420
482
  raise ::ArgumentError, "request must be provided" if request.nil?
421
483
 
@@ -433,9 +495,11 @@ module Google
433
495
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
434
496
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
435
497
 
436
- header_params = {
437
- "parent" => request.parent
438
- }
498
+ header_params = {}
499
+ if request.parent
500
+ header_params["parent"] = request.parent
501
+ end
502
+
439
503
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
440
504
  metadata[:"x-goog-request-params"] ||= request_params_header
441
505
 
@@ -487,6 +551,21 @@ module Google
487
551
  #
488
552
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
489
553
  #
554
+ # @example Basic example
555
+ # require "google/cloud/automl/v1"
556
+ #
557
+ # # Create a client object. The client can be reused for multiple calls.
558
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
559
+ #
560
+ # # Create a request. To set request fields, pass in keyword arguments.
561
+ # request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new
562
+ #
563
+ # # Call the update_dataset method.
564
+ # result = client.update_dataset request
565
+ #
566
+ # # The returned object is of type Google::Cloud::AutoML::V1::Dataset.
567
+ # p result
568
+ #
490
569
  def update_dataset request, options = nil
491
570
  raise ::ArgumentError, "request must be provided" if request.nil?
492
571
 
@@ -504,9 +583,11 @@ module Google
504
583
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
505
584
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
506
585
 
507
- header_params = {
508
- "dataset.name" => request.dataset.name
509
- }
586
+ header_params = {}
587
+ if request.dataset&.name
588
+ header_params["dataset.name"] = request.dataset.name
589
+ end
590
+
510
591
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
511
592
  metadata[:"x-goog-request-params"] ||= request_params_header
512
593
 
@@ -559,6 +640,28 @@ module Google
559
640
  #
560
641
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
561
642
  #
643
+ # @example Basic example
644
+ # require "google/cloud/automl/v1"
645
+ #
646
+ # # Create a client object. The client can be reused for multiple calls.
647
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
648
+ #
649
+ # # Create a request. To set request fields, pass in keyword arguments.
650
+ # request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new
651
+ #
652
+ # # Call the delete_dataset method.
653
+ # result = client.delete_dataset request
654
+ #
655
+ # # The returned object is of type Gapic::Operation. You can use this
656
+ # # object to check the status of an operation, cancel it, or wait
657
+ # # for results. Here is how to block until completion:
658
+ # result.wait_until_done! timeout: 60
659
+ # if result.response?
660
+ # p result.response
661
+ # else
662
+ # puts "Error!"
663
+ # end
664
+ #
562
665
  def delete_dataset request, options = nil
563
666
  raise ::ArgumentError, "request must be provided" if request.nil?
564
667
 
@@ -576,9 +679,11 @@ module Google
576
679
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
577
680
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
578
681
 
579
- header_params = {
580
- "name" => request.name
581
- }
682
+ header_params = {}
683
+ if request.name
684
+ header_params["name"] = request.name
685
+ end
686
+
582
687
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
583
688
  metadata[:"x-goog-request-params"] ||= request_params_header
584
689
 
@@ -640,6 +745,28 @@ module Google
640
745
  #
641
746
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
642
747
  #
748
+ # @example Basic example
749
+ # require "google/cloud/automl/v1"
750
+ #
751
+ # # Create a client object. The client can be reused for multiple calls.
752
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
753
+ #
754
+ # # Create a request. To set request fields, pass in keyword arguments.
755
+ # request = Google::Cloud::AutoML::V1::ImportDataRequest.new
756
+ #
757
+ # # Call the import_data method.
758
+ # result = client.import_data request
759
+ #
760
+ # # The returned object is of type Gapic::Operation. You can use this
761
+ # # object to check the status of an operation, cancel it, or wait
762
+ # # for results. Here is how to block until completion:
763
+ # result.wait_until_done! timeout: 60
764
+ # if result.response?
765
+ # p result.response
766
+ # else
767
+ # puts "Error!"
768
+ # end
769
+ #
643
770
  def import_data request, options = nil
644
771
  raise ::ArgumentError, "request must be provided" if request.nil?
645
772
 
@@ -657,9 +784,11 @@ module Google
657
784
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
658
785
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
786
 
660
- header_params = {
661
- "name" => request.name
662
- }
787
+ header_params = {}
788
+ if request.name
789
+ header_params["name"] = request.name
790
+ end
791
+
663
792
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
664
793
  metadata[:"x-goog-request-params"] ||= request_params_header
665
794
 
@@ -713,6 +842,28 @@ module Google
713
842
  #
714
843
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
715
844
  #
845
+ # @example Basic example
846
+ # require "google/cloud/automl/v1"
847
+ #
848
+ # # Create a client object. The client can be reused for multiple calls.
849
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
850
+ #
851
+ # # Create a request. To set request fields, pass in keyword arguments.
852
+ # request = Google::Cloud::AutoML::V1::ExportDataRequest.new
853
+ #
854
+ # # Call the export_data method.
855
+ # result = client.export_data request
856
+ #
857
+ # # The returned object is of type Gapic::Operation. You can use this
858
+ # # object to check the status of an operation, cancel it, or wait
859
+ # # for results. Here is how to block until completion:
860
+ # result.wait_until_done! timeout: 60
861
+ # if result.response?
862
+ # p result.response
863
+ # else
864
+ # puts "Error!"
865
+ # end
866
+ #
716
867
  def export_data request, options = nil
717
868
  raise ::ArgumentError, "request must be provided" if request.nil?
718
869
 
@@ -730,9 +881,11 @@ module Google
730
881
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
731
882
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
732
883
 
733
- header_params = {
734
- "name" => request.name
735
- }
884
+ header_params = {}
885
+ if request.name
886
+ header_params["name"] = request.name
887
+ end
888
+
736
889
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
737
890
  metadata[:"x-goog-request-params"] ||= request_params_header
738
891
 
@@ -782,6 +935,21 @@ module Google
782
935
  #
783
936
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
784
937
  #
938
+ # @example Basic example
939
+ # require "google/cloud/automl/v1"
940
+ #
941
+ # # Create a client object. The client can be reused for multiple calls.
942
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
943
+ #
944
+ # # Create a request. To set request fields, pass in keyword arguments.
945
+ # request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new
946
+ #
947
+ # # Call the get_annotation_spec method.
948
+ # result = client.get_annotation_spec request
949
+ #
950
+ # # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec.
951
+ # p result
952
+ #
785
953
  def get_annotation_spec request, options = nil
786
954
  raise ::ArgumentError, "request must be provided" if request.nil?
787
955
 
@@ -799,9 +967,11 @@ module Google
799
967
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
800
968
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
801
969
 
802
- header_params = {
803
- "name" => request.name
804
- }
970
+ header_params = {}
971
+ if request.name
972
+ header_params["name"] = request.name
973
+ end
974
+
805
975
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
806
976
  metadata[:"x-goog-request-params"] ||= request_params_header
807
977
 
@@ -856,6 +1026,28 @@ module Google
856
1026
  #
857
1027
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
858
1028
  #
1029
+ # @example Basic example
1030
+ # require "google/cloud/automl/v1"
1031
+ #
1032
+ # # Create a client object. The client can be reused for multiple calls.
1033
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1034
+ #
1035
+ # # Create a request. To set request fields, pass in keyword arguments.
1036
+ # request = Google::Cloud::AutoML::V1::CreateModelRequest.new
1037
+ #
1038
+ # # Call the create_model method.
1039
+ # result = client.create_model request
1040
+ #
1041
+ # # The returned object is of type Gapic::Operation. You can use this
1042
+ # # object to check the status of an operation, cancel it, or wait
1043
+ # # for results. Here is how to block until completion:
1044
+ # result.wait_until_done! timeout: 60
1045
+ # if result.response?
1046
+ # p result.response
1047
+ # else
1048
+ # puts "Error!"
1049
+ # end
1050
+ #
859
1051
  def create_model request, options = nil
860
1052
  raise ::ArgumentError, "request must be provided" if request.nil?
861
1053
 
@@ -873,9 +1065,11 @@ module Google
873
1065
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
874
1066
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
875
1067
 
876
- header_params = {
877
- "parent" => request.parent
878
- }
1068
+ header_params = {}
1069
+ if request.parent
1070
+ header_params["parent"] = request.parent
1071
+ end
1072
+
879
1073
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
880
1074
  metadata[:"x-goog-request-params"] ||= request_params_header
881
1075
 
@@ -925,6 +1119,21 @@ module Google
925
1119
  #
926
1120
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
927
1121
  #
1122
+ # @example Basic example
1123
+ # require "google/cloud/automl/v1"
1124
+ #
1125
+ # # Create a client object. The client can be reused for multiple calls.
1126
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1127
+ #
1128
+ # # Create a request. To set request fields, pass in keyword arguments.
1129
+ # request = Google::Cloud::AutoML::V1::GetModelRequest.new
1130
+ #
1131
+ # # Call the get_model method.
1132
+ # result = client.get_model request
1133
+ #
1134
+ # # The returned object is of type Google::Cloud::AutoML::V1::Model.
1135
+ # p result
1136
+ #
928
1137
  def get_model request, options = nil
929
1138
  raise ::ArgumentError, "request must be provided" if request.nil?
930
1139
 
@@ -942,9 +1151,11 @@ module Google
942
1151
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
943
1152
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
944
1153
 
945
- header_params = {
946
- "name" => request.name
947
- }
1154
+ header_params = {}
1155
+ if request.name
1156
+ header_params["name"] = request.name
1157
+ end
1158
+
948
1159
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
949
1160
  metadata[:"x-goog-request-params"] ||= request_params_header
950
1161
 
@@ -1010,6 +1221,27 @@ module Google
1010
1221
  #
1011
1222
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1012
1223
  #
1224
+ # @example Basic example
1225
+ # require "google/cloud/automl/v1"
1226
+ #
1227
+ # # Create a client object. The client can be reused for multiple calls.
1228
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1229
+ #
1230
+ # # Create a request. To set request fields, pass in keyword arguments.
1231
+ # request = Google::Cloud::AutoML::V1::ListModelsRequest.new
1232
+ #
1233
+ # # Call the list_models method.
1234
+ # result = client.list_models request
1235
+ #
1236
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1237
+ # # iterate over all elements by calling #each, and the enumerable
1238
+ # # will lazily make API calls to fetch subsequent pages. Other
1239
+ # # methods are also available for managing paging directly.
1240
+ # result.each do |response|
1241
+ # # Each element is of type ::Google::Cloud::AutoML::V1::Model.
1242
+ # p response
1243
+ # end
1244
+ #
1013
1245
  def list_models request, options = nil
1014
1246
  raise ::ArgumentError, "request must be provided" if request.nil?
1015
1247
 
@@ -1027,9 +1259,11 @@ module Google
1027
1259
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1028
1260
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1029
1261
 
1030
- header_params = {
1031
- "parent" => request.parent
1032
- }
1262
+ header_params = {}
1263
+ if request.parent
1264
+ header_params["parent"] = request.parent
1265
+ end
1266
+
1033
1267
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1034
1268
  metadata[:"x-goog-request-params"] ||= request_params_header
1035
1269
 
@@ -1083,6 +1317,28 @@ module Google
1083
1317
  #
1084
1318
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1085
1319
  #
1320
+ # @example Basic example
1321
+ # require "google/cloud/automl/v1"
1322
+ #
1323
+ # # Create a client object. The client can be reused for multiple calls.
1324
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1325
+ #
1326
+ # # Create a request. To set request fields, pass in keyword arguments.
1327
+ # request = Google::Cloud::AutoML::V1::DeleteModelRequest.new
1328
+ #
1329
+ # # Call the delete_model method.
1330
+ # result = client.delete_model request
1331
+ #
1332
+ # # The returned object is of type Gapic::Operation. You can use this
1333
+ # # object to check the status of an operation, cancel it, or wait
1334
+ # # for results. Here is how to block until completion:
1335
+ # result.wait_until_done! timeout: 60
1336
+ # if result.response?
1337
+ # p result.response
1338
+ # else
1339
+ # puts "Error!"
1340
+ # end
1341
+ #
1086
1342
  def delete_model request, options = nil
1087
1343
  raise ::ArgumentError, "request must be provided" if request.nil?
1088
1344
 
@@ -1100,9 +1356,11 @@ module Google
1100
1356
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1101
1357
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1102
1358
 
1103
- header_params = {
1104
- "name" => request.name
1105
- }
1359
+ header_params = {}
1360
+ if request.name
1361
+ header_params["name"] = request.name
1362
+ end
1363
+
1106
1364
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1107
1365
  metadata[:"x-goog-request-params"] ||= request_params_header
1108
1366
 
@@ -1154,6 +1412,21 @@ module Google
1154
1412
  #
1155
1413
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1156
1414
  #
1415
+ # @example Basic example
1416
+ # require "google/cloud/automl/v1"
1417
+ #
1418
+ # # Create a client object. The client can be reused for multiple calls.
1419
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1420
+ #
1421
+ # # Create a request. To set request fields, pass in keyword arguments.
1422
+ # request = Google::Cloud::AutoML::V1::UpdateModelRequest.new
1423
+ #
1424
+ # # Call the update_model method.
1425
+ # result = client.update_model request
1426
+ #
1427
+ # # The returned object is of type Google::Cloud::AutoML::V1::Model.
1428
+ # p result
1429
+ #
1157
1430
  def update_model request, options = nil
1158
1431
  raise ::ArgumentError, "request must be provided" if request.nil?
1159
1432
 
@@ -1171,9 +1444,11 @@ module Google
1171
1444
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1172
1445
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1173
1446
 
1174
- header_params = {
1175
- "model.name" => request.model.name
1176
- }
1447
+ header_params = {}
1448
+ if request.model&.name
1449
+ header_params["model.name"] = request.model.name
1450
+ end
1451
+
1177
1452
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1178
1453
  metadata[:"x-goog-request-params"] ||= request_params_header
1179
1454
 
@@ -1237,6 +1512,28 @@ module Google
1237
1512
  #
1238
1513
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1239
1514
  #
1515
+ # @example Basic example
1516
+ # require "google/cloud/automl/v1"
1517
+ #
1518
+ # # Create a client object. The client can be reused for multiple calls.
1519
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1520
+ #
1521
+ # # Create a request. To set request fields, pass in keyword arguments.
1522
+ # request = Google::Cloud::AutoML::V1::DeployModelRequest.new
1523
+ #
1524
+ # # Call the deploy_model method.
1525
+ # result = client.deploy_model request
1526
+ #
1527
+ # # The returned object is of type Gapic::Operation. You can use this
1528
+ # # object to check the status of an operation, cancel it, or wait
1529
+ # # for results. Here is how to block until completion:
1530
+ # result.wait_until_done! timeout: 60
1531
+ # if result.response?
1532
+ # p result.response
1533
+ # else
1534
+ # puts "Error!"
1535
+ # end
1536
+ #
1240
1537
  def deploy_model request, options = nil
1241
1538
  raise ::ArgumentError, "request must be provided" if request.nil?
1242
1539
 
@@ -1254,9 +1551,11 @@ module Google
1254
1551
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1255
1552
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1256
1553
 
1257
- header_params = {
1258
- "name" => request.name
1259
- }
1554
+ header_params = {}
1555
+ if request.name
1556
+ header_params["name"] = request.name
1557
+ end
1558
+
1260
1559
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1261
1560
  metadata[:"x-goog-request-params"] ||= request_params_header
1262
1561
 
@@ -1312,6 +1611,28 @@ module Google
1312
1611
  #
1313
1612
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1314
1613
  #
1614
+ # @example Basic example
1615
+ # require "google/cloud/automl/v1"
1616
+ #
1617
+ # # Create a client object. The client can be reused for multiple calls.
1618
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1619
+ #
1620
+ # # Create a request. To set request fields, pass in keyword arguments.
1621
+ # request = Google::Cloud::AutoML::V1::UndeployModelRequest.new
1622
+ #
1623
+ # # Call the undeploy_model method.
1624
+ # result = client.undeploy_model request
1625
+ #
1626
+ # # The returned object is of type Gapic::Operation. You can use this
1627
+ # # object to check the status of an operation, cancel it, or wait
1628
+ # # for results. Here is how to block until completion:
1629
+ # result.wait_until_done! timeout: 60
1630
+ # if result.response?
1631
+ # p result.response
1632
+ # else
1633
+ # puts "Error!"
1634
+ # end
1635
+ #
1315
1636
  def undeploy_model request, options = nil
1316
1637
  raise ::ArgumentError, "request must be provided" if request.nil?
1317
1638
 
@@ -1329,9 +1650,11 @@ module Google
1329
1650
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1330
1651
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1331
1652
 
1332
- header_params = {
1333
- "name" => request.name
1334
- }
1653
+ header_params = {}
1654
+ if request.name
1655
+ header_params["name"] = request.name
1656
+ end
1657
+
1335
1658
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1336
1659
  metadata[:"x-goog-request-params"] ||= request_params_header
1337
1660
 
@@ -1389,6 +1712,28 @@ module Google
1389
1712
  #
1390
1713
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1391
1714
  #
1715
+ # @example Basic example
1716
+ # require "google/cloud/automl/v1"
1717
+ #
1718
+ # # Create a client object. The client can be reused for multiple calls.
1719
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1720
+ #
1721
+ # # Create a request. To set request fields, pass in keyword arguments.
1722
+ # request = Google::Cloud::AutoML::V1::ExportModelRequest.new
1723
+ #
1724
+ # # Call the export_model method.
1725
+ # result = client.export_model request
1726
+ #
1727
+ # # The returned object is of type Gapic::Operation. You can use this
1728
+ # # object to check the status of an operation, cancel it, or wait
1729
+ # # for results. Here is how to block until completion:
1730
+ # result.wait_until_done! timeout: 60
1731
+ # if result.response?
1732
+ # p result.response
1733
+ # else
1734
+ # puts "Error!"
1735
+ # end
1736
+ #
1392
1737
  def export_model request, options = nil
1393
1738
  raise ::ArgumentError, "request must be provided" if request.nil?
1394
1739
 
@@ -1406,9 +1751,11 @@ module Google
1406
1751
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1407
1752
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1408
1753
 
1409
- header_params = {
1410
- "name" => request.name
1411
- }
1754
+ header_params = {}
1755
+ if request.name
1756
+ header_params["name"] = request.name
1757
+ end
1758
+
1412
1759
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1413
1760
  metadata[:"x-goog-request-params"] ||= request_params_header
1414
1761
 
@@ -1458,6 +1805,21 @@ module Google
1458
1805
  #
1459
1806
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1460
1807
  #
1808
+ # @example Basic example
1809
+ # require "google/cloud/automl/v1"
1810
+ #
1811
+ # # Create a client object. The client can be reused for multiple calls.
1812
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1813
+ #
1814
+ # # Create a request. To set request fields, pass in keyword arguments.
1815
+ # request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new
1816
+ #
1817
+ # # Call the get_model_evaluation method.
1818
+ # result = client.get_model_evaluation request
1819
+ #
1820
+ # # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation.
1821
+ # p result
1822
+ #
1461
1823
  def get_model_evaluation request, options = nil
1462
1824
  raise ::ArgumentError, "request must be provided" if request.nil?
1463
1825
 
@@ -1475,9 +1837,11 @@ module Google
1475
1837
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1476
1838
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1477
1839
 
1478
- header_params = {
1479
- "name" => request.name
1480
- }
1840
+ header_params = {}
1841
+ if request.name
1842
+ header_params["name"] = request.name
1843
+ end
1844
+
1481
1845
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1482
1846
  metadata[:"x-goog-request-params"] ||= request_params_header
1483
1847
 
@@ -1547,6 +1911,27 @@ module Google
1547
1911
  #
1548
1912
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1549
1913
  #
1914
+ # @example Basic example
1915
+ # require "google/cloud/automl/v1"
1916
+ #
1917
+ # # Create a client object. The client can be reused for multiple calls.
1918
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
1919
+ #
1920
+ # # Create a request. To set request fields, pass in keyword arguments.
1921
+ # request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new
1922
+ #
1923
+ # # Call the list_model_evaluations method.
1924
+ # result = client.list_model_evaluations request
1925
+ #
1926
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1927
+ # # iterate over all elements by calling #each, and the enumerable
1928
+ # # will lazily make API calls to fetch subsequent pages. Other
1929
+ # # methods are also available for managing paging directly.
1930
+ # result.each do |response|
1931
+ # # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation.
1932
+ # p response
1933
+ # end
1934
+ #
1550
1935
  def list_model_evaluations request, options = nil
1551
1936
  raise ::ArgumentError, "request must be provided" if request.nil?
1552
1937
 
@@ -1564,9 +1949,11 @@ module Google
1564
1949
  gapic_version: ::Google::Cloud::AutoML::V1::VERSION
1565
1950
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1566
1951
 
1567
- header_params = {
1568
- "parent" => request.parent
1569
- }
1952
+ header_params = {}
1953
+ if request.parent
1954
+ header_params["parent"] = request.parent
1955
+ end
1956
+
1570
1957
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1571
1958
  metadata[:"x-goog-request-params"] ||= request_params_header
1572
1959