google-cloud-automl-v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-automl-v1beta1.rb +21 -0
  7. data/lib/google/cloud/automl/v1beta1.rb +36 -0
  8. data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +41 -0
  9. data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +26 -0
  10. data/lib/google/cloud/automl/v1beta1/automl.rb +63 -0
  11. data/lib/google/cloud/automl/v1beta1/automl/client.rb +2368 -0
  12. data/lib/google/cloud/automl/v1beta1/automl/credentials.rb +51 -0
  13. data/lib/google/cloud/automl/v1beta1/automl/operations.rb +564 -0
  14. data/lib/google/cloud/automl/v1beta1/automl/paths.rb +174 -0
  15. data/lib/google/cloud/automl/v1beta1/classification_pb.rb +73 -0
  16. data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +36 -0
  17. data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +95 -0
  18. data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +84 -0
  19. data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +43 -0
  20. data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +46 -0
  21. data/lib/google/cloud/automl/v1beta1/detection_pb.rb +59 -0
  22. data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +28 -0
  23. data/lib/google/cloud/automl/v1beta1/image_pb.rb +57 -0
  24. data/lib/google/cloud/automl/v1beta1/io_pb.rb +87 -0
  25. data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +45 -0
  26. data/lib/google/cloud/automl/v1beta1/model_pb.rb +52 -0
  27. data/lib/google/cloud/automl/v1beta1/operations_pb.rb +97 -0
  28. data/lib/google/cloud/automl/v1beta1/prediction_service.rb +53 -0
  29. data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +586 -0
  30. data/lib/google/cloud/automl/v1beta1/prediction_service/credentials.rb +51 -0
  31. data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +564 -0
  32. data/lib/google/cloud/automl/v1beta1/prediction_service/paths.rb +52 -0
  33. data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +50 -0
  34. data/lib/google/cloud/automl/v1beta1/prediction_service_services_pb.rb +79 -0
  35. data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +24 -0
  36. data/lib/google/cloud/automl/v1beta1/regression_pb.rb +27 -0
  37. data/lib/google/cloud/automl/v1beta1/service_pb.rb +187 -0
  38. data/lib/google/cloud/automl/v1beta1/service_services_pb.rb +163 -0
  39. data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +31 -0
  40. data/lib/google/cloud/automl/v1beta1/tables_pb.rb +65 -0
  41. data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +25 -0
  42. data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +39 -0
  43. data/lib/google/cloud/automl/v1beta1/text_pb.rb +41 -0
  44. data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +25 -0
  45. data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +36 -0
  46. data/lib/google/cloud/automl/v1beta1/translation_pb.rb +41 -0
  47. data/lib/google/cloud/automl/v1beta1/version.rb +28 -0
  48. data/lib/google/cloud/automl/v1beta1/video_pb.rb +32 -0
  49. data/lib/google/cloud/common_resources_pb.rb +15 -0
  50. data/proto_docs/README.md +4 -0
  51. data/proto_docs/google/api/field_behavior.rb +59 -0
  52. data/proto_docs/google/api/resource.rb +247 -0
  53. data/proto_docs/google/cloud/automl/v1beta1/annotation_payload.rb +70 -0
  54. data/proto_docs/google/cloud/automl/v1beta1/annotation_spec.rb +46 -0
  55. data/proto_docs/google/cloud/automl/v1beta1/classification.rb +234 -0
  56. data/proto_docs/google/cloud/automl/v1beta1/column_spec.rb +77 -0
  57. data/proto_docs/google/cloud/automl/v1beta1/data_items.rb +227 -0
  58. data/proto_docs/google/cloud/automl/v1beta1/data_stats.rb +227 -0
  59. data/proto_docs/google/cloud/automl/v1beta1/data_types.rb +118 -0
  60. data/proto_docs/google/cloud/automl/v1beta1/dataset.rb +84 -0
  61. data/proto_docs/google/cloud/automl/v1beta1/detection.rb +152 -0
  62. data/proto_docs/google/cloud/automl/v1beta1/geometry.rb +53 -0
  63. data/proto_docs/google/cloud/automl/v1beta1/image.rb +205 -0
  64. data/proto_docs/google/cloud/automl/v1beta1/io.rb +1168 -0
  65. data/proto_docs/google/cloud/automl/v1beta1/model.rb +95 -0
  66. data/proto_docs/google/cloud/automl/v1beta1/model_evaluation.rb +103 -0
  67. data/proto_docs/google/cloud/automl/v1beta1/operations.rb +206 -0
  68. data/proto_docs/google/cloud/automl/v1beta1/prediction_service.rb +238 -0
  69. data/proto_docs/google/cloud/automl/v1beta1/ranges.rb +38 -0
  70. data/proto_docs/google/cloud/automl/v1beta1/regression.rb +48 -0
  71. data/proto_docs/google/cloud/automl/v1beta1/service.rb +447 -0
  72. data/proto_docs/google/cloud/automl/v1beta1/table_spec.rb +75 -0
  73. data/proto_docs/google/cloud/automl/v1beta1/tables.rb +300 -0
  74. data/proto_docs/google/cloud/automl/v1beta1/temporal.rb +40 -0
  75. data/proto_docs/google/cloud/automl/v1beta1/text.rb +76 -0
  76. data/proto_docs/google/cloud/automl/v1beta1/text_extraction.rb +73 -0
  77. data/proto_docs/google/cloud/automl/v1beta1/text_segment.rb +44 -0
  78. data/proto_docs/google/cloud/automl/v1beta1/text_sentiment.rb +86 -0
  79. data/proto_docs/google/cloud/automl/v1beta1/translation.rb +79 -0
  80. data/proto_docs/google/cloud/automl/v1beta1/video.rb +51 -0
  81. data/proto_docs/google/longrunning/operations.rb +150 -0
  82. data/proto_docs/google/protobuf/any.rb +138 -0
  83. data/proto_docs/google/protobuf/duration.rb +98 -0
  84. data/proto_docs/google/protobuf/empty.rb +36 -0
  85. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  86. data/proto_docs/google/protobuf/struct.rb +96 -0
  87. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  88. data/proto_docs/google/rpc/status.rb +46 -0
  89. metadata +245 -0
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/automl/v1beta1"
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/automl/v1beta1/prediction_service"
20
+ require "google/cloud/automl/v1beta1/automl"
21
+ require "google/cloud/automl/v1beta1/version"
22
+
23
+ module Google
24
+ module Cloud
25
+ module AutoML
26
+ ##
27
+ # To load this package, including all its services, and instantiate a client:
28
+ #
29
+ # require "google/cloud/automl/v1beta1"
30
+ # client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
31
+ #
32
+ module V1beta1
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,41 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/automl/v1beta1/annotation_payload.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/cloud/automl/v1beta1/classification_pb'
7
+ require 'google/cloud/automl/v1beta1/detection_pb'
8
+ require 'google/cloud/automl/v1beta1/tables_pb'
9
+ require 'google/cloud/automl/v1beta1/text_extraction_pb'
10
+ require 'google/cloud/automl/v1beta1/text_sentiment_pb'
11
+ require 'google/cloud/automl/v1beta1/translation_pb'
12
+ require 'google/protobuf/any_pb'
13
+ require 'google/api/annotations_pb'
14
+ Google::Protobuf::DescriptorPool.generated_pool.build do
15
+ add_file("google/cloud/automl/v1beta1/annotation_payload.proto", :syntax => :proto3) do
16
+ add_message "google.cloud.automl.v1beta1.AnnotationPayload" do
17
+ optional :annotation_spec_id, :string, 1
18
+ optional :display_name, :string, 5
19
+ oneof :detail do
20
+ optional :translation, :message, 2, "google.cloud.automl.v1beta1.TranslationAnnotation"
21
+ optional :classification, :message, 3, "google.cloud.automl.v1beta1.ClassificationAnnotation"
22
+ optional :image_object_detection, :message, 4, "google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation"
23
+ optional :video_classification, :message, 9, "google.cloud.automl.v1beta1.VideoClassificationAnnotation"
24
+ optional :video_object_tracking, :message, 8, "google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation"
25
+ optional :text_extraction, :message, 6, "google.cloud.automl.v1beta1.TextExtractionAnnotation"
26
+ optional :text_sentiment, :message, 7, "google.cloud.automl.v1beta1.TextSentimentAnnotation"
27
+ optional :tables, :message, 10, "google.cloud.automl.v1beta1.TablesAnnotation"
28
+ end
29
+ end
30
+ end
31
+ end
32
+
33
+ module Google
34
+ module Cloud
35
+ module AutoML
36
+ module V1beta1
37
+ AnnotationPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.AnnotationPayload").msgclass
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,26 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/automl/v1beta1/annotation_spec.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/resource_pb'
7
+ require 'google/api/annotations_pb'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("google/cloud/automl/v1beta1/annotation_spec.proto", :syntax => :proto3) do
10
+ add_message "google.cloud.automl.v1beta1.AnnotationSpec" do
11
+ optional :name, :string, 1
12
+ optional :display_name, :string, 2
13
+ optional :example_count, :int32, 9
14
+ end
15
+ end
16
+ end
17
+
18
+ module Google
19
+ module Cloud
20
+ module AutoML
21
+ module V1beta1
22
+ AnnotationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.AnnotationSpec").msgclass
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/automl/v1beta1/version"
24
+
25
+ require "google/cloud/automl/v1beta1/automl/credentials"
26
+ require "google/cloud/automl/v1beta1/automl/paths"
27
+ require "google/cloud/automl/v1beta1/automl/operations"
28
+ require "google/cloud/automl/v1beta1/automl/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module AutoML
33
+ module V1beta1
34
+ ##
35
+ # AutoML Server API.
36
+ #
37
+ # The resource names are assigned by the server.
38
+ # The server never reuses names that it has created after the resources with
39
+ # those names are deleted.
40
+ #
41
+ # An ID of a resource is the last element of the item's resource name. For
42
+ # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
43
+ # the id for the item is `{dataset_id}`.
44
+ #
45
+ # Currently the only supported `location_id` is "us-central1".
46
+ #
47
+ # On any input that is documented to expect a string parameter in
48
+ # snake_case or kebab-case, either of those cases is accepted.
49
+ #
50
+ # To load this service and instantiate a client:
51
+ #
52
+ # require "google/cloud/automl/v1beta1/automl"
53
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
54
+ #
55
+ module AutoML
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+ helper_path = ::File.join __dir__, "automl", "helpers.rb"
63
+ require "google/cloud/automl/v1beta1/automl/helpers" if ::File.file? helper_path
@@ -0,0 +1,2368 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/automl/v1beta1/service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module AutoML
25
+ module V1beta1
26
+ module AutoML
27
+ ##
28
+ # Client for the AutoMl service.
29
+ #
30
+ # AutoML Server API.
31
+ #
32
+ # The resource names are assigned by the server.
33
+ # The server never reuses names that it has created after the resources with
34
+ # those names are deleted.
35
+ #
36
+ # An ID of a resource is the last element of the item's resource name. For
37
+ # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
38
+ # the id for the item is `{dataset_id}`.
39
+ #
40
+ # Currently the only supported `location_id` is "us-central1".
41
+ #
42
+ # On any input that is documented to expect a string parameter in
43
+ # snake_case or kebab-case, either of those cases is accepted.
44
+ #
45
+ class Client
46
+ include Paths
47
+
48
+ # @private
49
+ attr_reader :auto_ml_stub
50
+
51
+ ##
52
+ # Configure the AutoMl Client class.
53
+ #
54
+ # See {Google::Cloud::AutoML::V1beta1::AutoML::Client::Configuration}
55
+ # for a description of the configuration fields.
56
+ #
57
+ # ## Example
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_000
63
+ # end
64
+ #
65
+ # @yield [config] Configure the Client client.
66
+ # @yieldparam config [Client::Configuration]
67
+ #
68
+ # @return [Client::Configuration]
69
+ #
70
+ def self.configure
71
+ @configure ||= begin
72
+ namespace = ["Google", "Cloud", "AutoML", "V1beta1"]
73
+ parent_config = while namespace.any?
74
+ parent_name = namespace.join "::"
75
+ parent_const = const_get parent_name
76
+ break parent_const.configure if parent_const&.respond_to? :configure
77
+ namespace.pop
78
+ end
79
+ default_config = Client::Configuration.new parent_config
80
+
81
+ default_config.rpcs.create_dataset.timeout = 5.0
82
+
83
+ default_config.rpcs.get_dataset.timeout = 5.0
84
+ default_config.rpcs.get_dataset.retry_policy = {
85
+ initial_delay: 0.1,
86
+ max_delay: 60.0,
87
+ multiplier: 1.3,
88
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
89
+ }
90
+
91
+ default_config.rpcs.list_datasets.timeout = 5.0
92
+ default_config.rpcs.list_datasets.retry_policy = {
93
+ initial_delay: 0.1,
94
+ max_delay: 60.0,
95
+ multiplier: 1.3,
96
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
97
+ }
98
+
99
+ default_config.rpcs.update_dataset.timeout = 5.0
100
+
101
+ default_config.rpcs.delete_dataset.timeout = 5.0
102
+ default_config.rpcs.delete_dataset.retry_policy = {
103
+ initial_delay: 0.1,
104
+ max_delay: 60.0,
105
+ multiplier: 1.3,
106
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
107
+ }
108
+
109
+ default_config.rpcs.import_data.timeout = 5.0
110
+
111
+ default_config.rpcs.export_data.timeout = 5.0
112
+
113
+ default_config.rpcs.get_annotation_spec.timeout = 5.0
114
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
119
+ }
120
+
121
+ default_config.rpcs.get_table_spec.timeout = 5.0
122
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
127
+ }
128
+
129
+ default_config.rpcs.list_table_specs.timeout = 5.0
130
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
135
+ }
136
+
137
+ default_config.rpcs.update_table_spec.timeout = 5.0
138
+
139
+ default_config.rpcs.get_column_spec.timeout = 5.0
140
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
145
+ }
146
+
147
+ default_config.rpcs.list_column_specs.timeout = 5.0
148
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
153
+ }
154
+
155
+ default_config.rpcs.update_column_spec.timeout = 5.0
156
+
157
+ default_config.rpcs.create_model.timeout = 5.0
158
+
159
+ default_config.rpcs.get_model.timeout = 5.0
160
+ default_config.rpcs.get_model.retry_policy = {
161
+ initial_delay: 0.1,
162
+ max_delay: 60.0,
163
+ multiplier: 1.3,
164
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
165
+ }
166
+
167
+ default_config.rpcs.list_models.timeout = 5.0
168
+ default_config.rpcs.list_models.retry_policy = {
169
+ initial_delay: 0.1,
170
+ max_delay: 60.0,
171
+ multiplier: 1.3,
172
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
173
+ }
174
+
175
+ default_config.rpcs.delete_model.timeout = 5.0
176
+ default_config.rpcs.delete_model.retry_policy = {
177
+ initial_delay: 0.1,
178
+ max_delay: 60.0,
179
+ multiplier: 1.3,
180
+ retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
181
+ }
182
+
183
+ default_config.rpcs.deploy_model.timeout = 5.0
184
+
185
+ default_config.rpcs.undeploy_model.timeout = 5.0
186
+
187
+ default_config.rpcs.export_model.timeout = 5.0
188
+
189
+ default_config.rpcs.export_evaluated_examples.timeout = 5.0
190
+
191
+ default_config.rpcs.get_model_evaluation.timeout = 5.0
192
+ 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: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
197
+ }
198
+
199
+ default_config.rpcs.list_model_evaluations.timeout = 5.0
200
+
201
+ default_config
202
+ end
203
+ yield @configure if block_given?
204
+ @configure
205
+ end
206
+
207
+ ##
208
+ # Configure the AutoMl Client instance.
209
+ #
210
+ # The configuration is set to the derived mode, meaning that values can be changed,
211
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
212
+ # should be made on {Client.configure}.
213
+ #
214
+ # See {Google::Cloud::AutoML::V1beta1::AutoML::Client::Configuration}
215
+ # for a description of the configuration fields.
216
+ #
217
+ # @yield [config] Configure the Client client.
218
+ # @yieldparam config [Client::Configuration]
219
+ #
220
+ # @return [Client::Configuration]
221
+ #
222
+ def configure
223
+ yield @config if block_given?
224
+ @config
225
+ end
226
+
227
+ ##
228
+ # Create a new AutoMl client object.
229
+ #
230
+ # ## Examples
231
+ #
232
+ # To create a new AutoMl client with the default
233
+ # configuration:
234
+ #
235
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new
236
+ #
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_000
242
+ # end
243
+ #
244
+ # @yield [config] Configure the AutoMl client.
245
+ # @yieldparam config [Client::Configuration]
246
+ #
247
+ def initialize
248
+ # These require statements are intentionally placed here to initialize
249
+ # the gRPC module only when it's required.
250
+ # See https://github.com/googleapis/toolkit/issues/446
251
+ require "gapic/grpc"
252
+ require "google/cloud/automl/v1beta1/service_services_pb"
253
+
254
+ # Create the configuration object
255
+ @config = Configuration.new Client.configure
256
+
257
+ # Yield the configuration if needed
258
+ yield @config if block_given?
259
+
260
+ # Create credentials
261
+ credentials = @config.credentials
262
+ credentials ||= Credentials.default scope: @config.scope
263
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
264
+ credentials = Credentials.new credentials, scope: @config.scope
265
+ end
266
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
267
+
268
+ @operations_client = Operations.new do |config|
269
+ config.credentials = credentials
270
+ config.endpoint = @config.endpoint
271
+ end
272
+
273
+ @auto_ml_stub = Gapic::ServiceStub.new(
274
+ Google::Cloud::AutoML::V1beta1::AutoMl::Stub,
275
+ credentials: credentials,
276
+ endpoint: @config.endpoint,
277
+ channel_args: @config.channel_args,
278
+ interceptors: @config.interceptors
279
+ )
280
+ end
281
+
282
+ ##
283
+ # Get the associated client for long-running operations.
284
+ #
285
+ # @return [Google::Cloud::AutoML::V1beta1::AutoML::Operations]
286
+ #
287
+ attr_reader :operations_client
288
+
289
+ # Service calls
290
+
291
+ ##
292
+ # Creates a dataset.
293
+ #
294
+ # @overload create_dataset(request, options = nil)
295
+ # Pass arguments to `create_dataset` via a request object, either of type
296
+ # {Google::Cloud::AutoML::V1beta1::CreateDatasetRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [Google::Cloud::AutoML::V1beta1::CreateDatasetRequest, Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [Gapic::CallOptions, Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
303
+ #
304
+ # @overload create_dataset(parent: nil, dataset: nil)
305
+ # Pass arguments to `create_dataset` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param parent [String]
310
+ # Required. The resource name of the project to create the dataset for.
311
+ # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset, Hash]
312
+ # Required. The dataset to create.
313
+ #
314
+ # @yield [response, operation] Access the result along with the RPC operation
315
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::Dataset]
316
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
317
+ #
318
+ # @return [Google::Cloud::AutoML::V1beta1::Dataset]
319
+ #
320
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
321
+ #
322
+ def create_dataset request, options = nil
323
+ raise ArgumentError, "request must be provided" if request.nil?
324
+
325
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::CreateDatasetRequest
326
+
327
+ # Converts hash and nil to an options object
328
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
329
+
330
+ # Customize the options with defaults
331
+ metadata = @config.rpcs.create_dataset.metadata.to_h
332
+
333
+ # Set x-goog-api-client and x-goog-user-project headers
334
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
335
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
336
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
337
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
338
+
339
+ header_params = {
340
+ "parent" => request.parent
341
+ }
342
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
343
+ metadata[:"x-goog-request-params"] ||= request_params_header
344
+
345
+ options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
346
+ metadata: metadata,
347
+ retry_policy: @config.rpcs.create_dataset.retry_policy
348
+ options.apply_defaults metadata: @config.metadata,
349
+ retry_policy: @config.retry_policy
350
+
351
+ @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
352
+ yield response, operation if block_given?
353
+ return response
354
+ end
355
+ rescue GRPC::BadStatus => e
356
+ raise Google::Cloud::Error.from_error(e)
357
+ end
358
+
359
+ ##
360
+ # Gets a dataset.
361
+ #
362
+ # @overload get_dataset(request, options = nil)
363
+ # Pass arguments to `get_dataset` via a request object, either of type
364
+ # {Google::Cloud::AutoML::V1beta1::GetDatasetRequest} or an equivalent Hash.
365
+ #
366
+ # @param request [Google::Cloud::AutoML::V1beta1::GetDatasetRequest, Hash]
367
+ # A request object representing the call parameters. Required. To specify no
368
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
369
+ # @param options [Gapic::CallOptions, Hash]
370
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
371
+ #
372
+ # @overload get_dataset(name: nil)
373
+ # Pass arguments to `get_dataset` via keyword arguments. Note that at
374
+ # least one keyword argument is required. To specify no parameters, or to keep all
375
+ # the default parameter values, pass an empty Hash as a request object (see above).
376
+ #
377
+ # @param name [String]
378
+ # Required. The resource name of the dataset to retrieve.
379
+ #
380
+ # @yield [response, operation] Access the result along with the RPC operation
381
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::Dataset]
382
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
383
+ #
384
+ # @return [Google::Cloud::AutoML::V1beta1::Dataset]
385
+ #
386
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
387
+ #
388
+ def get_dataset request, options = nil
389
+ raise ArgumentError, "request must be provided" if request.nil?
390
+
391
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetDatasetRequest
392
+
393
+ # Converts hash and nil to an options object
394
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
+
396
+ # Customize the options with defaults
397
+ metadata = @config.rpcs.get_dataset.metadata.to_h
398
+
399
+ # Set x-goog-api-client and x-goog-user-project headers
400
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
402
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
403
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
404
+
405
+ header_params = {
406
+ "name" => request.name
407
+ }
408
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
409
+ metadata[:"x-goog-request-params"] ||= request_params_header
410
+
411
+ options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
412
+ metadata: metadata,
413
+ retry_policy: @config.rpcs.get_dataset.retry_policy
414
+ options.apply_defaults metadata: @config.metadata,
415
+ retry_policy: @config.retry_policy
416
+
417
+ @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
418
+ yield response, operation if block_given?
419
+ return response
420
+ end
421
+ rescue GRPC::BadStatus => e
422
+ raise Google::Cloud::Error.from_error(e)
423
+ end
424
+
425
+ ##
426
+ # Lists datasets in a project.
427
+ #
428
+ # @overload list_datasets(request, options = nil)
429
+ # Pass arguments to `list_datasets` via a request object, either of type
430
+ # {Google::Cloud::AutoML::V1beta1::ListDatasetsRequest} or an equivalent Hash.
431
+ #
432
+ # @param request [Google::Cloud::AutoML::V1beta1::ListDatasetsRequest, Hash]
433
+ # A request object representing the call parameters. Required. To specify no
434
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
435
+ # @param options [Gapic::CallOptions, Hash]
436
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
437
+ #
438
+ # @overload list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil)
439
+ # Pass arguments to `list_datasets` via keyword arguments. Note that at
440
+ # least one keyword argument is required. To specify no parameters, or to keep all
441
+ # the default parameter values, pass an empty Hash as a request object (see above).
442
+ #
443
+ # @param parent [String]
444
+ # Required. The resource name of the project from which to list datasets.
445
+ # @param filter [String]
446
+ # An expression for filtering the results of the request.
447
+ #
448
+ # * `dataset_metadata` - for existence of the case (e.g.
449
+ # image_classification_dataset_metadata:*). Some examples of using the filter are:
450
+ #
451
+ # * `translation_dataset_metadata:*` --> The dataset has
452
+ # translation_dataset_metadata.
453
+ # @param page_size [Integer]
454
+ # Requested page size. Server may return fewer results than requested.
455
+ # If unspecified, server will pick a default size.
456
+ # @param page_token [String]
457
+ # A token identifying a page of results for the server to return
458
+ # Typically obtained via
459
+ # {Google::Cloud::AutoML::V1beta1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous
460
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client#list_datasets AutoMl.ListDatasets} call.
461
+ #
462
+ # @yield [response, operation] Access the result along with the RPC operation
463
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
464
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
465
+ #
466
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
467
+ #
468
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
469
+ #
470
+ def list_datasets request, options = nil
471
+ raise ArgumentError, "request must be provided" if request.nil?
472
+
473
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ListDatasetsRequest
474
+
475
+ # Converts hash and nil to an options object
476
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
477
+
478
+ # Customize the options with defaults
479
+ metadata = @config.rpcs.list_datasets.metadata.to_h
480
+
481
+ # Set x-goog-api-client and x-goog-user-project headers
482
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
483
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
484
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
485
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
486
+
487
+ header_params = {
488
+ "parent" => request.parent
489
+ }
490
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
491
+ metadata[:"x-goog-request-params"] ||= request_params_header
492
+
493
+ options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
494
+ metadata: metadata,
495
+ retry_policy: @config.rpcs.list_datasets.retry_policy
496
+ options.apply_defaults metadata: @config.metadata,
497
+ retry_policy: @config.retry_policy
498
+
499
+ @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
500
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
501
+ yield response, operation if block_given?
502
+ return response
503
+ end
504
+ rescue GRPC::BadStatus => e
505
+ raise Google::Cloud::Error.from_error(e)
506
+ end
507
+
508
+ ##
509
+ # Updates a dataset.
510
+ #
511
+ # @overload update_dataset(request, options = nil)
512
+ # Pass arguments to `update_dataset` via a request object, either of type
513
+ # {Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest} or an equivalent Hash.
514
+ #
515
+ # @param request [Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest, Hash]
516
+ # A request object representing the call parameters. Required. To specify no
517
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
518
+ # @param options [Gapic::CallOptions, Hash]
519
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
520
+ #
521
+ # @overload update_dataset(dataset: nil, update_mask: nil)
522
+ # Pass arguments to `update_dataset` via keyword arguments. Note that at
523
+ # least one keyword argument is required. To specify no parameters, or to keep all
524
+ # the default parameter values, pass an empty Hash as a request object (see above).
525
+ #
526
+ # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset, Hash]
527
+ # Required. The dataset which replaces the resource on the server.
528
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
529
+ # The update mask applies to the resource.
530
+ #
531
+ # @yield [response, operation] Access the result along with the RPC operation
532
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::Dataset]
533
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
534
+ #
535
+ # @return [Google::Cloud::AutoML::V1beta1::Dataset]
536
+ #
537
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
538
+ #
539
+ def update_dataset request, options = nil
540
+ raise ArgumentError, "request must be provided" if request.nil?
541
+
542
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest
543
+
544
+ # Converts hash and nil to an options object
545
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
546
+
547
+ # Customize the options with defaults
548
+ metadata = @config.rpcs.update_dataset.metadata.to_h
549
+
550
+ # Set x-goog-api-client and x-goog-user-project headers
551
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
552
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
553
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
554
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
555
+
556
+ header_params = {
557
+ "dataset.name" => request.dataset.name
558
+ }
559
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
560
+ metadata[:"x-goog-request-params"] ||= request_params_header
561
+
562
+ options.apply_defaults timeout: @config.rpcs.update_dataset.timeout,
563
+ metadata: metadata,
564
+ retry_policy: @config.rpcs.update_dataset.retry_policy
565
+ options.apply_defaults metadata: @config.metadata,
566
+ retry_policy: @config.retry_policy
567
+
568
+ @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
569
+ yield response, operation if block_given?
570
+ return response
571
+ end
572
+ rescue GRPC::BadStatus => e
573
+ raise Google::Cloud::Error.from_error(e)
574
+ end
575
+
576
+ ##
577
+ # Deletes a dataset and all of its contents.
578
+ # Returns empty response in the
579
+ # {Google::Longrunning::Operation#response response} field when it completes,
580
+ # and `delete_details` in the
581
+ # {Google::Longrunning::Operation#metadata metadata} field.
582
+ #
583
+ # @overload delete_dataset(request, options = nil)
584
+ # Pass arguments to `delete_dataset` via a request object, either of type
585
+ # {Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest} or an equivalent Hash.
586
+ #
587
+ # @param request [Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest, Hash]
588
+ # A request object representing the call parameters. Required. To specify no
589
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
590
+ # @param options [Gapic::CallOptions, Hash]
591
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
592
+ #
593
+ # @overload delete_dataset(name: nil)
594
+ # Pass arguments to `delete_dataset` via keyword arguments. Note that at
595
+ # least one keyword argument is required. To specify no parameters, or to keep all
596
+ # the default parameter values, pass an empty Hash as a request object (see above).
597
+ #
598
+ # @param name [String]
599
+ # Required. The resource name of the dataset to delete.
600
+ #
601
+ # @yield [response, operation] Access the result along with the RPC operation
602
+ # @yieldparam response [Gapic::Operation]
603
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
604
+ #
605
+ # @return [Gapic::Operation]
606
+ #
607
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
608
+ #
609
+ def delete_dataset request, options = nil
610
+ raise ArgumentError, "request must be provided" if request.nil?
611
+
612
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest
613
+
614
+ # Converts hash and nil to an options object
615
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
616
+
617
+ # Customize the options with defaults
618
+ metadata = @config.rpcs.delete_dataset.metadata.to_h
619
+
620
+ # Set x-goog-api-client and x-goog-user-project headers
621
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
622
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
623
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
624
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
625
+
626
+ header_params = {
627
+ "name" => request.name
628
+ }
629
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
630
+ metadata[:"x-goog-request-params"] ||= request_params_header
631
+
632
+ options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
633
+ metadata: metadata,
634
+ retry_policy: @config.rpcs.delete_dataset.retry_policy
635
+ options.apply_defaults metadata: @config.metadata,
636
+ retry_policy: @config.retry_policy
637
+
638
+ @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
639
+ response = Gapic::Operation.new response, @operations_client, options: options
640
+ yield response, operation if block_given?
641
+ return response
642
+ end
643
+ rescue GRPC::BadStatus => e
644
+ raise Google::Cloud::Error.from_error(e)
645
+ end
646
+
647
+ ##
648
+ # Imports data into a dataset.
649
+ # For Tables this method can only be called on an empty Dataset.
650
+ #
651
+ # For Tables:
652
+ # * A
653
+ # {Google::Cloud::AutoML::V1beta1::InputConfig#params schema_inference_version}
654
+ # parameter must be explicitly set.
655
+ # Returns an empty response in the
656
+ # {Google::Longrunning::Operation#response response} field when it completes.
657
+ #
658
+ # @overload import_data(request, options = nil)
659
+ # Pass arguments to `import_data` via a request object, either of type
660
+ # {Google::Cloud::AutoML::V1beta1::ImportDataRequest} or an equivalent Hash.
661
+ #
662
+ # @param request [Google::Cloud::AutoML::V1beta1::ImportDataRequest, Hash]
663
+ # A request object representing the call parameters. Required. To specify no
664
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
665
+ # @param options [Gapic::CallOptions, Hash]
666
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
667
+ #
668
+ # @overload import_data(name: nil, input_config: nil)
669
+ # Pass arguments to `import_data` via keyword arguments. Note that at
670
+ # least one keyword argument is required. To specify no parameters, or to keep all
671
+ # the default parameter values, pass an empty Hash as a request object (see above).
672
+ #
673
+ # @param name [String]
674
+ # Required. Dataset name. Dataset must already exist. All imported
675
+ # annotations and examples will be added.
676
+ # @param input_config [Google::Cloud::AutoML::V1beta1::InputConfig, Hash]
677
+ # Required. The desired input location and its domain specific semantics,
678
+ # if any.
679
+ #
680
+ # @yield [response, operation] Access the result along with the RPC operation
681
+ # @yieldparam response [Gapic::Operation]
682
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
683
+ #
684
+ # @return [Gapic::Operation]
685
+ #
686
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
687
+ #
688
+ def import_data request, options = nil
689
+ raise ArgumentError, "request must be provided" if request.nil?
690
+
691
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ImportDataRequest
692
+
693
+ # Converts hash and nil to an options object
694
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
695
+
696
+ # Customize the options with defaults
697
+ metadata = @config.rpcs.import_data.metadata.to_h
698
+
699
+ # Set x-goog-api-client and x-goog-user-project headers
700
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
701
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
702
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
703
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
704
+
705
+ header_params = {
706
+ "name" => request.name
707
+ }
708
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
709
+ metadata[:"x-goog-request-params"] ||= request_params_header
710
+
711
+ options.apply_defaults timeout: @config.rpcs.import_data.timeout,
712
+ metadata: metadata,
713
+ retry_policy: @config.rpcs.import_data.retry_policy
714
+ options.apply_defaults metadata: @config.metadata,
715
+ retry_policy: @config.retry_policy
716
+
717
+ @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
718
+ response = Gapic::Operation.new response, @operations_client, options: options
719
+ yield response, operation if block_given?
720
+ return response
721
+ end
722
+ rescue GRPC::BadStatus => e
723
+ raise Google::Cloud::Error.from_error(e)
724
+ end
725
+
726
+ ##
727
+ # Exports dataset's data to the provided output location.
728
+ # Returns an empty response in the
729
+ # {Google::Longrunning::Operation#response response} field when it completes.
730
+ #
731
+ # @overload export_data(request, options = nil)
732
+ # Pass arguments to `export_data` via a request object, either of type
733
+ # {Google::Cloud::AutoML::V1beta1::ExportDataRequest} or an equivalent Hash.
734
+ #
735
+ # @param request [Google::Cloud::AutoML::V1beta1::ExportDataRequest, Hash]
736
+ # A request object representing the call parameters. Required. To specify no
737
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
738
+ # @param options [Gapic::CallOptions, Hash]
739
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
740
+ #
741
+ # @overload export_data(name: nil, output_config: nil)
742
+ # Pass arguments to `export_data` via keyword arguments. Note that at
743
+ # least one keyword argument is required. To specify no parameters, or to keep all
744
+ # the default parameter values, pass an empty Hash as a request object (see above).
745
+ #
746
+ # @param name [String]
747
+ # Required. The resource name of the dataset.
748
+ # @param output_config [Google::Cloud::AutoML::V1beta1::OutputConfig, Hash]
749
+ # Required. The desired output location.
750
+ #
751
+ # @yield [response, operation] Access the result along with the RPC operation
752
+ # @yieldparam response [Gapic::Operation]
753
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
754
+ #
755
+ # @return [Gapic::Operation]
756
+ #
757
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
758
+ #
759
+ def export_data request, options = nil
760
+ raise ArgumentError, "request must be provided" if request.nil?
761
+
762
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ExportDataRequest
763
+
764
+ # Converts hash and nil to an options object
765
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
766
+
767
+ # Customize the options with defaults
768
+ metadata = @config.rpcs.export_data.metadata.to_h
769
+
770
+ # Set x-goog-api-client and x-goog-user-project headers
771
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
772
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
773
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
774
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
775
+
776
+ header_params = {
777
+ "name" => request.name
778
+ }
779
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
780
+ metadata[:"x-goog-request-params"] ||= request_params_header
781
+
782
+ options.apply_defaults timeout: @config.rpcs.export_data.timeout,
783
+ metadata: metadata,
784
+ retry_policy: @config.rpcs.export_data.retry_policy
785
+ options.apply_defaults metadata: @config.metadata,
786
+ retry_policy: @config.retry_policy
787
+
788
+ @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
789
+ response = Gapic::Operation.new response, @operations_client, options: options
790
+ yield response, operation if block_given?
791
+ return response
792
+ end
793
+ rescue GRPC::BadStatus => e
794
+ raise Google::Cloud::Error.from_error(e)
795
+ end
796
+
797
+ ##
798
+ # Gets an annotation spec.
799
+ #
800
+ # @overload get_annotation_spec(request, options = nil)
801
+ # Pass arguments to `get_annotation_spec` via a request object, either of type
802
+ # {Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest} or an equivalent Hash.
803
+ #
804
+ # @param request [Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest, Hash]
805
+ # A request object representing the call parameters. Required. To specify no
806
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
807
+ # @param options [Gapic::CallOptions, Hash]
808
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
809
+ #
810
+ # @overload get_annotation_spec(name: nil)
811
+ # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at
812
+ # least one keyword argument is required. To specify no parameters, or to keep all
813
+ # the default parameter values, pass an empty Hash as a request object (see above).
814
+ #
815
+ # @param name [String]
816
+ # Required. The resource name of the annotation spec to retrieve.
817
+ #
818
+ # @yield [response, operation] Access the result along with the RPC operation
819
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
820
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
821
+ #
822
+ # @return [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
823
+ #
824
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
825
+ #
826
+ def get_annotation_spec request, options = nil
827
+ raise ArgumentError, "request must be provided" if request.nil?
828
+
829
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest
830
+
831
+ # Converts hash and nil to an options object
832
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
833
+
834
+ # Customize the options with defaults
835
+ metadata = @config.rpcs.get_annotation_spec.metadata.to_h
836
+
837
+ # Set x-goog-api-client and x-goog-user-project headers
838
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
839
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
840
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
841
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
842
+
843
+ header_params = {
844
+ "name" => request.name
845
+ }
846
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
847
+ metadata[:"x-goog-request-params"] ||= request_params_header
848
+
849
+ options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout,
850
+ metadata: metadata,
851
+ retry_policy: @config.rpcs.get_annotation_spec.retry_policy
852
+ options.apply_defaults metadata: @config.metadata,
853
+ retry_policy: @config.retry_policy
854
+
855
+ @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
856
+ yield response, operation if block_given?
857
+ return response
858
+ end
859
+ rescue GRPC::BadStatus => e
860
+ raise Google::Cloud::Error.from_error(e)
861
+ end
862
+
863
+ ##
864
+ # Gets a table spec.
865
+ #
866
+ # @overload get_table_spec(request, options = nil)
867
+ # Pass arguments to `get_table_spec` via a request object, either of type
868
+ # {Google::Cloud::AutoML::V1beta1::GetTableSpecRequest} or an equivalent Hash.
869
+ #
870
+ # @param request [Google::Cloud::AutoML::V1beta1::GetTableSpecRequest, Hash]
871
+ # A request object representing the call parameters. Required. To specify no
872
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
873
+ # @param options [Gapic::CallOptions, Hash]
874
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
875
+ #
876
+ # @overload get_table_spec(name: nil, field_mask: nil)
877
+ # Pass arguments to `get_table_spec` via keyword arguments. Note that at
878
+ # least one keyword argument is required. To specify no parameters, or to keep all
879
+ # the default parameter values, pass an empty Hash as a request object (see above).
880
+ #
881
+ # @param name [String]
882
+ # Required. The resource name of the table spec to retrieve.
883
+ # @param field_mask [Google::Protobuf::FieldMask, Hash]
884
+ # Mask specifying which fields to read.
885
+ #
886
+ # @yield [response, operation] Access the result along with the RPC operation
887
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::TableSpec]
888
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
889
+ #
890
+ # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
891
+ #
892
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
893
+ #
894
+ def get_table_spec request, options = nil
895
+ raise ArgumentError, "request must be provided" if request.nil?
896
+
897
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetTableSpecRequest
898
+
899
+ # Converts hash and nil to an options object
900
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
901
+
902
+ # Customize the options with defaults
903
+ metadata = @config.rpcs.get_table_spec.metadata.to_h
904
+
905
+ # Set x-goog-api-client and x-goog-user-project headers
906
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
907
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
908
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
909
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
910
+
911
+ header_params = {
912
+ "name" => request.name
913
+ }
914
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
915
+ metadata[:"x-goog-request-params"] ||= request_params_header
916
+
917
+ options.apply_defaults timeout: @config.rpcs.get_table_spec.timeout,
918
+ metadata: metadata,
919
+ retry_policy: @config.rpcs.get_table_spec.retry_policy
920
+ options.apply_defaults metadata: @config.metadata,
921
+ retry_policy: @config.retry_policy
922
+
923
+ @auto_ml_stub.call_rpc :get_table_spec, request, options: options do |response, operation|
924
+ yield response, operation if block_given?
925
+ return response
926
+ end
927
+ rescue GRPC::BadStatus => e
928
+ raise Google::Cloud::Error.from_error(e)
929
+ end
930
+
931
+ ##
932
+ # Lists table specs in a dataset.
933
+ #
934
+ # @overload list_table_specs(request, options = nil)
935
+ # Pass arguments to `list_table_specs` via a request object, either of type
936
+ # {Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest} or an equivalent Hash.
937
+ #
938
+ # @param request [Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest, Hash]
939
+ # A request object representing the call parameters. Required. To specify no
940
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
941
+ # @param options [Gapic::CallOptions, Hash]
942
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
943
+ #
944
+ # @overload list_table_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil)
945
+ # Pass arguments to `list_table_specs` via keyword arguments. Note that at
946
+ # least one keyword argument is required. To specify no parameters, or to keep all
947
+ # the default parameter values, pass an empty Hash as a request object (see above).
948
+ #
949
+ # @param parent [String]
950
+ # Required. The resource name of the dataset to list table specs from.
951
+ # @param field_mask [Google::Protobuf::FieldMask, Hash]
952
+ # Mask specifying which fields to read.
953
+ # @param filter [String]
954
+ # Filter expression, see go/filtering.
955
+ # @param page_size [Integer]
956
+ # Requested page size. The server can return fewer results than requested.
957
+ # If unspecified, the server will pick a default size.
958
+ # @param page_token [String]
959
+ # A token identifying a page of results for the server to return.
960
+ # Typically obtained from the
961
+ # {Google::Cloud::AutoML::V1beta1::ListTableSpecsResponse#next_page_token ListTableSpecsResponse.next_page_token} field of the previous
962
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client#list_table_specs AutoMl.ListTableSpecs} call.
963
+ #
964
+ # @yield [response, operation] Access the result along with the RPC operation
965
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
966
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
967
+ #
968
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
969
+ #
970
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
971
+ #
972
+ def list_table_specs request, options = nil
973
+ raise ArgumentError, "request must be provided" if request.nil?
974
+
975
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest
976
+
977
+ # Converts hash and nil to an options object
978
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
979
+
980
+ # Customize the options with defaults
981
+ metadata = @config.rpcs.list_table_specs.metadata.to_h
982
+
983
+ # Set x-goog-api-client and x-goog-user-project headers
984
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
985
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
986
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
987
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
988
+
989
+ header_params = {
990
+ "parent" => request.parent
991
+ }
992
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
993
+ metadata[:"x-goog-request-params"] ||= request_params_header
994
+
995
+ options.apply_defaults timeout: @config.rpcs.list_table_specs.timeout,
996
+ metadata: metadata,
997
+ retry_policy: @config.rpcs.list_table_specs.retry_policy
998
+ options.apply_defaults metadata: @config.metadata,
999
+ retry_policy: @config.retry_policy
1000
+
1001
+ @auto_ml_stub.call_rpc :list_table_specs, request, options: options do |response, operation|
1002
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_table_specs, request, response, operation, options
1003
+ yield response, operation if block_given?
1004
+ return response
1005
+ end
1006
+ rescue GRPC::BadStatus => e
1007
+ raise Google::Cloud::Error.from_error(e)
1008
+ end
1009
+
1010
+ ##
1011
+ # Updates a table spec.
1012
+ #
1013
+ # @overload update_table_spec(request, options = nil)
1014
+ # Pass arguments to `update_table_spec` via a request object, either of type
1015
+ # {Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest} or an equivalent Hash.
1016
+ #
1017
+ # @param request [Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest, Hash]
1018
+ # A request object representing the call parameters. Required. To specify no
1019
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1020
+ # @param options [Gapic::CallOptions, Hash]
1021
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1022
+ #
1023
+ # @overload update_table_spec(table_spec: nil, update_mask: nil)
1024
+ # Pass arguments to `update_table_spec` via keyword arguments. Note that at
1025
+ # least one keyword argument is required. To specify no parameters, or to keep all
1026
+ # the default parameter values, pass an empty Hash as a request object (see above).
1027
+ #
1028
+ # @param table_spec [Google::Cloud::AutoML::V1beta1::TableSpec, Hash]
1029
+ # Required. The table spec which replaces the resource on the server.
1030
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
1031
+ # The update mask applies to the resource.
1032
+ #
1033
+ # @yield [response, operation] Access the result along with the RPC operation
1034
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::TableSpec]
1035
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1036
+ #
1037
+ # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
1038
+ #
1039
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1040
+ #
1041
+ def update_table_spec request, options = nil
1042
+ raise ArgumentError, "request must be provided" if request.nil?
1043
+
1044
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest
1045
+
1046
+ # Converts hash and nil to an options object
1047
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1048
+
1049
+ # Customize the options with defaults
1050
+ metadata = @config.rpcs.update_table_spec.metadata.to_h
1051
+
1052
+ # Set x-goog-api-client and x-goog-user-project headers
1053
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1054
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1055
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1056
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1057
+
1058
+ header_params = {
1059
+ "table_spec.name" => request.table_spec.name
1060
+ }
1061
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1062
+ metadata[:"x-goog-request-params"] ||= request_params_header
1063
+
1064
+ options.apply_defaults timeout: @config.rpcs.update_table_spec.timeout,
1065
+ metadata: metadata,
1066
+ retry_policy: @config.rpcs.update_table_spec.retry_policy
1067
+ options.apply_defaults metadata: @config.metadata,
1068
+ retry_policy: @config.retry_policy
1069
+
1070
+ @auto_ml_stub.call_rpc :update_table_spec, request, options: options do |response, operation|
1071
+ yield response, operation if block_given?
1072
+ return response
1073
+ end
1074
+ rescue GRPC::BadStatus => e
1075
+ raise Google::Cloud::Error.from_error(e)
1076
+ end
1077
+
1078
+ ##
1079
+ # Gets a column spec.
1080
+ #
1081
+ # @overload get_column_spec(request, options = nil)
1082
+ # Pass arguments to `get_column_spec` via a request object, either of type
1083
+ # {Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest} or an equivalent Hash.
1084
+ #
1085
+ # @param request [Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest, Hash]
1086
+ # A request object representing the call parameters. Required. To specify no
1087
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1088
+ # @param options [Gapic::CallOptions, Hash]
1089
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1090
+ #
1091
+ # @overload get_column_spec(name: nil, field_mask: nil)
1092
+ # Pass arguments to `get_column_spec` via keyword arguments. Note that at
1093
+ # least one keyword argument is required. To specify no parameters, or to keep all
1094
+ # the default parameter values, pass an empty Hash as a request object (see above).
1095
+ #
1096
+ # @param name [String]
1097
+ # Required. The resource name of the column spec to retrieve.
1098
+ # @param field_mask [Google::Protobuf::FieldMask, Hash]
1099
+ # Mask specifying which fields to read.
1100
+ #
1101
+ # @yield [response, operation] Access the result along with the RPC operation
1102
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1103
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1104
+ #
1105
+ # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1106
+ #
1107
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1108
+ #
1109
+ def get_column_spec request, options = nil
1110
+ raise ArgumentError, "request must be provided" if request.nil?
1111
+
1112
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest
1113
+
1114
+ # Converts hash and nil to an options object
1115
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1116
+
1117
+ # Customize the options with defaults
1118
+ metadata = @config.rpcs.get_column_spec.metadata.to_h
1119
+
1120
+ # Set x-goog-api-client and x-goog-user-project headers
1121
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1122
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1123
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1124
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1125
+
1126
+ header_params = {
1127
+ "name" => request.name
1128
+ }
1129
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1130
+ metadata[:"x-goog-request-params"] ||= request_params_header
1131
+
1132
+ options.apply_defaults timeout: @config.rpcs.get_column_spec.timeout,
1133
+ metadata: metadata,
1134
+ retry_policy: @config.rpcs.get_column_spec.retry_policy
1135
+ options.apply_defaults metadata: @config.metadata,
1136
+ retry_policy: @config.retry_policy
1137
+
1138
+ @auto_ml_stub.call_rpc :get_column_spec, request, options: options do |response, operation|
1139
+ yield response, operation if block_given?
1140
+ return response
1141
+ end
1142
+ rescue GRPC::BadStatus => e
1143
+ raise Google::Cloud::Error.from_error(e)
1144
+ end
1145
+
1146
+ ##
1147
+ # Lists column specs in a table spec.
1148
+ #
1149
+ # @overload list_column_specs(request, options = nil)
1150
+ # Pass arguments to `list_column_specs` via a request object, either of type
1151
+ # {Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest} or an equivalent Hash.
1152
+ #
1153
+ # @param request [Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest, Hash]
1154
+ # A request object representing the call parameters. Required. To specify no
1155
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1156
+ # @param options [Gapic::CallOptions, Hash]
1157
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1158
+ #
1159
+ # @overload list_column_specs(parent: nil, field_mask: nil, filter: nil, page_size: nil, page_token: nil)
1160
+ # Pass arguments to `list_column_specs` via keyword arguments. Note that at
1161
+ # least one keyword argument is required. To specify no parameters, or to keep all
1162
+ # the default parameter values, pass an empty Hash as a request object (see above).
1163
+ #
1164
+ # @param parent [String]
1165
+ # Required. The resource name of the table spec to list column specs from.
1166
+ # @param field_mask [Google::Protobuf::FieldMask, Hash]
1167
+ # Mask specifying which fields to read.
1168
+ # @param filter [String]
1169
+ # Filter expression, see go/filtering.
1170
+ # @param page_size [Integer]
1171
+ # Requested page size. The server can return fewer results than requested.
1172
+ # If unspecified, the server will pick a default size.
1173
+ # @param page_token [String]
1174
+ # A token identifying a page of results for the server to return.
1175
+ # Typically obtained from the
1176
+ # {Google::Cloud::AutoML::V1beta1::ListColumnSpecsResponse#next_page_token ListColumnSpecsResponse.next_page_token} field of the previous
1177
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client#list_column_specs AutoMl.ListColumnSpecs} call.
1178
+ #
1179
+ # @yield [response, operation] Access the result along with the RPC operation
1180
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1181
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1182
+ #
1183
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1184
+ #
1185
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1186
+ #
1187
+ def list_column_specs request, options = nil
1188
+ raise ArgumentError, "request must be provided" if request.nil?
1189
+
1190
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest
1191
+
1192
+ # Converts hash and nil to an options object
1193
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1194
+
1195
+ # Customize the options with defaults
1196
+ metadata = @config.rpcs.list_column_specs.metadata.to_h
1197
+
1198
+ # Set x-goog-api-client and x-goog-user-project headers
1199
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1200
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1201
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1202
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1203
+
1204
+ header_params = {
1205
+ "parent" => request.parent
1206
+ }
1207
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1208
+ metadata[:"x-goog-request-params"] ||= request_params_header
1209
+
1210
+ options.apply_defaults timeout: @config.rpcs.list_column_specs.timeout,
1211
+ metadata: metadata,
1212
+ retry_policy: @config.rpcs.list_column_specs.retry_policy
1213
+ options.apply_defaults metadata: @config.metadata,
1214
+ retry_policy: @config.retry_policy
1215
+
1216
+ @auto_ml_stub.call_rpc :list_column_specs, request, options: options do |response, operation|
1217
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_column_specs, request, response, operation, options
1218
+ yield response, operation if block_given?
1219
+ return response
1220
+ end
1221
+ rescue GRPC::BadStatus => e
1222
+ raise Google::Cloud::Error.from_error(e)
1223
+ end
1224
+
1225
+ ##
1226
+ # Updates a column spec.
1227
+ #
1228
+ # @overload update_column_spec(request, options = nil)
1229
+ # Pass arguments to `update_column_spec` via a request object, either of type
1230
+ # {Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest} or an equivalent Hash.
1231
+ #
1232
+ # @param request [Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest, Hash]
1233
+ # A request object representing the call parameters. Required. To specify no
1234
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1235
+ # @param options [Gapic::CallOptions, Hash]
1236
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1237
+ #
1238
+ # @overload update_column_spec(column_spec: nil, update_mask: nil)
1239
+ # Pass arguments to `update_column_spec` via keyword arguments. Note that at
1240
+ # least one keyword argument is required. To specify no parameters, or to keep all
1241
+ # the default parameter values, pass an empty Hash as a request object (see above).
1242
+ #
1243
+ # @param column_spec [Google::Cloud::AutoML::V1beta1::ColumnSpec, Hash]
1244
+ # Required. The column spec which replaces the resource on the server.
1245
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
1246
+ # The update mask applies to the resource.
1247
+ #
1248
+ # @yield [response, operation] Access the result along with the RPC operation
1249
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1250
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1251
+ #
1252
+ # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1253
+ #
1254
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1255
+ #
1256
+ def update_column_spec request, options = nil
1257
+ raise ArgumentError, "request must be provided" if request.nil?
1258
+
1259
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest
1260
+
1261
+ # Converts hash and nil to an options object
1262
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1263
+
1264
+ # Customize the options with defaults
1265
+ metadata = @config.rpcs.update_column_spec.metadata.to_h
1266
+
1267
+ # Set x-goog-api-client and x-goog-user-project headers
1268
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1270
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1271
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1272
+
1273
+ header_params = {
1274
+ "column_spec.name" => request.column_spec.name
1275
+ }
1276
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1277
+ metadata[:"x-goog-request-params"] ||= request_params_header
1278
+
1279
+ options.apply_defaults timeout: @config.rpcs.update_column_spec.timeout,
1280
+ metadata: metadata,
1281
+ retry_policy: @config.rpcs.update_column_spec.retry_policy
1282
+ options.apply_defaults metadata: @config.metadata,
1283
+ retry_policy: @config.retry_policy
1284
+
1285
+ @auto_ml_stub.call_rpc :update_column_spec, request, options: options do |response, operation|
1286
+ yield response, operation if block_given?
1287
+ return response
1288
+ end
1289
+ rescue GRPC::BadStatus => e
1290
+ raise Google::Cloud::Error.from_error(e)
1291
+ end
1292
+
1293
+ ##
1294
+ # Creates a model.
1295
+ # Returns a Model in the {Google::Longrunning::Operation#response response}
1296
+ # field when it completes.
1297
+ # When you create a model, several model evaluations are created for it:
1298
+ # a global evaluation, and one evaluation for each annotation spec.
1299
+ #
1300
+ # @overload create_model(request, options = nil)
1301
+ # Pass arguments to `create_model` via a request object, either of type
1302
+ # {Google::Cloud::AutoML::V1beta1::CreateModelRequest} or an equivalent Hash.
1303
+ #
1304
+ # @param request [Google::Cloud::AutoML::V1beta1::CreateModelRequest, Hash]
1305
+ # A request object representing the call parameters. Required. To specify no
1306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1307
+ # @param options [Gapic::CallOptions, Hash]
1308
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1309
+ #
1310
+ # @overload create_model(parent: nil, model: nil)
1311
+ # Pass arguments to `create_model` via keyword arguments. Note that at
1312
+ # least one keyword argument is required. To specify no parameters, or to keep all
1313
+ # the default parameter values, pass an empty Hash as a request object (see above).
1314
+ #
1315
+ # @param parent [String]
1316
+ # Required. Resource name of the parent project where the model is being created.
1317
+ # @param model [Google::Cloud::AutoML::V1beta1::Model, Hash]
1318
+ # Required. The model to create.
1319
+ #
1320
+ # @yield [response, operation] Access the result along with the RPC operation
1321
+ # @yieldparam response [Gapic::Operation]
1322
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1323
+ #
1324
+ # @return [Gapic::Operation]
1325
+ #
1326
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1327
+ #
1328
+ def create_model request, options = nil
1329
+ raise ArgumentError, "request must be provided" if request.nil?
1330
+
1331
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::CreateModelRequest
1332
+
1333
+ # Converts hash and nil to an options object
1334
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1335
+
1336
+ # Customize the options with defaults
1337
+ metadata = @config.rpcs.create_model.metadata.to_h
1338
+
1339
+ # Set x-goog-api-client and x-goog-user-project headers
1340
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1341
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1342
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1343
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1344
+
1345
+ header_params = {
1346
+ "parent" => request.parent
1347
+ }
1348
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1349
+ metadata[:"x-goog-request-params"] ||= request_params_header
1350
+
1351
+ options.apply_defaults timeout: @config.rpcs.create_model.timeout,
1352
+ metadata: metadata,
1353
+ retry_policy: @config.rpcs.create_model.retry_policy
1354
+ options.apply_defaults metadata: @config.metadata,
1355
+ retry_policy: @config.retry_policy
1356
+
1357
+ @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
1358
+ response = Gapic::Operation.new response, @operations_client, options: options
1359
+ yield response, operation if block_given?
1360
+ return response
1361
+ end
1362
+ rescue GRPC::BadStatus => e
1363
+ raise Google::Cloud::Error.from_error(e)
1364
+ end
1365
+
1366
+ ##
1367
+ # Gets a model.
1368
+ #
1369
+ # @overload get_model(request, options = nil)
1370
+ # Pass arguments to `get_model` via a request object, either of type
1371
+ # {Google::Cloud::AutoML::V1beta1::GetModelRequest} or an equivalent Hash.
1372
+ #
1373
+ # @param request [Google::Cloud::AutoML::V1beta1::GetModelRequest, Hash]
1374
+ # A request object representing the call parameters. Required. To specify no
1375
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1376
+ # @param options [Gapic::CallOptions, Hash]
1377
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1378
+ #
1379
+ # @overload get_model(name: nil)
1380
+ # Pass arguments to `get_model` via keyword arguments. Note that at
1381
+ # least one keyword argument is required. To specify no parameters, or to keep all
1382
+ # the default parameter values, pass an empty Hash as a request object (see above).
1383
+ #
1384
+ # @param name [String]
1385
+ # Required. Resource name of the model.
1386
+ #
1387
+ # @yield [response, operation] Access the result along with the RPC operation
1388
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::Model]
1389
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1390
+ #
1391
+ # @return [Google::Cloud::AutoML::V1beta1::Model]
1392
+ #
1393
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1394
+ #
1395
+ def get_model request, options = nil
1396
+ raise ArgumentError, "request must be provided" if request.nil?
1397
+
1398
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetModelRequest
1399
+
1400
+ # Converts hash and nil to an options object
1401
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1402
+
1403
+ # Customize the options with defaults
1404
+ metadata = @config.rpcs.get_model.metadata.to_h
1405
+
1406
+ # Set x-goog-api-client and x-goog-user-project headers
1407
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1409
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1410
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1411
+
1412
+ header_params = {
1413
+ "name" => request.name
1414
+ }
1415
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1416
+ metadata[:"x-goog-request-params"] ||= request_params_header
1417
+
1418
+ options.apply_defaults timeout: @config.rpcs.get_model.timeout,
1419
+ metadata: metadata,
1420
+ retry_policy: @config.rpcs.get_model.retry_policy
1421
+ options.apply_defaults metadata: @config.metadata,
1422
+ retry_policy: @config.retry_policy
1423
+
1424
+ @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
1425
+ yield response, operation if block_given?
1426
+ return response
1427
+ end
1428
+ rescue GRPC::BadStatus => e
1429
+ raise Google::Cloud::Error.from_error(e)
1430
+ end
1431
+
1432
+ ##
1433
+ # Lists models.
1434
+ #
1435
+ # @overload list_models(request, options = nil)
1436
+ # Pass arguments to `list_models` via a request object, either of type
1437
+ # {Google::Cloud::AutoML::V1beta1::ListModelsRequest} or an equivalent Hash.
1438
+ #
1439
+ # @param request [Google::Cloud::AutoML::V1beta1::ListModelsRequest, Hash]
1440
+ # A request object representing the call parameters. Required. To specify no
1441
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1442
+ # @param options [Gapic::CallOptions, Hash]
1443
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1444
+ #
1445
+ # @overload list_models(parent: nil, filter: nil, page_size: nil, page_token: nil)
1446
+ # Pass arguments to `list_models` via keyword arguments. Note that at
1447
+ # least one keyword argument is required. To specify no parameters, or to keep all
1448
+ # the default parameter values, pass an empty Hash as a request object (see above).
1449
+ #
1450
+ # @param parent [String]
1451
+ # Required. Resource name of the project, from which to list the models.
1452
+ # @param filter [String]
1453
+ # An expression for filtering the results of the request.
1454
+ #
1455
+ # * `model_metadata` - for existence of the case (e.g.
1456
+ # video_classification_model_metadata:*).
1457
+ # * `dataset_id` - for = or !=. Some examples of using the filter are:
1458
+ #
1459
+ # * `image_classification_model_metadata:*` --> The model has
1460
+ # image_classification_model_metadata.
1461
+ # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1462
+ # @param page_size [Integer]
1463
+ # Requested page size.
1464
+ # @param page_token [String]
1465
+ # A token identifying a page of results for the server to return
1466
+ # Typically obtained via
1467
+ # {Google::Cloud::AutoML::V1beta1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} of the previous
1468
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client#list_models AutoMl.ListModels} call.
1469
+ #
1470
+ # @yield [response, operation] Access the result along with the RPC operation
1471
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1472
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1473
+ #
1474
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1475
+ #
1476
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1477
+ #
1478
+ def list_models request, options = nil
1479
+ raise ArgumentError, "request must be provided" if request.nil?
1480
+
1481
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ListModelsRequest
1482
+
1483
+ # Converts hash and nil to an options object
1484
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1485
+
1486
+ # Customize the options with defaults
1487
+ metadata = @config.rpcs.list_models.metadata.to_h
1488
+
1489
+ # Set x-goog-api-client and x-goog-user-project headers
1490
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1491
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1492
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1493
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1494
+
1495
+ header_params = {
1496
+ "parent" => request.parent
1497
+ }
1498
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1499
+ metadata[:"x-goog-request-params"] ||= request_params_header
1500
+
1501
+ options.apply_defaults timeout: @config.rpcs.list_models.timeout,
1502
+ metadata: metadata,
1503
+ retry_policy: @config.rpcs.list_models.retry_policy
1504
+ options.apply_defaults metadata: @config.metadata,
1505
+ retry_policy: @config.retry_policy
1506
+
1507
+ @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
1508
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
1509
+ yield response, operation if block_given?
1510
+ return response
1511
+ end
1512
+ rescue GRPC::BadStatus => e
1513
+ raise Google::Cloud::Error.from_error(e)
1514
+ end
1515
+
1516
+ ##
1517
+ # Deletes a model.
1518
+ # Returns `google.protobuf.Empty` in the
1519
+ # {Google::Longrunning::Operation#response response} field when it completes,
1520
+ # and `delete_details` in the
1521
+ # {Google::Longrunning::Operation#metadata metadata} field.
1522
+ #
1523
+ # @overload delete_model(request, options = nil)
1524
+ # Pass arguments to `delete_model` via a request object, either of type
1525
+ # {Google::Cloud::AutoML::V1beta1::DeleteModelRequest} or an equivalent Hash.
1526
+ #
1527
+ # @param request [Google::Cloud::AutoML::V1beta1::DeleteModelRequest, Hash]
1528
+ # A request object representing the call parameters. Required. To specify no
1529
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1530
+ # @param options [Gapic::CallOptions, Hash]
1531
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1532
+ #
1533
+ # @overload delete_model(name: nil)
1534
+ # Pass arguments to `delete_model` via keyword arguments. Note that at
1535
+ # least one keyword argument is required. To specify no parameters, or to keep all
1536
+ # the default parameter values, pass an empty Hash as a request object (see above).
1537
+ #
1538
+ # @param name [String]
1539
+ # Required. Resource name of the model being deleted.
1540
+ #
1541
+ # @yield [response, operation] Access the result along with the RPC operation
1542
+ # @yieldparam response [Gapic::Operation]
1543
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1544
+ #
1545
+ # @return [Gapic::Operation]
1546
+ #
1547
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1548
+ #
1549
+ def delete_model request, options = nil
1550
+ raise ArgumentError, "request must be provided" if request.nil?
1551
+
1552
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::DeleteModelRequest
1553
+
1554
+ # Converts hash and nil to an options object
1555
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1556
+
1557
+ # Customize the options with defaults
1558
+ metadata = @config.rpcs.delete_model.metadata.to_h
1559
+
1560
+ # Set x-goog-api-client and x-goog-user-project headers
1561
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1562
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1563
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1564
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1565
+
1566
+ header_params = {
1567
+ "name" => request.name
1568
+ }
1569
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1570
+ metadata[:"x-goog-request-params"] ||= request_params_header
1571
+
1572
+ options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
1573
+ metadata: metadata,
1574
+ retry_policy: @config.rpcs.delete_model.retry_policy
1575
+ options.apply_defaults metadata: @config.metadata,
1576
+ retry_policy: @config.retry_policy
1577
+
1578
+ @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
1579
+ response = Gapic::Operation.new response, @operations_client, options: options
1580
+ yield response, operation if block_given?
1581
+ return response
1582
+ end
1583
+ rescue GRPC::BadStatus => e
1584
+ raise Google::Cloud::Error.from_error(e)
1585
+ end
1586
+
1587
+ ##
1588
+ # Deploys a model. If a model is already deployed, deploying it with the
1589
+ # same parameters has no effect. Deploying with different parametrs
1590
+ # (as e.g. changing
1591
+ #
1592
+ # [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number])
1593
+ # will reset the deployment state without pausing the model's availability.
1594
+ #
1595
+ # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage
1596
+ # deployment automatically.
1597
+ #
1598
+ # Returns an empty response in the
1599
+ # {Google::Longrunning::Operation#response response} field when it completes.
1600
+ #
1601
+ # @overload deploy_model(request, options = nil)
1602
+ # Pass arguments to `deploy_model` via a request object, either of type
1603
+ # {Google::Cloud::AutoML::V1beta1::DeployModelRequest} or an equivalent Hash.
1604
+ #
1605
+ # @param request [Google::Cloud::AutoML::V1beta1::DeployModelRequest, Hash]
1606
+ # A request object representing the call parameters. Required. To specify no
1607
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1608
+ # @param options [Gapic::CallOptions, Hash]
1609
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1610
+ #
1611
+ # @overload deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil)
1612
+ # Pass arguments to `deploy_model` via keyword arguments. Note that at
1613
+ # least one keyword argument is required. To specify no parameters, or to keep all
1614
+ # the default parameter values, pass an empty Hash as a request object (see above).
1615
+ #
1616
+ # @param image_object_detection_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata, Hash]
1617
+ # Model deployment metadata specific to Image Object Detection.
1618
+ # @param image_classification_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata, Hash]
1619
+ # Model deployment metadata specific to Image Classification.
1620
+ # @param name [String]
1621
+ # Required. Resource name of the model to deploy.
1622
+ #
1623
+ # @yield [response, operation] Access the result along with the RPC operation
1624
+ # @yieldparam response [Gapic::Operation]
1625
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1626
+ #
1627
+ # @return [Gapic::Operation]
1628
+ #
1629
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1630
+ #
1631
+ def deploy_model request, options = nil
1632
+ raise ArgumentError, "request must be provided" if request.nil?
1633
+
1634
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::DeployModelRequest
1635
+
1636
+ # Converts hash and nil to an options object
1637
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1638
+
1639
+ # Customize the options with defaults
1640
+ metadata = @config.rpcs.deploy_model.metadata.to_h
1641
+
1642
+ # Set x-goog-api-client and x-goog-user-project headers
1643
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1644
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1645
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1646
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1647
+
1648
+ header_params = {
1649
+ "name" => request.name
1650
+ }
1651
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1652
+ metadata[:"x-goog-request-params"] ||= request_params_header
1653
+
1654
+ options.apply_defaults timeout: @config.rpcs.deploy_model.timeout,
1655
+ metadata: metadata,
1656
+ retry_policy: @config.rpcs.deploy_model.retry_policy
1657
+ options.apply_defaults metadata: @config.metadata,
1658
+ retry_policy: @config.retry_policy
1659
+
1660
+ @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
1661
+ response = Gapic::Operation.new response, @operations_client, options: options
1662
+ yield response, operation if block_given?
1663
+ return response
1664
+ end
1665
+ rescue GRPC::BadStatus => e
1666
+ raise Google::Cloud::Error.from_error(e)
1667
+ end
1668
+
1669
+ ##
1670
+ # Undeploys a model. If the model is not deployed this method has no effect.
1671
+ #
1672
+ # Only applicable for Text Classification, Image Object Detection and Tables;
1673
+ # all other domains manage deployment automatically.
1674
+ #
1675
+ # Returns an empty response in the
1676
+ # {Google::Longrunning::Operation#response response} field when it completes.
1677
+ #
1678
+ # @overload undeploy_model(request, options = nil)
1679
+ # Pass arguments to `undeploy_model` via a request object, either of type
1680
+ # {Google::Cloud::AutoML::V1beta1::UndeployModelRequest} or an equivalent Hash.
1681
+ #
1682
+ # @param request [Google::Cloud::AutoML::V1beta1::UndeployModelRequest, Hash]
1683
+ # A request object representing the call parameters. Required. To specify no
1684
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1685
+ # @param options [Gapic::CallOptions, Hash]
1686
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1687
+ #
1688
+ # @overload undeploy_model(name: nil)
1689
+ # Pass arguments to `undeploy_model` via keyword arguments. Note that at
1690
+ # least one keyword argument is required. To specify no parameters, or to keep all
1691
+ # the default parameter values, pass an empty Hash as a request object (see above).
1692
+ #
1693
+ # @param name [String]
1694
+ # Required. Resource name of the model to undeploy.
1695
+ #
1696
+ # @yield [response, operation] Access the result along with the RPC operation
1697
+ # @yieldparam response [Gapic::Operation]
1698
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1699
+ #
1700
+ # @return [Gapic::Operation]
1701
+ #
1702
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1703
+ #
1704
+ def undeploy_model request, options = nil
1705
+ raise ArgumentError, "request must be provided" if request.nil?
1706
+
1707
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::UndeployModelRequest
1708
+
1709
+ # Converts hash and nil to an options object
1710
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1711
+
1712
+ # Customize the options with defaults
1713
+ metadata = @config.rpcs.undeploy_model.metadata.to_h
1714
+
1715
+ # Set x-goog-api-client and x-goog-user-project headers
1716
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1717
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1718
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1719
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1720
+
1721
+ header_params = {
1722
+ "name" => request.name
1723
+ }
1724
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1725
+ metadata[:"x-goog-request-params"] ||= request_params_header
1726
+
1727
+ options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout,
1728
+ metadata: metadata,
1729
+ retry_policy: @config.rpcs.undeploy_model.retry_policy
1730
+ options.apply_defaults metadata: @config.metadata,
1731
+ retry_policy: @config.retry_policy
1732
+
1733
+ @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
1734
+ response = Gapic::Operation.new response, @operations_client, options: options
1735
+ yield response, operation if block_given?
1736
+ return response
1737
+ end
1738
+ rescue GRPC::BadStatus => e
1739
+ raise Google::Cloud::Error.from_error(e)
1740
+ end
1741
+
1742
+ ##
1743
+ # Exports a trained, "export-able", model to a user specified Google Cloud
1744
+ # Storage location. A model is considered export-able if and only if it has
1745
+ # an export format defined for it in
1746
+ #
1747
+ # {Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig ModelExportOutputConfig}.
1748
+ #
1749
+ # Returns an empty response in the
1750
+ # {Google::Longrunning::Operation#response response} field when it completes.
1751
+ #
1752
+ # @overload export_model(request, options = nil)
1753
+ # Pass arguments to `export_model` via a request object, either of type
1754
+ # {Google::Cloud::AutoML::V1beta1::ExportModelRequest} or an equivalent Hash.
1755
+ #
1756
+ # @param request [Google::Cloud::AutoML::V1beta1::ExportModelRequest, Hash]
1757
+ # A request object representing the call parameters. Required. To specify no
1758
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1759
+ # @param options [Gapic::CallOptions, Hash]
1760
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1761
+ #
1762
+ # @overload export_model(name: nil, output_config: nil)
1763
+ # Pass arguments to `export_model` via keyword arguments. Note that at
1764
+ # least one keyword argument is required. To specify no parameters, or to keep all
1765
+ # the default parameter values, pass an empty Hash as a request object (see above).
1766
+ #
1767
+ # @param name [String]
1768
+ # Required. The resource name of the model to export.
1769
+ # @param output_config [Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig, Hash]
1770
+ # Required. The desired output location and configuration.
1771
+ #
1772
+ # @yield [response, operation] Access the result along with the RPC operation
1773
+ # @yieldparam response [Gapic::Operation]
1774
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1775
+ #
1776
+ # @return [Gapic::Operation]
1777
+ #
1778
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1779
+ #
1780
+ def export_model request, options = nil
1781
+ raise ArgumentError, "request must be provided" if request.nil?
1782
+
1783
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ExportModelRequest
1784
+
1785
+ # Converts hash and nil to an options object
1786
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1787
+
1788
+ # Customize the options with defaults
1789
+ metadata = @config.rpcs.export_model.metadata.to_h
1790
+
1791
+ # Set x-goog-api-client and x-goog-user-project headers
1792
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1793
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1794
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1795
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1796
+
1797
+ header_params = {
1798
+ "name" => request.name
1799
+ }
1800
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1801
+ metadata[:"x-goog-request-params"] ||= request_params_header
1802
+
1803
+ options.apply_defaults timeout: @config.rpcs.export_model.timeout,
1804
+ metadata: metadata,
1805
+ retry_policy: @config.rpcs.export_model.retry_policy
1806
+ options.apply_defaults metadata: @config.metadata,
1807
+ retry_policy: @config.retry_policy
1808
+
1809
+ @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
1810
+ response = Gapic::Operation.new response, @operations_client, options: options
1811
+ yield response, operation if block_given?
1812
+ return response
1813
+ end
1814
+ rescue GRPC::BadStatus => e
1815
+ raise Google::Cloud::Error.from_error(e)
1816
+ end
1817
+
1818
+ ##
1819
+ # Exports examples on which the model was evaluated (i.e. which were in the
1820
+ # TEST set of the dataset the model was created from), together with their
1821
+ # ground truth annotations and the annotations created (predicted) by the
1822
+ # model.
1823
+ # The examples, ground truth and predictions are exported in the state
1824
+ # they were at the moment the model was evaluated.
1825
+ #
1826
+ # This export is available only for 30 days since the model evaluation is
1827
+ # created.
1828
+ #
1829
+ # Currently only available for Tables.
1830
+ #
1831
+ # Returns an empty response in the
1832
+ # {Google::Longrunning::Operation#response response} field when it completes.
1833
+ #
1834
+ # @overload export_evaluated_examples(request, options = nil)
1835
+ # Pass arguments to `export_evaluated_examples` via a request object, either of type
1836
+ # {Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest} or an equivalent Hash.
1837
+ #
1838
+ # @param request [Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest, Hash]
1839
+ # A request object representing the call parameters. Required. To specify no
1840
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1841
+ # @param options [Gapic::CallOptions, Hash]
1842
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1843
+ #
1844
+ # @overload export_evaluated_examples(name: nil, output_config: nil)
1845
+ # Pass arguments to `export_evaluated_examples` via keyword arguments. Note that at
1846
+ # least one keyword argument is required. To specify no parameters, or to keep all
1847
+ # the default parameter values, pass an empty Hash as a request object (see above).
1848
+ #
1849
+ # @param name [String]
1850
+ # Required. The resource name of the model whose evaluated examples are to
1851
+ # be exported.
1852
+ # @param output_config [Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesOutputConfig, Hash]
1853
+ # Required. The desired output location and configuration.
1854
+ #
1855
+ # @yield [response, operation] Access the result along with the RPC operation
1856
+ # @yieldparam response [Gapic::Operation]
1857
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1858
+ #
1859
+ # @return [Gapic::Operation]
1860
+ #
1861
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1862
+ #
1863
+ def export_evaluated_examples request, options = nil
1864
+ raise ArgumentError, "request must be provided" if request.nil?
1865
+
1866
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest
1867
+
1868
+ # Converts hash and nil to an options object
1869
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1870
+
1871
+ # Customize the options with defaults
1872
+ metadata = @config.rpcs.export_evaluated_examples.metadata.to_h
1873
+
1874
+ # Set x-goog-api-client and x-goog-user-project headers
1875
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1876
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1877
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1878
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1879
+
1880
+ header_params = {
1881
+ "name" => request.name
1882
+ }
1883
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1884
+ metadata[:"x-goog-request-params"] ||= request_params_header
1885
+
1886
+ options.apply_defaults timeout: @config.rpcs.export_evaluated_examples.timeout,
1887
+ metadata: metadata,
1888
+ retry_policy: @config.rpcs.export_evaluated_examples.retry_policy
1889
+ options.apply_defaults metadata: @config.metadata,
1890
+ retry_policy: @config.retry_policy
1891
+
1892
+ @auto_ml_stub.call_rpc :export_evaluated_examples, request, options: options do |response, operation|
1893
+ response = Gapic::Operation.new response, @operations_client, options: options
1894
+ yield response, operation if block_given?
1895
+ return response
1896
+ end
1897
+ rescue GRPC::BadStatus => e
1898
+ raise Google::Cloud::Error.from_error(e)
1899
+ end
1900
+
1901
+ ##
1902
+ # Gets a model evaluation.
1903
+ #
1904
+ # @overload get_model_evaluation(request, options = nil)
1905
+ # Pass arguments to `get_model_evaluation` via a request object, either of type
1906
+ # {Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest} or an equivalent Hash.
1907
+ #
1908
+ # @param request [Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest, Hash]
1909
+ # A request object representing the call parameters. Required. To specify no
1910
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1911
+ # @param options [Gapic::CallOptions, Hash]
1912
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1913
+ #
1914
+ # @overload get_model_evaluation(name: nil)
1915
+ # Pass arguments to `get_model_evaluation` via keyword arguments. Note that at
1916
+ # least one keyword argument is required. To specify no parameters, or to keep all
1917
+ # the default parameter values, pass an empty Hash as a request object (see above).
1918
+ #
1919
+ # @param name [String]
1920
+ # Required. Resource name for the model evaluation.
1921
+ #
1922
+ # @yield [response, operation] Access the result along with the RPC operation
1923
+ # @yieldparam response [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1924
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1925
+ #
1926
+ # @return [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1927
+ #
1928
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1929
+ #
1930
+ def get_model_evaluation request, options = nil
1931
+ raise ArgumentError, "request must be provided" if request.nil?
1932
+
1933
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest
1934
+
1935
+ # Converts hash and nil to an options object
1936
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1937
+
1938
+ # Customize the options with defaults
1939
+ metadata = @config.rpcs.get_model_evaluation.metadata.to_h
1940
+
1941
+ # Set x-goog-api-client and x-goog-user-project headers
1942
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1943
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1944
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
1945
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1946
+
1947
+ header_params = {
1948
+ "name" => request.name
1949
+ }
1950
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1951
+ metadata[:"x-goog-request-params"] ||= request_params_header
1952
+
1953
+ options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout,
1954
+ metadata: metadata,
1955
+ retry_policy: @config.rpcs.get_model_evaluation.retry_policy
1956
+ options.apply_defaults metadata: @config.metadata,
1957
+ retry_policy: @config.retry_policy
1958
+
1959
+ @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
1960
+ yield response, operation if block_given?
1961
+ return response
1962
+ end
1963
+ rescue GRPC::BadStatus => e
1964
+ raise Google::Cloud::Error.from_error(e)
1965
+ end
1966
+
1967
+ ##
1968
+ # Lists model evaluations.
1969
+ #
1970
+ # @overload list_model_evaluations(request, options = nil)
1971
+ # Pass arguments to `list_model_evaluations` via a request object, either of type
1972
+ # {Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest} or an equivalent Hash.
1973
+ #
1974
+ # @param request [Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest, Hash]
1975
+ # A request object representing the call parameters. Required. To specify no
1976
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1977
+ # @param options [Gapic::CallOptions, Hash]
1978
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1979
+ #
1980
+ # @overload list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil)
1981
+ # Pass arguments to `list_model_evaluations` via keyword arguments. Note that at
1982
+ # least one keyword argument is required. To specify no parameters, or to keep all
1983
+ # the default parameter values, pass an empty Hash as a request object (see above).
1984
+ #
1985
+ # @param parent [String]
1986
+ # Required. Resource name of the model to list the model evaluations for.
1987
+ # If modelId is set as "-", this will list model evaluations from across all
1988
+ # models of the parent location.
1989
+ # @param filter [String]
1990
+ # An expression for filtering the results of the request.
1991
+ #
1992
+ # * `annotation_spec_id` - for =, != or existence. See example below for
1993
+ # the last.
1994
+ #
1995
+ # Some examples of using the filter are:
1996
+ #
1997
+ # * `annotation_spec_id!=4` --> The model evaluation was done for
1998
+ # annotation spec with ID different than 4.
1999
+ # * `NOT annotation_spec_id:*` --> The model evaluation was done for
2000
+ # aggregate of all annotation specs.
2001
+ # @param page_size [Integer]
2002
+ # Requested page size.
2003
+ # @param page_token [String]
2004
+ # A token identifying a page of results for the server to return.
2005
+ # Typically obtained via
2006
+ # {Google::Cloud::AutoML::V1beta1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} of the previous
2007
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations} call.
2008
+ #
2009
+ # @yield [response, operation] Access the result along with the RPC operation
2010
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
2011
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
2012
+ #
2013
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
2014
+ #
2015
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
2016
+ #
2017
+ def list_model_evaluations request, options = nil
2018
+ raise ArgumentError, "request must be provided" if request.nil?
2019
+
2020
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest
2021
+
2022
+ # Converts hash and nil to an options object
2023
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2024
+
2025
+ # Customize the options with defaults
2026
+ metadata = @config.rpcs.list_model_evaluations.metadata.to_h
2027
+
2028
+ # Set x-goog-api-client and x-goog-user-project headers
2029
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
2030
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2031
+ gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
2032
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2033
+
2034
+ header_params = {
2035
+ "parent" => request.parent
2036
+ }
2037
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2038
+ metadata[:"x-goog-request-params"] ||= request_params_header
2039
+
2040
+ options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout,
2041
+ metadata: metadata,
2042
+ retry_policy: @config.rpcs.list_model_evaluations.retry_policy
2043
+ options.apply_defaults metadata: @config.metadata,
2044
+ retry_policy: @config.retry_policy
2045
+
2046
+ @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
2047
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
2048
+ yield response, operation if block_given?
2049
+ return response
2050
+ end
2051
+ rescue GRPC::BadStatus => e
2052
+ raise Google::Cloud::Error.from_error(e)
2053
+ end
2054
+
2055
+ ##
2056
+ # Configuration class for the AutoMl API.
2057
+ #
2058
+ # This class represents the configuration for AutoMl,
2059
+ # providing control over timeouts, retry behavior, logging, transport
2060
+ # parameters, and other low-level controls. Certain parameters can also be
2061
+ # applied individually to specific RPCs. See
2062
+ # {Google::Cloud::AutoML::V1beta1::AutoML::Client::Configuration::Rpcs}
2063
+ # for a list of RPCs that can be configured independently.
2064
+ #
2065
+ # Configuration can be applied globally to all clients, or to a single client
2066
+ # on construction.
2067
+ #
2068
+ # # Examples
2069
+ #
2070
+ # To modify the global config, setting the timeout for create_dataset
2071
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
2072
+ #
2073
+ # Google::Cloud::AutoML::V1beta1::AutoML::Client.configure do |config|
2074
+ # config.timeout = 10_000
2075
+ # config.rpcs.create_dataset.timeout = 20_000
2076
+ # end
2077
+ #
2078
+ # To apply the above configuration only to a new client:
2079
+ #
2080
+ # client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new do |config|
2081
+ # config.timeout = 10_000
2082
+ # config.rpcs.create_dataset.timeout = 20_000
2083
+ # end
2084
+ #
2085
+ # @!attribute [rw] endpoint
2086
+ # The hostname or hostname:port of the service endpoint.
2087
+ # Defaults to `"automl.googleapis.com"`.
2088
+ # @return [String]
2089
+ # @!attribute [rw] credentials
2090
+ # Credentials to send with calls. You may provide any of the following types:
2091
+ # * (`String`) The path to a service account key file in JSON format
2092
+ # * (`Hash`) A service account key as a Hash
2093
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2094
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2095
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2096
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2097
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2098
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2099
+ # * (`nil`) indicating no credentials
2100
+ # @return [Object]
2101
+ # @!attribute [rw] scope
2102
+ # The OAuth scopes
2103
+ # @return [Array<String>]
2104
+ # @!attribute [rw] lib_name
2105
+ # The library name as recorded in instrumentation and logging
2106
+ # @return [String]
2107
+ # @!attribute [rw] lib_version
2108
+ # The library version as recorded in instrumentation and logging
2109
+ # @return [String]
2110
+ # @!attribute [rw] channel_args
2111
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2112
+ # `GRPC::Core::Channel` object is provided as the credential.
2113
+ # @return [Hash]
2114
+ # @!attribute [rw] interceptors
2115
+ # An array of interceptors that are run before calls are executed.
2116
+ # @return [Array<GRPC::ClientInterceptor>]
2117
+ # @!attribute [rw] timeout
2118
+ # The call timeout in milliseconds.
2119
+ # @return [Numeric]
2120
+ # @!attribute [rw] metadata
2121
+ # Additional gRPC headers to be sent with the call.
2122
+ # @return [Hash{Symbol=>String}]
2123
+ # @!attribute [rw] retry_policy
2124
+ # The retry policy. The value is a hash with the following keys:
2125
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2126
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2127
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2128
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2129
+ # trigger a retry.
2130
+ # @return [Hash]
2131
+ #
2132
+ class Configuration
2133
+ extend Gapic::Config
2134
+
2135
+ config_attr :endpoint, "automl.googleapis.com", String
2136
+ config_attr :credentials, nil do |value|
2137
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2138
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2139
+ allowed.any? { |klass| klass === value }
2140
+ end
2141
+ config_attr :scope, nil, String, Array, nil
2142
+ config_attr :lib_name, nil, String, nil
2143
+ config_attr :lib_version, nil, String, nil
2144
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
2145
+ config_attr :interceptors, nil, Array, nil
2146
+ config_attr :timeout, nil, Numeric, nil
2147
+ config_attr :metadata, nil, Hash, nil
2148
+ config_attr :retry_policy, nil, Hash, Proc, nil
2149
+
2150
+ # @private
2151
+ def initialize parent_config = nil
2152
+ @parent_config = parent_config unless parent_config.nil?
2153
+
2154
+ yield self if block_given?
2155
+ end
2156
+
2157
+ ##
2158
+ # Configurations for individual RPCs
2159
+ # @return [Rpcs]
2160
+ #
2161
+ def rpcs
2162
+ @rpcs ||= begin
2163
+ parent_rpcs = nil
2164
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
2165
+ Rpcs.new parent_rpcs
2166
+ end
2167
+ end
2168
+
2169
+ ##
2170
+ # Configuration RPC class for the AutoMl API.
2171
+ #
2172
+ # Includes fields providing the configuration for each RPC in this service.
2173
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2174
+ # the following configuration fields:
2175
+ #
2176
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
2177
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2178
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2179
+ # include the following keys:
2180
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2181
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2182
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2183
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2184
+ # trigger a retry.
2185
+ #
2186
+ class Rpcs
2187
+ ##
2188
+ # RPC-specific configuration for `create_dataset`
2189
+ # @return [Gapic::Config::Method]
2190
+ #
2191
+ attr_reader :create_dataset
2192
+ ##
2193
+ # RPC-specific configuration for `get_dataset`
2194
+ # @return [Gapic::Config::Method]
2195
+ #
2196
+ attr_reader :get_dataset
2197
+ ##
2198
+ # RPC-specific configuration for `list_datasets`
2199
+ # @return [Gapic::Config::Method]
2200
+ #
2201
+ attr_reader :list_datasets
2202
+ ##
2203
+ # RPC-specific configuration for `update_dataset`
2204
+ # @return [Gapic::Config::Method]
2205
+ #
2206
+ attr_reader :update_dataset
2207
+ ##
2208
+ # RPC-specific configuration for `delete_dataset`
2209
+ # @return [Gapic::Config::Method]
2210
+ #
2211
+ attr_reader :delete_dataset
2212
+ ##
2213
+ # RPC-specific configuration for `import_data`
2214
+ # @return [Gapic::Config::Method]
2215
+ #
2216
+ attr_reader :import_data
2217
+ ##
2218
+ # RPC-specific configuration for `export_data`
2219
+ # @return [Gapic::Config::Method]
2220
+ #
2221
+ attr_reader :export_data
2222
+ ##
2223
+ # RPC-specific configuration for `get_annotation_spec`
2224
+ # @return [Gapic::Config::Method]
2225
+ #
2226
+ attr_reader :get_annotation_spec
2227
+ ##
2228
+ # RPC-specific configuration for `get_table_spec`
2229
+ # @return [Gapic::Config::Method]
2230
+ #
2231
+ attr_reader :get_table_spec
2232
+ ##
2233
+ # RPC-specific configuration for `list_table_specs`
2234
+ # @return [Gapic::Config::Method]
2235
+ #
2236
+ attr_reader :list_table_specs
2237
+ ##
2238
+ # RPC-specific configuration for `update_table_spec`
2239
+ # @return [Gapic::Config::Method]
2240
+ #
2241
+ attr_reader :update_table_spec
2242
+ ##
2243
+ # RPC-specific configuration for `get_column_spec`
2244
+ # @return [Gapic::Config::Method]
2245
+ #
2246
+ attr_reader :get_column_spec
2247
+ ##
2248
+ # RPC-specific configuration for `list_column_specs`
2249
+ # @return [Gapic::Config::Method]
2250
+ #
2251
+ attr_reader :list_column_specs
2252
+ ##
2253
+ # RPC-specific configuration for `update_column_spec`
2254
+ # @return [Gapic::Config::Method]
2255
+ #
2256
+ attr_reader :update_column_spec
2257
+ ##
2258
+ # RPC-specific configuration for `create_model`
2259
+ # @return [Gapic::Config::Method]
2260
+ #
2261
+ attr_reader :create_model
2262
+ ##
2263
+ # RPC-specific configuration for `get_model`
2264
+ # @return [Gapic::Config::Method]
2265
+ #
2266
+ attr_reader :get_model
2267
+ ##
2268
+ # RPC-specific configuration for `list_models`
2269
+ # @return [Gapic::Config::Method]
2270
+ #
2271
+ attr_reader :list_models
2272
+ ##
2273
+ # RPC-specific configuration for `delete_model`
2274
+ # @return [Gapic::Config::Method]
2275
+ #
2276
+ attr_reader :delete_model
2277
+ ##
2278
+ # RPC-specific configuration for `deploy_model`
2279
+ # @return [Gapic::Config::Method]
2280
+ #
2281
+ attr_reader :deploy_model
2282
+ ##
2283
+ # RPC-specific configuration for `undeploy_model`
2284
+ # @return [Gapic::Config::Method]
2285
+ #
2286
+ attr_reader :undeploy_model
2287
+ ##
2288
+ # RPC-specific configuration for `export_model`
2289
+ # @return [Gapic::Config::Method]
2290
+ #
2291
+ attr_reader :export_model
2292
+ ##
2293
+ # RPC-specific configuration for `export_evaluated_examples`
2294
+ # @return [Gapic::Config::Method]
2295
+ #
2296
+ attr_reader :export_evaluated_examples
2297
+ ##
2298
+ # RPC-specific configuration for `get_model_evaluation`
2299
+ # @return [Gapic::Config::Method]
2300
+ #
2301
+ attr_reader :get_model_evaluation
2302
+ ##
2303
+ # RPC-specific configuration for `list_model_evaluations`
2304
+ # @return [Gapic::Config::Method]
2305
+ #
2306
+ attr_reader :list_model_evaluations
2307
+
2308
+ # @private
2309
+ def initialize parent_rpcs = nil
2310
+ create_dataset_config = parent_rpcs&.create_dataset if parent_rpcs&.respond_to? :create_dataset
2311
+ @create_dataset = Gapic::Config::Method.new create_dataset_config
2312
+ get_dataset_config = parent_rpcs&.get_dataset if parent_rpcs&.respond_to? :get_dataset
2313
+ @get_dataset = Gapic::Config::Method.new get_dataset_config
2314
+ list_datasets_config = parent_rpcs&.list_datasets if parent_rpcs&.respond_to? :list_datasets
2315
+ @list_datasets = Gapic::Config::Method.new list_datasets_config
2316
+ update_dataset_config = parent_rpcs&.update_dataset if parent_rpcs&.respond_to? :update_dataset
2317
+ @update_dataset = Gapic::Config::Method.new update_dataset_config
2318
+ delete_dataset_config = parent_rpcs&.delete_dataset if parent_rpcs&.respond_to? :delete_dataset
2319
+ @delete_dataset = Gapic::Config::Method.new delete_dataset_config
2320
+ import_data_config = parent_rpcs&.import_data if parent_rpcs&.respond_to? :import_data
2321
+ @import_data = Gapic::Config::Method.new import_data_config
2322
+ export_data_config = parent_rpcs&.export_data if parent_rpcs&.respond_to? :export_data
2323
+ @export_data = Gapic::Config::Method.new export_data_config
2324
+ get_annotation_spec_config = parent_rpcs&.get_annotation_spec if parent_rpcs&.respond_to? :get_annotation_spec
2325
+ @get_annotation_spec = Gapic::Config::Method.new get_annotation_spec_config
2326
+ get_table_spec_config = parent_rpcs&.get_table_spec if parent_rpcs&.respond_to? :get_table_spec
2327
+ @get_table_spec = Gapic::Config::Method.new get_table_spec_config
2328
+ list_table_specs_config = parent_rpcs&.list_table_specs if parent_rpcs&.respond_to? :list_table_specs
2329
+ @list_table_specs = Gapic::Config::Method.new list_table_specs_config
2330
+ update_table_spec_config = parent_rpcs&.update_table_spec if parent_rpcs&.respond_to? :update_table_spec
2331
+ @update_table_spec = Gapic::Config::Method.new update_table_spec_config
2332
+ get_column_spec_config = parent_rpcs&.get_column_spec if parent_rpcs&.respond_to? :get_column_spec
2333
+ @get_column_spec = Gapic::Config::Method.new get_column_spec_config
2334
+ list_column_specs_config = parent_rpcs&.list_column_specs if parent_rpcs&.respond_to? :list_column_specs
2335
+ @list_column_specs = Gapic::Config::Method.new list_column_specs_config
2336
+ update_column_spec_config = parent_rpcs&.update_column_spec if parent_rpcs&.respond_to? :update_column_spec
2337
+ @update_column_spec = Gapic::Config::Method.new update_column_spec_config
2338
+ create_model_config = parent_rpcs&.create_model if parent_rpcs&.respond_to? :create_model
2339
+ @create_model = Gapic::Config::Method.new create_model_config
2340
+ get_model_config = parent_rpcs&.get_model if parent_rpcs&.respond_to? :get_model
2341
+ @get_model = Gapic::Config::Method.new get_model_config
2342
+ list_models_config = parent_rpcs&.list_models if parent_rpcs&.respond_to? :list_models
2343
+ @list_models = Gapic::Config::Method.new list_models_config
2344
+ delete_model_config = parent_rpcs&.delete_model if parent_rpcs&.respond_to? :delete_model
2345
+ @delete_model = Gapic::Config::Method.new delete_model_config
2346
+ deploy_model_config = parent_rpcs&.deploy_model if parent_rpcs&.respond_to? :deploy_model
2347
+ @deploy_model = Gapic::Config::Method.new deploy_model_config
2348
+ undeploy_model_config = parent_rpcs&.undeploy_model if parent_rpcs&.respond_to? :undeploy_model
2349
+ @undeploy_model = Gapic::Config::Method.new undeploy_model_config
2350
+ export_model_config = parent_rpcs&.export_model if parent_rpcs&.respond_to? :export_model
2351
+ @export_model = Gapic::Config::Method.new export_model_config
2352
+ export_evaluated_examples_config = parent_rpcs&.export_evaluated_examples if parent_rpcs&.respond_to? :export_evaluated_examples
2353
+ @export_evaluated_examples = Gapic::Config::Method.new export_evaluated_examples_config
2354
+ get_model_evaluation_config = parent_rpcs&.get_model_evaluation if parent_rpcs&.respond_to? :get_model_evaluation
2355
+ @get_model_evaluation = Gapic::Config::Method.new get_model_evaluation_config
2356
+ list_model_evaluations_config = parent_rpcs&.list_model_evaluations if parent_rpcs&.respond_to? :list_model_evaluations
2357
+ @list_model_evaluations = Gapic::Config::Method.new list_model_evaluations_config
2358
+
2359
+ yield self if block_given?
2360
+ end
2361
+ end
2362
+ end
2363
+ end
2364
+ end
2365
+ end
2366
+ end
2367
+ end
2368
+ end