google-cloud-automl-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) 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/v1/annotation_payload_pb.rb +37 -0
  7. data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +26 -0
  8. data/lib/google/cloud/automl/v1/automl/client.rb +1851 -0
  9. data/lib/google/cloud/automl/v1/automl/credentials.rb +51 -0
  10. data/lib/google/cloud/automl/v1/automl/operations.rb +564 -0
  11. data/lib/google/cloud/automl/v1/automl/paths.rb +130 -0
  12. data/lib/google/cloud/automl/v1/automl.rb +63 -0
  13. data/lib/google/cloud/automl/v1/classification_pb.rb +65 -0
  14. data/lib/google/cloud/automl/v1/data_items_pb.rb +87 -0
  15. data/lib/google/cloud/automl/v1/dataset_pb.rb +42 -0
  16. data/lib/google/cloud/automl/v1/detection_pb.rb +45 -0
  17. data/lib/google/cloud/automl/v1/geometry_pb.rb +28 -0
  18. data/lib/google/cloud/automl/v1/image_pb.rb +57 -0
  19. data/lib/google/cloud/automl/v1/io_pb.rb +65 -0
  20. data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +41 -0
  21. data/lib/google/cloud/automl/v1/model_pb.rb +49 -0
  22. data/lib/google/cloud/automl/v1/operations_pb.rb +88 -0
  23. data/lib/google/cloud/automl/v1/prediction_service/client.rb +634 -0
  24. data/lib/google/cloud/automl/v1/prediction_service/credentials.rb +51 -0
  25. data/lib/google/cloud/automl/v1/prediction_service/operations.rb +564 -0
  26. data/lib/google/cloud/automl/v1/prediction_service/paths.rb +52 -0
  27. data/lib/google/cloud/automl/v1/prediction_service.rb +53 -0
  28. data/lib/google/cloud/automl/v1/prediction_service_pb.rb +50 -0
  29. data/lib/google/cloud/automl/v1/prediction_service_services_pb.rb +103 -0
  30. data/lib/google/cloud/automl/v1/service_pb.rb +139 -0
  31. data/lib/google/cloud/automl/v1/service_services_pb.rb +137 -0
  32. data/lib/google/cloud/automl/v1/text_extraction_pb.rb +39 -0
  33. data/lib/google/cloud/automl/v1/text_pb.rb +41 -0
  34. data/lib/google/cloud/automl/v1/text_segment_pb.rb +25 -0
  35. data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +35 -0
  36. data/lib/google/cloud/automl/v1/translation_pb.rb +41 -0
  37. data/lib/google/cloud/automl/v1/version.rb +28 -0
  38. data/lib/google/cloud/automl/v1.rb +36 -0
  39. data/lib/google/cloud/common_resources_pb.rb +15 -0
  40. data/lib/google-cloud-automl-v1.rb +21 -0
  41. data/proto_docs/README.md +4 -0
  42. data/proto_docs/google/api/field_behavior.rb +59 -0
  43. data/proto_docs/google/api/resource.rb +247 -0
  44. data/proto_docs/google/cloud/automl/v1/annotation_payload.rb +60 -0
  45. data/proto_docs/google/cloud/automl/v1/annotation_spec.rb +46 -0
  46. data/proto_docs/google/cloud/automl/v1/classification.rb +191 -0
  47. data/proto_docs/google/cloud/automl/v1/data_items.rb +197 -0
  48. data/proto_docs/google/cloud/automl/v1/dataset.rb +94 -0
  49. data/proto_docs/google/cloud/automl/v1/detection.rb +97 -0
  50. data/proto_docs/google/cloud/automl/v1/geometry.rb +53 -0
  51. data/proto_docs/google/cloud/automl/v1/image.rb +217 -0
  52. data/proto_docs/google/cloud/automl/v1/io.rb +1402 -0
  53. data/proto_docs/google/cloud/automl/v1/model.rb +109 -0
  54. data/proto_docs/google/cloud/automl/v1/model_evaluation.rb +94 -0
  55. data/proto_docs/google/cloud/automl/v1/operations.rb +180 -0
  56. data/proto_docs/google/cloud/automl/v1/prediction_service.rb +271 -0
  57. data/proto_docs/google/cloud/automl/v1/service.rb +322 -0
  58. data/proto_docs/google/cloud/automl/v1/text.rb +76 -0
  59. data/proto_docs/google/cloud/automl/v1/text_extraction.rb +73 -0
  60. data/proto_docs/google/cloud/automl/v1/text_segment.rb +44 -0
  61. data/proto_docs/google/cloud/automl/v1/text_sentiment.rb +82 -0
  62. data/proto_docs/google/cloud/automl/v1/translation.rb +79 -0
  63. data/proto_docs/google/longrunning/operations.rb +150 -0
  64. data/proto_docs/google/protobuf/any.rb +138 -0
  65. data/proto_docs/google/protobuf/duration.rb +98 -0
  66. data/proto_docs/google/protobuf/empty.rb +36 -0
  67. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  68. data/proto_docs/google/protobuf/struct.rb +96 -0
  69. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  70. data/proto_docs/google/rpc/status.rb +46 -0
  71. metadata +227 -0
@@ -0,0 +1,37 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/automl/v1/annotation_payload.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/cloud/automl/v1/classification_pb'
7
+ require 'google/cloud/automl/v1/detection_pb'
8
+ require 'google/cloud/automl/v1/text_extraction_pb'
9
+ require 'google/cloud/automl/v1/text_sentiment_pb'
10
+ require 'google/cloud/automl/v1/translation_pb'
11
+ require 'google/protobuf/any_pb'
12
+ require 'google/api/annotations_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/automl/v1/annotation_payload.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.automl.v1.AnnotationPayload" do
16
+ optional :annotation_spec_id, :string, 1
17
+ optional :display_name, :string, 5
18
+ oneof :detail do
19
+ optional :translation, :message, 2, "google.cloud.automl.v1.TranslationAnnotation"
20
+ optional :classification, :message, 3, "google.cloud.automl.v1.ClassificationAnnotation"
21
+ optional :image_object_detection, :message, 4, "google.cloud.automl.v1.ImageObjectDetectionAnnotation"
22
+ optional :text_extraction, :message, 6, "google.cloud.automl.v1.TextExtractionAnnotation"
23
+ optional :text_sentiment, :message, 7, "google.cloud.automl.v1.TextSentimentAnnotation"
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ module Google
30
+ module Cloud
31
+ module AutoML
32
+ module V1
33
+ AnnotationPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.AnnotationPayload").msgclass
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,26 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/automl/v1/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/v1/annotation_spec.proto", :syntax => :proto3) do
10
+ add_message "google.cloud.automl.v1.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 V1
22
+ AnnotationSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1.AnnotationSpec").msgclass
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,1851 @@
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/v1/service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module AutoML
25
+ module V1
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::V1::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::V1::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", "V1"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
119
+ }
120
+
121
+ default_config.rpcs.create_model.timeout = 5.0
122
+
123
+ default_config.rpcs.get_model.timeout = 5.0
124
+ default_config.rpcs.get_model.retry_policy = {
125
+ initial_delay: 0.1,
126
+ max_delay: 60.0,
127
+ multiplier: 1.3,
128
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
129
+ }
130
+
131
+ default_config.rpcs.list_models.timeout = 5.0
132
+ default_config.rpcs.list_models.retry_policy = {
133
+ initial_delay: 0.1,
134
+ max_delay: 60.0,
135
+ multiplier: 1.3,
136
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
137
+ }
138
+
139
+ default_config.rpcs.delete_model.timeout = 5.0
140
+ default_config.rpcs.delete_model.retry_policy = {
141
+ initial_delay: 0.1,
142
+ max_delay: 60.0,
143
+ multiplier: 1.3,
144
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
145
+ }
146
+
147
+ default_config.rpcs.update_model.timeout = 5.0
148
+
149
+ default_config.rpcs.deploy_model.timeout = 5.0
150
+
151
+ default_config.rpcs.undeploy_model.timeout = 5.0
152
+
153
+ default_config.rpcs.export_model.timeout = 5.0
154
+
155
+ default_config.rpcs.get_model_evaluation.timeout = 5.0
156
+ default_config.rpcs.get_model_evaluation.retry_policy = {
157
+ initial_delay: 0.1,
158
+ max_delay: 60.0,
159
+ multiplier: 1.3,
160
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
161
+ }
162
+
163
+ default_config.rpcs.list_model_evaluations.timeout = 5.0
164
+ default_config.rpcs.list_model_evaluations.retry_policy = {
165
+ initial_delay: 0.1,
166
+ max_delay: 60.0,
167
+ multiplier: 1.3,
168
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
169
+ }
170
+
171
+ default_config
172
+ end
173
+ yield @configure if block_given?
174
+ @configure
175
+ end
176
+
177
+ ##
178
+ # Configure the AutoMl Client instance.
179
+ #
180
+ # The configuration is set to the derived mode, meaning that values can be changed,
181
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
182
+ # should be made on {Client.configure}.
183
+ #
184
+ # See {Google::Cloud::AutoML::V1::AutoML::Client::Configuration}
185
+ # for a description of the configuration fields.
186
+ #
187
+ # @yield [config] Configure the Client client.
188
+ # @yieldparam config [Client::Configuration]
189
+ #
190
+ # @return [Client::Configuration]
191
+ #
192
+ def configure
193
+ yield @config if block_given?
194
+ @config
195
+ end
196
+
197
+ ##
198
+ # Create a new AutoMl client object.
199
+ #
200
+ # ## Examples
201
+ #
202
+ # To create a new AutoMl client with the default
203
+ # configuration:
204
+ #
205
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new
206
+ #
207
+ # To create a new AutoMl client with a custom
208
+ # configuration:
209
+ #
210
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
211
+ # config.timeout = 10_000
212
+ # end
213
+ #
214
+ # @yield [config] Configure the AutoMl client.
215
+ # @yieldparam config [Client::Configuration]
216
+ #
217
+ def initialize
218
+ # These require statements are intentionally placed here to initialize
219
+ # the gRPC module only when it's required.
220
+ # See https://github.com/googleapis/toolkit/issues/446
221
+ require "gapic/grpc"
222
+ require "google/cloud/automl/v1/service_services_pb"
223
+
224
+ # Create the configuration object
225
+ @config = Configuration.new Client.configure
226
+
227
+ # Yield the configuration if needed
228
+ yield @config if block_given?
229
+
230
+ # Create credentials
231
+ credentials = @config.credentials
232
+ credentials ||= Credentials.default scope: @config.scope
233
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
234
+ credentials = Credentials.new credentials, scope: @config.scope
235
+ end
236
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
237
+
238
+ @operations_client = Operations.new do |config|
239
+ config.credentials = credentials
240
+ config.endpoint = @config.endpoint
241
+ end
242
+
243
+ @auto_ml_stub = Gapic::ServiceStub.new(
244
+ Google::Cloud::AutoML::V1::AutoMl::Stub,
245
+ credentials: credentials,
246
+ endpoint: @config.endpoint,
247
+ channel_args: @config.channel_args,
248
+ interceptors: @config.interceptors
249
+ )
250
+ end
251
+
252
+ ##
253
+ # Get the associated client for long-running operations.
254
+ #
255
+ # @return [Google::Cloud::AutoML::V1::AutoML::Operations]
256
+ #
257
+ attr_reader :operations_client
258
+
259
+ # Service calls
260
+
261
+ ##
262
+ # Creates a dataset.
263
+ #
264
+ # @overload create_dataset(request, options = nil)
265
+ # Pass arguments to `create_dataset` via a request object, either of type
266
+ # {Google::Cloud::AutoML::V1::CreateDatasetRequest} or an equivalent Hash.
267
+ #
268
+ # @param request [Google::Cloud::AutoML::V1::CreateDatasetRequest, Hash]
269
+ # A request object representing the call parameters. Required. To specify no
270
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
271
+ # @param options [Gapic::CallOptions, Hash]
272
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
273
+ #
274
+ # @overload create_dataset(parent: nil, dataset: nil)
275
+ # Pass arguments to `create_dataset` via keyword arguments. Note that at
276
+ # least one keyword argument is required. To specify no parameters, or to keep all
277
+ # the default parameter values, pass an empty Hash as a request object (see above).
278
+ #
279
+ # @param parent [String]
280
+ # Required. The resource name of the project to create the dataset for.
281
+ # @param dataset [Google::Cloud::AutoML::V1::Dataset, Hash]
282
+ # Required. The dataset to create.
283
+ #
284
+ # @yield [response, operation] Access the result along with the RPC operation
285
+ # @yieldparam response [Gapic::Operation]
286
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
287
+ #
288
+ # @return [Gapic::Operation]
289
+ #
290
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
291
+ #
292
+ def create_dataset request, options = nil
293
+ raise ArgumentError, "request must be provided" if request.nil?
294
+
295
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::CreateDatasetRequest
296
+
297
+ # Converts hash and nil to an options object
298
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
299
+
300
+ # Customize the options with defaults
301
+ metadata = @config.rpcs.create_dataset.metadata.to_h
302
+
303
+ # Set x-goog-api-client and x-goog-user-project headers
304
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
306
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
307
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ header_params = {
310
+ "parent" => request.parent
311
+ }
312
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
313
+ metadata[:"x-goog-request-params"] ||= request_params_header
314
+
315
+ options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
316
+ metadata: metadata,
317
+ retry_policy: @config.rpcs.create_dataset.retry_policy
318
+ options.apply_defaults metadata: @config.metadata,
319
+ retry_policy: @config.retry_policy
320
+
321
+ @auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
322
+ response = Gapic::Operation.new response, @operations_client, options: options
323
+ yield response, operation if block_given?
324
+ return response
325
+ end
326
+ rescue GRPC::BadStatus => e
327
+ raise Google::Cloud::Error.from_error(e)
328
+ end
329
+
330
+ ##
331
+ # Gets a dataset.
332
+ #
333
+ # @overload get_dataset(request, options = nil)
334
+ # Pass arguments to `get_dataset` via a request object, either of type
335
+ # {Google::Cloud::AutoML::V1::GetDatasetRequest} or an equivalent Hash.
336
+ #
337
+ # @param request [Google::Cloud::AutoML::V1::GetDatasetRequest, Hash]
338
+ # A request object representing the call parameters. Required. To specify no
339
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
340
+ # @param options [Gapic::CallOptions, Hash]
341
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
342
+ #
343
+ # @overload get_dataset(name: nil)
344
+ # Pass arguments to `get_dataset` via keyword arguments. Note that at
345
+ # least one keyword argument is required. To specify no parameters, or to keep all
346
+ # the default parameter values, pass an empty Hash as a request object (see above).
347
+ #
348
+ # @param name [String]
349
+ # Required. The resource name of the dataset to retrieve.
350
+ #
351
+ # @yield [response, operation] Access the result along with the RPC operation
352
+ # @yieldparam response [Google::Cloud::AutoML::V1::Dataset]
353
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
354
+ #
355
+ # @return [Google::Cloud::AutoML::V1::Dataset]
356
+ #
357
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
358
+ #
359
+ def get_dataset request, options = nil
360
+ raise ArgumentError, "request must be provided" if request.nil?
361
+
362
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::GetDatasetRequest
363
+
364
+ # Converts hash and nil to an options object
365
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
366
+
367
+ # Customize the options with defaults
368
+ metadata = @config.rpcs.get_dataset.metadata.to_h
369
+
370
+ # Set x-goog-api-client and x-goog-user-project headers
371
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
372
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
373
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
374
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
375
+
376
+ header_params = {
377
+ "name" => request.name
378
+ }
379
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
380
+ metadata[:"x-goog-request-params"] ||= request_params_header
381
+
382
+ options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
383
+ metadata: metadata,
384
+ retry_policy: @config.rpcs.get_dataset.retry_policy
385
+ options.apply_defaults metadata: @config.metadata,
386
+ retry_policy: @config.retry_policy
387
+
388
+ @auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
389
+ yield response, operation if block_given?
390
+ return response
391
+ end
392
+ rescue GRPC::BadStatus => e
393
+ raise Google::Cloud::Error.from_error(e)
394
+ end
395
+
396
+ ##
397
+ # Lists datasets in a project.
398
+ #
399
+ # @overload list_datasets(request, options = nil)
400
+ # Pass arguments to `list_datasets` via a request object, either of type
401
+ # {Google::Cloud::AutoML::V1::ListDatasetsRequest} or an equivalent Hash.
402
+ #
403
+ # @param request [Google::Cloud::AutoML::V1::ListDatasetsRequest, Hash]
404
+ # A request object representing the call parameters. Required. To specify no
405
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
406
+ # @param options [Gapic::CallOptions, Hash]
407
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
408
+ #
409
+ # @overload list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil)
410
+ # Pass arguments to `list_datasets` via keyword arguments. Note that at
411
+ # least one keyword argument is required. To specify no parameters, or to keep all
412
+ # the default parameter values, pass an empty Hash as a request object (see above).
413
+ #
414
+ # @param parent [String]
415
+ # Required. The resource name of the project from which to list datasets.
416
+ # @param filter [String]
417
+ # An expression for filtering the results of the request.
418
+ #
419
+ # * `dataset_metadata` - for existence of the case (e.g.
420
+ # image_classification_dataset_metadata:*). Some examples of using the filter are:
421
+ #
422
+ # * `translation_dataset_metadata:*` --> The dataset has
423
+ # translation_dataset_metadata.
424
+ # @param page_size [Integer]
425
+ # Requested page size. Server may return fewer results than requested.
426
+ # If unspecified, server will pick a default size.
427
+ # @param page_token [String]
428
+ # A token identifying a page of results for the server to return
429
+ # Typically obtained via
430
+ # {Google::Cloud::AutoML::V1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous
431
+ # {Google::Cloud::AutoML::V1::AutoML::Client#list_datasets AutoMl.ListDatasets} call.
432
+ #
433
+ # @yield [response, operation] Access the result along with the RPC operation
434
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::Dataset>]
435
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
436
+ #
437
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::Dataset>]
438
+ #
439
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
440
+ #
441
+ def list_datasets request, options = nil
442
+ raise ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ListDatasetsRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.list_datasets.metadata.to_h
451
+
452
+ # Set x-goog-api-client and x-goog-user-project headers
453
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
456
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
457
+
458
+ header_params = {
459
+ "parent" => request.parent
460
+ }
461
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
462
+ metadata[:"x-goog-request-params"] ||= request_params_header
463
+
464
+ options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
465
+ metadata: metadata,
466
+ retry_policy: @config.rpcs.list_datasets.retry_policy
467
+ options.apply_defaults metadata: @config.metadata,
468
+ retry_policy: @config.retry_policy
469
+
470
+ @auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
471
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
472
+ yield response, operation if block_given?
473
+ return response
474
+ end
475
+ rescue GRPC::BadStatus => e
476
+ raise Google::Cloud::Error.from_error(e)
477
+ end
478
+
479
+ ##
480
+ # Updates a dataset.
481
+ #
482
+ # @overload update_dataset(request, options = nil)
483
+ # Pass arguments to `update_dataset` via a request object, either of type
484
+ # {Google::Cloud::AutoML::V1::UpdateDatasetRequest} or an equivalent Hash.
485
+ #
486
+ # @param request [Google::Cloud::AutoML::V1::UpdateDatasetRequest, Hash]
487
+ # A request object representing the call parameters. Required. To specify no
488
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
489
+ # @param options [Gapic::CallOptions, Hash]
490
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
491
+ #
492
+ # @overload update_dataset(dataset: nil, update_mask: nil)
493
+ # Pass arguments to `update_dataset` via keyword arguments. Note that at
494
+ # least one keyword argument is required. To specify no parameters, or to keep all
495
+ # the default parameter values, pass an empty Hash as a request object (see above).
496
+ #
497
+ # @param dataset [Google::Cloud::AutoML::V1::Dataset, Hash]
498
+ # Required. The dataset which replaces the resource on the server.
499
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
500
+ # Required. The update mask applies to the resource.
501
+ #
502
+ # @yield [response, operation] Access the result along with the RPC operation
503
+ # @yieldparam response [Google::Cloud::AutoML::V1::Dataset]
504
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
505
+ #
506
+ # @return [Google::Cloud::AutoML::V1::Dataset]
507
+ #
508
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
509
+ #
510
+ def update_dataset request, options = nil
511
+ raise ArgumentError, "request must be provided" if request.nil?
512
+
513
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::UpdateDatasetRequest
514
+
515
+ # Converts hash and nil to an options object
516
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
517
+
518
+ # Customize the options with defaults
519
+ metadata = @config.rpcs.update_dataset.metadata.to_h
520
+
521
+ # Set x-goog-api-client and x-goog-user-project headers
522
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
523
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
524
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
525
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ header_params = {
528
+ "dataset.name" => request.dataset.name
529
+ }
530
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
531
+ metadata[:"x-goog-request-params"] ||= request_params_header
532
+
533
+ options.apply_defaults timeout: @config.rpcs.update_dataset.timeout,
534
+ metadata: metadata,
535
+ retry_policy: @config.rpcs.update_dataset.retry_policy
536
+ options.apply_defaults metadata: @config.metadata,
537
+ retry_policy: @config.retry_policy
538
+
539
+ @auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
540
+ yield response, operation if block_given?
541
+ return response
542
+ end
543
+ rescue GRPC::BadStatus => e
544
+ raise Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Deletes a dataset and all of its contents.
549
+ # Returns empty response in the
550
+ # {Google::Longrunning::Operation#response response} field when it completes,
551
+ # and `delete_details` in the
552
+ # {Google::Longrunning::Operation#metadata metadata} field.
553
+ #
554
+ # @overload delete_dataset(request, options = nil)
555
+ # Pass arguments to `delete_dataset` via a request object, either of type
556
+ # {Google::Cloud::AutoML::V1::DeleteDatasetRequest} or an equivalent Hash.
557
+ #
558
+ # @param request [Google::Cloud::AutoML::V1::DeleteDatasetRequest, Hash]
559
+ # A request object representing the call parameters. Required. To specify no
560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
561
+ # @param options [Gapic::CallOptions, Hash]
562
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
563
+ #
564
+ # @overload delete_dataset(name: nil)
565
+ # Pass arguments to `delete_dataset` via keyword arguments. Note that at
566
+ # least one keyword argument is required. To specify no parameters, or to keep all
567
+ # the default parameter values, pass an empty Hash as a request object (see above).
568
+ #
569
+ # @param name [String]
570
+ # Required. The resource name of the dataset to delete.
571
+ #
572
+ # @yield [response, operation] Access the result along with the RPC operation
573
+ # @yieldparam response [Gapic::Operation]
574
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
575
+ #
576
+ # @return [Gapic::Operation]
577
+ #
578
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
579
+ #
580
+ def delete_dataset request, options = nil
581
+ raise ArgumentError, "request must be provided" if request.nil?
582
+
583
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::DeleteDatasetRequest
584
+
585
+ # Converts hash and nil to an options object
586
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
587
+
588
+ # Customize the options with defaults
589
+ metadata = @config.rpcs.delete_dataset.metadata.to_h
590
+
591
+ # Set x-goog-api-client and x-goog-user-project headers
592
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
593
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
594
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
595
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ header_params = {
598
+ "name" => request.name
599
+ }
600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
601
+ metadata[:"x-goog-request-params"] ||= request_params_header
602
+
603
+ options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
604
+ metadata: metadata,
605
+ retry_policy: @config.rpcs.delete_dataset.retry_policy
606
+ options.apply_defaults metadata: @config.metadata,
607
+ retry_policy: @config.retry_policy
608
+
609
+ @auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
610
+ response = Gapic::Operation.new response, @operations_client, options: options
611
+ yield response, operation if block_given?
612
+ return response
613
+ end
614
+ rescue GRPC::BadStatus => e
615
+ raise Google::Cloud::Error.from_error(e)
616
+ end
617
+
618
+ ##
619
+ # Imports data into a dataset.
620
+ # For Tables this method can only be called on an empty Dataset.
621
+ #
622
+ # For Tables:
623
+ # * A
624
+ # {Google::Cloud::AutoML::V1::InputConfig#params schema_inference_version}
625
+ # parameter must be explicitly set.
626
+ # Returns an empty response in the
627
+ # {Google::Longrunning::Operation#response response} field when it completes.
628
+ #
629
+ # @overload import_data(request, options = nil)
630
+ # Pass arguments to `import_data` via a request object, either of type
631
+ # {Google::Cloud::AutoML::V1::ImportDataRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [Google::Cloud::AutoML::V1::ImportDataRequest, Hash]
634
+ # A request object representing the call parameters. Required. To specify no
635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
636
+ # @param options [Gapic::CallOptions, Hash]
637
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
638
+ #
639
+ # @overload import_data(name: nil, input_config: nil)
640
+ # Pass arguments to `import_data` via keyword arguments. Note that at
641
+ # least one keyword argument is required. To specify no parameters, or to keep all
642
+ # the default parameter values, pass an empty Hash as a request object (see above).
643
+ #
644
+ # @param name [String]
645
+ # Required. Dataset name. Dataset must already exist. All imported
646
+ # annotations and examples will be added.
647
+ # @param input_config [Google::Cloud::AutoML::V1::InputConfig, Hash]
648
+ # Required. The desired input location and its domain specific semantics,
649
+ # if any.
650
+ #
651
+ # @yield [response, operation] Access the result along with the RPC operation
652
+ # @yieldparam response [Gapic::Operation]
653
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
654
+ #
655
+ # @return [Gapic::Operation]
656
+ #
657
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
658
+ #
659
+ def import_data request, options = nil
660
+ raise ArgumentError, "request must be provided" if request.nil?
661
+
662
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ImportDataRequest
663
+
664
+ # Converts hash and nil to an options object
665
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
666
+
667
+ # Customize the options with defaults
668
+ metadata = @config.rpcs.import_data.metadata.to_h
669
+
670
+ # Set x-goog-api-client and x-goog-user-project headers
671
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
672
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
673
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
674
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
675
+
676
+ header_params = {
677
+ "name" => request.name
678
+ }
679
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
680
+ metadata[:"x-goog-request-params"] ||= request_params_header
681
+
682
+ options.apply_defaults timeout: @config.rpcs.import_data.timeout,
683
+ metadata: metadata,
684
+ retry_policy: @config.rpcs.import_data.retry_policy
685
+ options.apply_defaults metadata: @config.metadata,
686
+ retry_policy: @config.retry_policy
687
+
688
+ @auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
689
+ response = Gapic::Operation.new response, @operations_client, options: options
690
+ yield response, operation if block_given?
691
+ return response
692
+ end
693
+ rescue GRPC::BadStatus => e
694
+ raise Google::Cloud::Error.from_error(e)
695
+ end
696
+
697
+ ##
698
+ # Exports dataset's data to the provided output location.
699
+ # Returns an empty response in the
700
+ # {Google::Longrunning::Operation#response response} field when it completes.
701
+ #
702
+ # @overload export_data(request, options = nil)
703
+ # Pass arguments to `export_data` via a request object, either of type
704
+ # {Google::Cloud::AutoML::V1::ExportDataRequest} or an equivalent Hash.
705
+ #
706
+ # @param request [Google::Cloud::AutoML::V1::ExportDataRequest, Hash]
707
+ # A request object representing the call parameters. Required. To specify no
708
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
709
+ # @param options [Gapic::CallOptions, Hash]
710
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
711
+ #
712
+ # @overload export_data(name: nil, output_config: nil)
713
+ # Pass arguments to `export_data` via keyword arguments. Note that at
714
+ # least one keyword argument is required. To specify no parameters, or to keep all
715
+ # the default parameter values, pass an empty Hash as a request object (see above).
716
+ #
717
+ # @param name [String]
718
+ # Required. The resource name of the dataset.
719
+ # @param output_config [Google::Cloud::AutoML::V1::OutputConfig, Hash]
720
+ # Required. The desired output location.
721
+ #
722
+ # @yield [response, operation] Access the result along with the RPC operation
723
+ # @yieldparam response [Gapic::Operation]
724
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
725
+ #
726
+ # @return [Gapic::Operation]
727
+ #
728
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
729
+ #
730
+ def export_data request, options = nil
731
+ raise ArgumentError, "request must be provided" if request.nil?
732
+
733
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ExportDataRequest
734
+
735
+ # Converts hash and nil to an options object
736
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
737
+
738
+ # Customize the options with defaults
739
+ metadata = @config.rpcs.export_data.metadata.to_h
740
+
741
+ # Set x-goog-api-client and x-goog-user-project headers
742
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
743
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
744
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
745
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
746
+
747
+ header_params = {
748
+ "name" => request.name
749
+ }
750
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
751
+ metadata[:"x-goog-request-params"] ||= request_params_header
752
+
753
+ options.apply_defaults timeout: @config.rpcs.export_data.timeout,
754
+ metadata: metadata,
755
+ retry_policy: @config.rpcs.export_data.retry_policy
756
+ options.apply_defaults metadata: @config.metadata,
757
+ retry_policy: @config.retry_policy
758
+
759
+ @auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
760
+ response = Gapic::Operation.new response, @operations_client, options: options
761
+ yield response, operation if block_given?
762
+ return response
763
+ end
764
+ rescue GRPC::BadStatus => e
765
+ raise Google::Cloud::Error.from_error(e)
766
+ end
767
+
768
+ ##
769
+ # Gets an annotation spec.
770
+ #
771
+ # @overload get_annotation_spec(request, options = nil)
772
+ # Pass arguments to `get_annotation_spec` via a request object, either of type
773
+ # {Google::Cloud::AutoML::V1::GetAnnotationSpecRequest} or an equivalent Hash.
774
+ #
775
+ # @param request [Google::Cloud::AutoML::V1::GetAnnotationSpecRequest, Hash]
776
+ # A request object representing the call parameters. Required. To specify no
777
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
778
+ # @param options [Gapic::CallOptions, Hash]
779
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
780
+ #
781
+ # @overload get_annotation_spec(name: nil)
782
+ # Pass arguments to `get_annotation_spec` via keyword arguments. Note that at
783
+ # least one keyword argument is required. To specify no parameters, or to keep all
784
+ # the default parameter values, pass an empty Hash as a request object (see above).
785
+ #
786
+ # @param name [String]
787
+ # Required. The resource name of the annotation spec to retrieve.
788
+ #
789
+ # @yield [response, operation] Access the result along with the RPC operation
790
+ # @yieldparam response [Google::Cloud::AutoML::V1::AnnotationSpec]
791
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
792
+ #
793
+ # @return [Google::Cloud::AutoML::V1::AnnotationSpec]
794
+ #
795
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
796
+ #
797
+ def get_annotation_spec request, options = nil
798
+ raise ArgumentError, "request must be provided" if request.nil?
799
+
800
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::GetAnnotationSpecRequest
801
+
802
+ # Converts hash and nil to an options object
803
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
804
+
805
+ # Customize the options with defaults
806
+ metadata = @config.rpcs.get_annotation_spec.metadata.to_h
807
+
808
+ # Set x-goog-api-client and x-goog-user-project headers
809
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
810
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
811
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
812
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
813
+
814
+ header_params = {
815
+ "name" => request.name
816
+ }
817
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
818
+ metadata[:"x-goog-request-params"] ||= request_params_header
819
+
820
+ options.apply_defaults timeout: @config.rpcs.get_annotation_spec.timeout,
821
+ metadata: metadata,
822
+ retry_policy: @config.rpcs.get_annotation_spec.retry_policy
823
+ options.apply_defaults metadata: @config.metadata,
824
+ retry_policy: @config.retry_policy
825
+
826
+ @auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
827
+ yield response, operation if block_given?
828
+ return response
829
+ end
830
+ rescue GRPC::BadStatus => e
831
+ raise Google::Cloud::Error.from_error(e)
832
+ end
833
+
834
+ ##
835
+ # Creates a model.
836
+ # Returns a Model in the {Google::Longrunning::Operation#response response}
837
+ # field when it completes.
838
+ # When you create a model, several model evaluations are created for it:
839
+ # a global evaluation, and one evaluation for each annotation spec.
840
+ #
841
+ # @overload create_model(request, options = nil)
842
+ # Pass arguments to `create_model` via a request object, either of type
843
+ # {Google::Cloud::AutoML::V1::CreateModelRequest} or an equivalent Hash.
844
+ #
845
+ # @param request [Google::Cloud::AutoML::V1::CreateModelRequest, Hash]
846
+ # A request object representing the call parameters. Required. To specify no
847
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
848
+ # @param options [Gapic::CallOptions, Hash]
849
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
850
+ #
851
+ # @overload create_model(parent: nil, model: nil)
852
+ # Pass arguments to `create_model` via keyword arguments. Note that at
853
+ # least one keyword argument is required. To specify no parameters, or to keep all
854
+ # the default parameter values, pass an empty Hash as a request object (see above).
855
+ #
856
+ # @param parent [String]
857
+ # Required. Resource name of the parent project where the model is being created.
858
+ # @param model [Google::Cloud::AutoML::V1::Model, Hash]
859
+ # Required. The model to create.
860
+ #
861
+ # @yield [response, operation] Access the result along with the RPC operation
862
+ # @yieldparam response [Gapic::Operation]
863
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
864
+ #
865
+ # @return [Gapic::Operation]
866
+ #
867
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
868
+ #
869
+ def create_model request, options = nil
870
+ raise ArgumentError, "request must be provided" if request.nil?
871
+
872
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::CreateModelRequest
873
+
874
+ # Converts hash and nil to an options object
875
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
876
+
877
+ # Customize the options with defaults
878
+ metadata = @config.rpcs.create_model.metadata.to_h
879
+
880
+ # Set x-goog-api-client and x-goog-user-project headers
881
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
882
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
883
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
884
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
885
+
886
+ header_params = {
887
+ "parent" => request.parent
888
+ }
889
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
890
+ metadata[:"x-goog-request-params"] ||= request_params_header
891
+
892
+ options.apply_defaults timeout: @config.rpcs.create_model.timeout,
893
+ metadata: metadata,
894
+ retry_policy: @config.rpcs.create_model.retry_policy
895
+ options.apply_defaults metadata: @config.metadata,
896
+ retry_policy: @config.retry_policy
897
+
898
+ @auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
899
+ response = Gapic::Operation.new response, @operations_client, options: options
900
+ yield response, operation if block_given?
901
+ return response
902
+ end
903
+ rescue GRPC::BadStatus => e
904
+ raise Google::Cloud::Error.from_error(e)
905
+ end
906
+
907
+ ##
908
+ # Gets a model.
909
+ #
910
+ # @overload get_model(request, options = nil)
911
+ # Pass arguments to `get_model` via a request object, either of type
912
+ # {Google::Cloud::AutoML::V1::GetModelRequest} or an equivalent Hash.
913
+ #
914
+ # @param request [Google::Cloud::AutoML::V1::GetModelRequest, Hash]
915
+ # A request object representing the call parameters. Required. To specify no
916
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
917
+ # @param options [Gapic::CallOptions, Hash]
918
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
919
+ #
920
+ # @overload get_model(name: nil)
921
+ # Pass arguments to `get_model` via keyword arguments. Note that at
922
+ # least one keyword argument is required. To specify no parameters, or to keep all
923
+ # the default parameter values, pass an empty Hash as a request object (see above).
924
+ #
925
+ # @param name [String]
926
+ # Required. Resource name of the model.
927
+ #
928
+ # @yield [response, operation] Access the result along with the RPC operation
929
+ # @yieldparam response [Google::Cloud::AutoML::V1::Model]
930
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
931
+ #
932
+ # @return [Google::Cloud::AutoML::V1::Model]
933
+ #
934
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
935
+ #
936
+ def get_model request, options = nil
937
+ raise ArgumentError, "request must be provided" if request.nil?
938
+
939
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::GetModelRequest
940
+
941
+ # Converts hash and nil to an options object
942
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
943
+
944
+ # Customize the options with defaults
945
+ metadata = @config.rpcs.get_model.metadata.to_h
946
+
947
+ # Set x-goog-api-client and x-goog-user-project headers
948
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
950
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
951
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
952
+
953
+ header_params = {
954
+ "name" => request.name
955
+ }
956
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
957
+ metadata[:"x-goog-request-params"] ||= request_params_header
958
+
959
+ options.apply_defaults timeout: @config.rpcs.get_model.timeout,
960
+ metadata: metadata,
961
+ retry_policy: @config.rpcs.get_model.retry_policy
962
+ options.apply_defaults metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
966
+ yield response, operation if block_given?
967
+ return response
968
+ end
969
+ rescue GRPC::BadStatus => e
970
+ raise Google::Cloud::Error.from_error(e)
971
+ end
972
+
973
+ ##
974
+ # Lists models.
975
+ #
976
+ # @overload list_models(request, options = nil)
977
+ # Pass arguments to `list_models` via a request object, either of type
978
+ # {Google::Cloud::AutoML::V1::ListModelsRequest} or an equivalent Hash.
979
+ #
980
+ # @param request [Google::Cloud::AutoML::V1::ListModelsRequest, Hash]
981
+ # A request object representing the call parameters. Required. To specify no
982
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
983
+ # @param options [Gapic::CallOptions, Hash]
984
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
985
+ #
986
+ # @overload list_models(parent: nil, filter: nil, page_size: nil, page_token: nil)
987
+ # Pass arguments to `list_models` via keyword arguments. Note that at
988
+ # least one keyword argument is required. To specify no parameters, or to keep all
989
+ # the default parameter values, pass an empty Hash as a request object (see above).
990
+ #
991
+ # @param parent [String]
992
+ # Required. Resource name of the project, from which to list the models.
993
+ # @param filter [String]
994
+ # An expression for filtering the results of the request.
995
+ #
996
+ # * `model_metadata` - for existence of the case (e.g.
997
+ # video_classification_model_metadata:*).
998
+ # * `dataset_id` - for = or !=. Some examples of using the filter are:
999
+ #
1000
+ # * `image_classification_model_metadata:*` --> The model has
1001
+ # image_classification_model_metadata.
1002
+ # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1003
+ # @param page_size [Integer]
1004
+ # Requested page size.
1005
+ # @param page_token [String]
1006
+ # A token identifying a page of results for the server to return
1007
+ # Typically obtained via
1008
+ # {Google::Cloud::AutoML::V1::ListModelsResponse#next_page_token ListModelsResponse.next_page_token} of the previous
1009
+ # {Google::Cloud::AutoML::V1::AutoML::Client#list_models AutoMl.ListModels} call.
1010
+ #
1011
+ # @yield [response, operation] Access the result along with the RPC operation
1012
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::Model>]
1013
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1014
+ #
1015
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::Model>]
1016
+ #
1017
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1018
+ #
1019
+ def list_models request, options = nil
1020
+ raise ArgumentError, "request must be provided" if request.nil?
1021
+
1022
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ListModelsRequest
1023
+
1024
+ # Converts hash and nil to an options object
1025
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1026
+
1027
+ # Customize the options with defaults
1028
+ metadata = @config.rpcs.list_models.metadata.to_h
1029
+
1030
+ # Set x-goog-api-client and x-goog-user-project headers
1031
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1032
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1033
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1034
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1035
+
1036
+ header_params = {
1037
+ "parent" => request.parent
1038
+ }
1039
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1040
+ metadata[:"x-goog-request-params"] ||= request_params_header
1041
+
1042
+ options.apply_defaults timeout: @config.rpcs.list_models.timeout,
1043
+ metadata: metadata,
1044
+ retry_policy: @config.rpcs.list_models.retry_policy
1045
+ options.apply_defaults metadata: @config.metadata,
1046
+ retry_policy: @config.retry_policy
1047
+
1048
+ @auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
1049
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
1050
+ yield response, operation if block_given?
1051
+ return response
1052
+ end
1053
+ rescue GRPC::BadStatus => e
1054
+ raise Google::Cloud::Error.from_error(e)
1055
+ end
1056
+
1057
+ ##
1058
+ # Deletes a model.
1059
+ # Returns `google.protobuf.Empty` in the
1060
+ # {Google::Longrunning::Operation#response response} field when it completes,
1061
+ # and `delete_details` in the
1062
+ # {Google::Longrunning::Operation#metadata metadata} field.
1063
+ #
1064
+ # @overload delete_model(request, options = nil)
1065
+ # Pass arguments to `delete_model` via a request object, either of type
1066
+ # {Google::Cloud::AutoML::V1::DeleteModelRequest} or an equivalent Hash.
1067
+ #
1068
+ # @param request [Google::Cloud::AutoML::V1::DeleteModelRequest, Hash]
1069
+ # A request object representing the call parameters. Required. To specify no
1070
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1071
+ # @param options [Gapic::CallOptions, Hash]
1072
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1073
+ #
1074
+ # @overload delete_model(name: nil)
1075
+ # Pass arguments to `delete_model` via keyword arguments. Note that at
1076
+ # least one keyword argument is required. To specify no parameters, or to keep all
1077
+ # the default parameter values, pass an empty Hash as a request object (see above).
1078
+ #
1079
+ # @param name [String]
1080
+ # Required. Resource name of the model being deleted.
1081
+ #
1082
+ # @yield [response, operation] Access the result along with the RPC operation
1083
+ # @yieldparam response [Gapic::Operation]
1084
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1085
+ #
1086
+ # @return [Gapic::Operation]
1087
+ #
1088
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1089
+ #
1090
+ def delete_model request, options = nil
1091
+ raise ArgumentError, "request must be provided" if request.nil?
1092
+
1093
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::DeleteModelRequest
1094
+
1095
+ # Converts hash and nil to an options object
1096
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1097
+
1098
+ # Customize the options with defaults
1099
+ metadata = @config.rpcs.delete_model.metadata.to_h
1100
+
1101
+ # Set x-goog-api-client and x-goog-user-project headers
1102
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1103
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1104
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1105
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1106
+
1107
+ header_params = {
1108
+ "name" => request.name
1109
+ }
1110
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1111
+ metadata[:"x-goog-request-params"] ||= request_params_header
1112
+
1113
+ options.apply_defaults timeout: @config.rpcs.delete_model.timeout,
1114
+ metadata: metadata,
1115
+ retry_policy: @config.rpcs.delete_model.retry_policy
1116
+ options.apply_defaults metadata: @config.metadata,
1117
+ retry_policy: @config.retry_policy
1118
+
1119
+ @auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
1120
+ response = Gapic::Operation.new response, @operations_client, options: options
1121
+ yield response, operation if block_given?
1122
+ return response
1123
+ end
1124
+ rescue GRPC::BadStatus => e
1125
+ raise Google::Cloud::Error.from_error(e)
1126
+ end
1127
+
1128
+ ##
1129
+ # Updates a model.
1130
+ #
1131
+ # @overload update_model(request, options = nil)
1132
+ # Pass arguments to `update_model` via a request object, either of type
1133
+ # {Google::Cloud::AutoML::V1::UpdateModelRequest} or an equivalent Hash.
1134
+ #
1135
+ # @param request [Google::Cloud::AutoML::V1::UpdateModelRequest, Hash]
1136
+ # A request object representing the call parameters. Required. To specify no
1137
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1138
+ # @param options [Gapic::CallOptions, Hash]
1139
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1140
+ #
1141
+ # @overload update_model(model: nil, update_mask: nil)
1142
+ # Pass arguments to `update_model` via keyword arguments. Note that at
1143
+ # least one keyword argument is required. To specify no parameters, or to keep all
1144
+ # the default parameter values, pass an empty Hash as a request object (see above).
1145
+ #
1146
+ # @param model [Google::Cloud::AutoML::V1::Model, Hash]
1147
+ # Required. The model which replaces the resource on the server.
1148
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
1149
+ # Required. The update mask applies to the resource.
1150
+ #
1151
+ # @yield [response, operation] Access the result along with the RPC operation
1152
+ # @yieldparam response [Google::Cloud::AutoML::V1::Model]
1153
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1154
+ #
1155
+ # @return [Google::Cloud::AutoML::V1::Model]
1156
+ #
1157
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1158
+ #
1159
+ def update_model request, options = nil
1160
+ raise ArgumentError, "request must be provided" if request.nil?
1161
+
1162
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::UpdateModelRequest
1163
+
1164
+ # Converts hash and nil to an options object
1165
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1166
+
1167
+ # Customize the options with defaults
1168
+ metadata = @config.rpcs.update_model.metadata.to_h
1169
+
1170
+ # Set x-goog-api-client and x-goog-user-project headers
1171
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1172
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1173
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1174
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1175
+
1176
+ header_params = {
1177
+ "model.name" => request.model.name
1178
+ }
1179
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1180
+ metadata[:"x-goog-request-params"] ||= request_params_header
1181
+
1182
+ options.apply_defaults timeout: @config.rpcs.update_model.timeout,
1183
+ metadata: metadata,
1184
+ retry_policy: @config.rpcs.update_model.retry_policy
1185
+ options.apply_defaults metadata: @config.metadata,
1186
+ retry_policy: @config.retry_policy
1187
+
1188
+ @auto_ml_stub.call_rpc :update_model, request, options: options do |response, operation|
1189
+ yield response, operation if block_given?
1190
+ return response
1191
+ end
1192
+ rescue GRPC::BadStatus => e
1193
+ raise Google::Cloud::Error.from_error(e)
1194
+ end
1195
+
1196
+ ##
1197
+ # Deploys a model. If a model is already deployed, deploying it with the
1198
+ # same parameters has no effect. Deploying with different parametrs
1199
+ # (as e.g. changing
1200
+ #
1201
+ # [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number])
1202
+ # will reset the deployment state without pausing the model's availability.
1203
+ #
1204
+ # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage
1205
+ # deployment automatically.
1206
+ #
1207
+ # Returns an empty response in the
1208
+ # {Google::Longrunning::Operation#response response} field when it completes.
1209
+ #
1210
+ # @overload deploy_model(request, options = nil)
1211
+ # Pass arguments to `deploy_model` via a request object, either of type
1212
+ # {Google::Cloud::AutoML::V1::DeployModelRequest} or an equivalent Hash.
1213
+ #
1214
+ # @param request [Google::Cloud::AutoML::V1::DeployModelRequest, Hash]
1215
+ # A request object representing the call parameters. Required. To specify no
1216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1217
+ # @param options [Gapic::CallOptions, Hash]
1218
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1219
+ #
1220
+ # @overload deploy_model(image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, name: nil)
1221
+ # Pass arguments to `deploy_model` via keyword arguments. Note that at
1222
+ # least one keyword argument is required. To specify no parameters, or to keep all
1223
+ # the default parameter values, pass an empty Hash as a request object (see above).
1224
+ #
1225
+ # @param image_object_detection_model_deployment_metadata [Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata, Hash]
1226
+ # Model deployment metadata specific to Image Object Detection.
1227
+ # @param image_classification_model_deployment_metadata [Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata, Hash]
1228
+ # Model deployment metadata specific to Image Classification.
1229
+ # @param name [String]
1230
+ # Required. Resource name of the model to deploy.
1231
+ #
1232
+ # @yield [response, operation] Access the result along with the RPC operation
1233
+ # @yieldparam response [Gapic::Operation]
1234
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1235
+ #
1236
+ # @return [Gapic::Operation]
1237
+ #
1238
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1239
+ #
1240
+ def deploy_model request, options = nil
1241
+ raise ArgumentError, "request must be provided" if request.nil?
1242
+
1243
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::DeployModelRequest
1244
+
1245
+ # Converts hash and nil to an options object
1246
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1247
+
1248
+ # Customize the options with defaults
1249
+ metadata = @config.rpcs.deploy_model.metadata.to_h
1250
+
1251
+ # Set x-goog-api-client and x-goog-user-project headers
1252
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1253
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1254
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1255
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1256
+
1257
+ header_params = {
1258
+ "name" => request.name
1259
+ }
1260
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1261
+ metadata[:"x-goog-request-params"] ||= request_params_header
1262
+
1263
+ options.apply_defaults timeout: @config.rpcs.deploy_model.timeout,
1264
+ metadata: metadata,
1265
+ retry_policy: @config.rpcs.deploy_model.retry_policy
1266
+ options.apply_defaults metadata: @config.metadata,
1267
+ retry_policy: @config.retry_policy
1268
+
1269
+ @auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
1270
+ response = Gapic::Operation.new response, @operations_client, options: options
1271
+ yield response, operation if block_given?
1272
+ return response
1273
+ end
1274
+ rescue GRPC::BadStatus => e
1275
+ raise Google::Cloud::Error.from_error(e)
1276
+ end
1277
+
1278
+ ##
1279
+ # Undeploys a model. If the model is not deployed this method has no effect.
1280
+ #
1281
+ # Only applicable for Text Classification, Image Object Detection and Tables;
1282
+ # all other domains manage deployment automatically.
1283
+ #
1284
+ # Returns an empty response in the
1285
+ # {Google::Longrunning::Operation#response response} field when it completes.
1286
+ #
1287
+ # @overload undeploy_model(request, options = nil)
1288
+ # Pass arguments to `undeploy_model` via a request object, either of type
1289
+ # {Google::Cloud::AutoML::V1::UndeployModelRequest} or an equivalent Hash.
1290
+ #
1291
+ # @param request [Google::Cloud::AutoML::V1::UndeployModelRequest, Hash]
1292
+ # A request object representing the call parameters. Required. To specify no
1293
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1294
+ # @param options [Gapic::CallOptions, Hash]
1295
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1296
+ #
1297
+ # @overload undeploy_model(name: nil)
1298
+ # Pass arguments to `undeploy_model` via keyword arguments. Note that at
1299
+ # least one keyword argument is required. To specify no parameters, or to keep all
1300
+ # the default parameter values, pass an empty Hash as a request object (see above).
1301
+ #
1302
+ # @param name [String]
1303
+ # Required. Resource name of the model to undeploy.
1304
+ #
1305
+ # @yield [response, operation] Access the result along with the RPC operation
1306
+ # @yieldparam response [Gapic::Operation]
1307
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1308
+ #
1309
+ # @return [Gapic::Operation]
1310
+ #
1311
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1312
+ #
1313
+ def undeploy_model request, options = nil
1314
+ raise ArgumentError, "request must be provided" if request.nil?
1315
+
1316
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::UndeployModelRequest
1317
+
1318
+ # Converts hash and nil to an options object
1319
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1320
+
1321
+ # Customize the options with defaults
1322
+ metadata = @config.rpcs.undeploy_model.metadata.to_h
1323
+
1324
+ # Set x-goog-api-client and x-goog-user-project headers
1325
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1326
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1327
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1328
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1329
+
1330
+ header_params = {
1331
+ "name" => request.name
1332
+ }
1333
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1334
+ metadata[:"x-goog-request-params"] ||= request_params_header
1335
+
1336
+ options.apply_defaults timeout: @config.rpcs.undeploy_model.timeout,
1337
+ metadata: metadata,
1338
+ retry_policy: @config.rpcs.undeploy_model.retry_policy
1339
+ options.apply_defaults metadata: @config.metadata,
1340
+ retry_policy: @config.retry_policy
1341
+
1342
+ @auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
1343
+ response = Gapic::Operation.new response, @operations_client, options: options
1344
+ yield response, operation if block_given?
1345
+ return response
1346
+ end
1347
+ rescue GRPC::BadStatus => e
1348
+ raise Google::Cloud::Error.from_error(e)
1349
+ end
1350
+
1351
+ ##
1352
+ # Exports a trained, "export-able", model to a user specified Google Cloud
1353
+ # Storage location. A model is considered export-able if and only if it has
1354
+ # an export format defined for it in
1355
+ # {Google::Cloud::AutoML::V1::ModelExportOutputConfig ModelExportOutputConfig}.
1356
+ #
1357
+ # Returns an empty response in the
1358
+ # {Google::Longrunning::Operation#response response} field when it completes.
1359
+ #
1360
+ # @overload export_model(request, options = nil)
1361
+ # Pass arguments to `export_model` via a request object, either of type
1362
+ # {Google::Cloud::AutoML::V1::ExportModelRequest} or an equivalent Hash.
1363
+ #
1364
+ # @param request [Google::Cloud::AutoML::V1::ExportModelRequest, Hash]
1365
+ # A request object representing the call parameters. Required. To specify no
1366
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1367
+ # @param options [Gapic::CallOptions, Hash]
1368
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1369
+ #
1370
+ # @overload export_model(name: nil, output_config: nil)
1371
+ # Pass arguments to `export_model` via keyword arguments. Note that at
1372
+ # least one keyword argument is required. To specify no parameters, or to keep all
1373
+ # the default parameter values, pass an empty Hash as a request object (see above).
1374
+ #
1375
+ # @param name [String]
1376
+ # Required. The resource name of the model to export.
1377
+ # @param output_config [Google::Cloud::AutoML::V1::ModelExportOutputConfig, Hash]
1378
+ # Required. The desired output location and configuration.
1379
+ #
1380
+ # @yield [response, operation] Access the result along with the RPC operation
1381
+ # @yieldparam response [Gapic::Operation]
1382
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1383
+ #
1384
+ # @return [Gapic::Operation]
1385
+ #
1386
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1387
+ #
1388
+ def export_model request, options = nil
1389
+ raise ArgumentError, "request must be provided" if request.nil?
1390
+
1391
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ExportModelRequest
1392
+
1393
+ # Converts hash and nil to an options object
1394
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1395
+
1396
+ # Customize the options with defaults
1397
+ metadata = @config.rpcs.export_model.metadata.to_h
1398
+
1399
+ # Set x-goog-api-client and x-goog-user-project headers
1400
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1402
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1403
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1404
+
1405
+ header_params = {
1406
+ "name" => request.name
1407
+ }
1408
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1409
+ metadata[:"x-goog-request-params"] ||= request_params_header
1410
+
1411
+ options.apply_defaults timeout: @config.rpcs.export_model.timeout,
1412
+ metadata: metadata,
1413
+ retry_policy: @config.rpcs.export_model.retry_policy
1414
+ options.apply_defaults metadata: @config.metadata,
1415
+ retry_policy: @config.retry_policy
1416
+
1417
+ @auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
1418
+ response = Gapic::Operation.new response, @operations_client, options: options
1419
+ yield response, operation if block_given?
1420
+ return response
1421
+ end
1422
+ rescue GRPC::BadStatus => e
1423
+ raise Google::Cloud::Error.from_error(e)
1424
+ end
1425
+
1426
+ ##
1427
+ # Gets a model evaluation.
1428
+ #
1429
+ # @overload get_model_evaluation(request, options = nil)
1430
+ # Pass arguments to `get_model_evaluation` via a request object, either of type
1431
+ # {Google::Cloud::AutoML::V1::GetModelEvaluationRequest} or an equivalent Hash.
1432
+ #
1433
+ # @param request [Google::Cloud::AutoML::V1::GetModelEvaluationRequest, Hash]
1434
+ # A request object representing the call parameters. Required. To specify no
1435
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1436
+ # @param options [Gapic::CallOptions, Hash]
1437
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1438
+ #
1439
+ # @overload get_model_evaluation(name: nil)
1440
+ # Pass arguments to `get_model_evaluation` via keyword arguments. Note that at
1441
+ # least one keyword argument is required. To specify no parameters, or to keep all
1442
+ # the default parameter values, pass an empty Hash as a request object (see above).
1443
+ #
1444
+ # @param name [String]
1445
+ # Required. Resource name for the model evaluation.
1446
+ #
1447
+ # @yield [response, operation] Access the result along with the RPC operation
1448
+ # @yieldparam response [Google::Cloud::AutoML::V1::ModelEvaluation]
1449
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1450
+ #
1451
+ # @return [Google::Cloud::AutoML::V1::ModelEvaluation]
1452
+ #
1453
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1454
+ #
1455
+ def get_model_evaluation request, options = nil
1456
+ raise ArgumentError, "request must be provided" if request.nil?
1457
+
1458
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::GetModelEvaluationRequest
1459
+
1460
+ # Converts hash and nil to an options object
1461
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1462
+
1463
+ # Customize the options with defaults
1464
+ metadata = @config.rpcs.get_model_evaluation.metadata.to_h
1465
+
1466
+ # Set x-goog-api-client and x-goog-user-project headers
1467
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1468
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1469
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1470
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1471
+
1472
+ header_params = {
1473
+ "name" => request.name
1474
+ }
1475
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1476
+ metadata[:"x-goog-request-params"] ||= request_params_header
1477
+
1478
+ options.apply_defaults timeout: @config.rpcs.get_model_evaluation.timeout,
1479
+ metadata: metadata,
1480
+ retry_policy: @config.rpcs.get_model_evaluation.retry_policy
1481
+ options.apply_defaults metadata: @config.metadata,
1482
+ retry_policy: @config.retry_policy
1483
+
1484
+ @auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
1485
+ yield response, operation if block_given?
1486
+ return response
1487
+ end
1488
+ rescue GRPC::BadStatus => e
1489
+ raise Google::Cloud::Error.from_error(e)
1490
+ end
1491
+
1492
+ ##
1493
+ # Lists model evaluations.
1494
+ #
1495
+ # @overload list_model_evaluations(request, options = nil)
1496
+ # Pass arguments to `list_model_evaluations` via a request object, either of type
1497
+ # {Google::Cloud::AutoML::V1::ListModelEvaluationsRequest} or an equivalent Hash.
1498
+ #
1499
+ # @param request [Google::Cloud::AutoML::V1::ListModelEvaluationsRequest, Hash]
1500
+ # A request object representing the call parameters. Required. To specify no
1501
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1502
+ # @param options [Gapic::CallOptions, Hash]
1503
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1504
+ #
1505
+ # @overload list_model_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil)
1506
+ # Pass arguments to `list_model_evaluations` via keyword arguments. Note that at
1507
+ # least one keyword argument is required. To specify no parameters, or to keep all
1508
+ # the default parameter values, pass an empty Hash as a request object (see above).
1509
+ #
1510
+ # @param parent [String]
1511
+ # Required. Resource name of the model to list the model evaluations for.
1512
+ # If modelId is set as "-", this will list model evaluations from across all
1513
+ # models of the parent location.
1514
+ # @param filter [String]
1515
+ # Required. An expression for filtering the results of the request.
1516
+ #
1517
+ # * `annotation_spec_id` - for =, != or existence. See example below for
1518
+ # the last.
1519
+ #
1520
+ # Some examples of using the filter are:
1521
+ #
1522
+ # * `annotation_spec_id!=4` --> The model evaluation was done for
1523
+ # annotation spec with ID different than 4.
1524
+ # * `NOT annotation_spec_id:*` --> The model evaluation was done for
1525
+ # aggregate of all annotation specs.
1526
+ # @param page_size [Integer]
1527
+ # Requested page size.
1528
+ # @param page_token [String]
1529
+ # A token identifying a page of results for the server to return.
1530
+ # Typically obtained via
1531
+ # {Google::Cloud::AutoML::V1::ListModelEvaluationsResponse#next_page_token ListModelEvaluationsResponse.next_page_token} of the previous
1532
+ # {Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations AutoMl.ListModelEvaluations} call.
1533
+ #
1534
+ # @yield [response, operation] Access the result along with the RPC operation
1535
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::ModelEvaluation>]
1536
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1537
+ #
1538
+ # @return [Gapic::PagedEnumerable<Google::Cloud::AutoML::V1::ModelEvaluation>]
1539
+ #
1540
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
1541
+ #
1542
+ def list_model_evaluations request, options = nil
1543
+ raise ArgumentError, "request must be provided" if request.nil?
1544
+
1545
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1::ListModelEvaluationsRequest
1546
+
1547
+ # Converts hash and nil to an options object
1548
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1549
+
1550
+ # Customize the options with defaults
1551
+ metadata = @config.rpcs.list_model_evaluations.metadata.to_h
1552
+
1553
+ # Set x-goog-api-client and x-goog-user-project headers
1554
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
1555
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1556
+ gapic_version: ::Google::Cloud::Automl::V1::VERSION
1557
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1558
+
1559
+ header_params = {
1560
+ "parent" => request.parent
1561
+ }
1562
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1563
+ metadata[:"x-goog-request-params"] ||= request_params_header
1564
+
1565
+ options.apply_defaults timeout: @config.rpcs.list_model_evaluations.timeout,
1566
+ metadata: metadata,
1567
+ retry_policy: @config.rpcs.list_model_evaluations.retry_policy
1568
+ options.apply_defaults metadata: @config.metadata,
1569
+ retry_policy: @config.retry_policy
1570
+
1571
+ @auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
1572
+ response = Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
1573
+ yield response, operation if block_given?
1574
+ return response
1575
+ end
1576
+ rescue GRPC::BadStatus => e
1577
+ raise Google::Cloud::Error.from_error(e)
1578
+ end
1579
+
1580
+ ##
1581
+ # Configuration class for the AutoMl API.
1582
+ #
1583
+ # This class represents the configuration for AutoMl,
1584
+ # providing control over timeouts, retry behavior, logging, transport
1585
+ # parameters, and other low-level controls. Certain parameters can also be
1586
+ # applied individually to specific RPCs. See
1587
+ # {Google::Cloud::AutoML::V1::AutoML::Client::Configuration::Rpcs}
1588
+ # for a list of RPCs that can be configured independently.
1589
+ #
1590
+ # Configuration can be applied globally to all clients, or to a single client
1591
+ # on construction.
1592
+ #
1593
+ # # Examples
1594
+ #
1595
+ # To modify the global config, setting the timeout for create_dataset
1596
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1597
+ #
1598
+ # Google::Cloud::AutoML::V1::AutoML::Client.configure do |config|
1599
+ # config.timeout = 10_000
1600
+ # config.rpcs.create_dataset.timeout = 20_000
1601
+ # end
1602
+ #
1603
+ # To apply the above configuration only to a new client:
1604
+ #
1605
+ # client = Google::Cloud::AutoML::V1::AutoML::Client.new do |config|
1606
+ # config.timeout = 10_000
1607
+ # config.rpcs.create_dataset.timeout = 20_000
1608
+ # end
1609
+ #
1610
+ # @!attribute [rw] endpoint
1611
+ # The hostname or hostname:port of the service endpoint.
1612
+ # Defaults to `"automl.googleapis.com"`.
1613
+ # @return [String]
1614
+ # @!attribute [rw] credentials
1615
+ # Credentials to send with calls. You may provide any of the following types:
1616
+ # * (`String`) The path to a service account key file in JSON format
1617
+ # * (`Hash`) A service account key as a Hash
1618
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1619
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1620
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1621
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1622
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1623
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1624
+ # * (`nil`) indicating no credentials
1625
+ # @return [Object]
1626
+ # @!attribute [rw] scope
1627
+ # The OAuth scopes
1628
+ # @return [Array<String>]
1629
+ # @!attribute [rw] lib_name
1630
+ # The library name as recorded in instrumentation and logging
1631
+ # @return [String]
1632
+ # @!attribute [rw] lib_version
1633
+ # The library version as recorded in instrumentation and logging
1634
+ # @return [String]
1635
+ # @!attribute [rw] channel_args
1636
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1637
+ # `GRPC::Core::Channel` object is provided as the credential.
1638
+ # @return [Hash]
1639
+ # @!attribute [rw] interceptors
1640
+ # An array of interceptors that are run before calls are executed.
1641
+ # @return [Array<GRPC::ClientInterceptor>]
1642
+ # @!attribute [rw] timeout
1643
+ # The call timeout in milliseconds.
1644
+ # @return [Numeric]
1645
+ # @!attribute [rw] metadata
1646
+ # Additional gRPC headers to be sent with the call.
1647
+ # @return [Hash{Symbol=>String}]
1648
+ # @!attribute [rw] retry_policy
1649
+ # The retry policy. The value is a hash with the following keys:
1650
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1651
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1652
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1653
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1654
+ # trigger a retry.
1655
+ # @return [Hash]
1656
+ #
1657
+ class Configuration
1658
+ extend Gapic::Config
1659
+
1660
+ config_attr :endpoint, "automl.googleapis.com", String
1661
+ config_attr :credentials, nil do |value|
1662
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1663
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1664
+ allowed.any? { |klass| klass === value }
1665
+ end
1666
+ config_attr :scope, nil, String, Array, nil
1667
+ config_attr :lib_name, nil, String, nil
1668
+ config_attr :lib_version, nil, String, nil
1669
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
1670
+ config_attr :interceptors, nil, Array, nil
1671
+ config_attr :timeout, nil, Numeric, nil
1672
+ config_attr :metadata, nil, Hash, nil
1673
+ config_attr :retry_policy, nil, Hash, Proc, nil
1674
+
1675
+ # @private
1676
+ def initialize parent_config = nil
1677
+ @parent_config = parent_config unless parent_config.nil?
1678
+
1679
+ yield self if block_given?
1680
+ end
1681
+
1682
+ ##
1683
+ # Configurations for individual RPCs
1684
+ # @return [Rpcs]
1685
+ #
1686
+ def rpcs
1687
+ @rpcs ||= begin
1688
+ parent_rpcs = nil
1689
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1690
+ Rpcs.new parent_rpcs
1691
+ end
1692
+ end
1693
+
1694
+ ##
1695
+ # Configuration RPC class for the AutoMl API.
1696
+ #
1697
+ # Includes fields providing the configuration for each RPC in this service.
1698
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1699
+ # the following configuration fields:
1700
+ #
1701
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1702
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1703
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1704
+ # include the following keys:
1705
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1706
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1707
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1708
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1709
+ # trigger a retry.
1710
+ #
1711
+ class Rpcs
1712
+ ##
1713
+ # RPC-specific configuration for `create_dataset`
1714
+ # @return [Gapic::Config::Method]
1715
+ #
1716
+ attr_reader :create_dataset
1717
+ ##
1718
+ # RPC-specific configuration for `get_dataset`
1719
+ # @return [Gapic::Config::Method]
1720
+ #
1721
+ attr_reader :get_dataset
1722
+ ##
1723
+ # RPC-specific configuration for `list_datasets`
1724
+ # @return [Gapic::Config::Method]
1725
+ #
1726
+ attr_reader :list_datasets
1727
+ ##
1728
+ # RPC-specific configuration for `update_dataset`
1729
+ # @return [Gapic::Config::Method]
1730
+ #
1731
+ attr_reader :update_dataset
1732
+ ##
1733
+ # RPC-specific configuration for `delete_dataset`
1734
+ # @return [Gapic::Config::Method]
1735
+ #
1736
+ attr_reader :delete_dataset
1737
+ ##
1738
+ # RPC-specific configuration for `import_data`
1739
+ # @return [Gapic::Config::Method]
1740
+ #
1741
+ attr_reader :import_data
1742
+ ##
1743
+ # RPC-specific configuration for `export_data`
1744
+ # @return [Gapic::Config::Method]
1745
+ #
1746
+ attr_reader :export_data
1747
+ ##
1748
+ # RPC-specific configuration for `get_annotation_spec`
1749
+ # @return [Gapic::Config::Method]
1750
+ #
1751
+ attr_reader :get_annotation_spec
1752
+ ##
1753
+ # RPC-specific configuration for `create_model`
1754
+ # @return [Gapic::Config::Method]
1755
+ #
1756
+ attr_reader :create_model
1757
+ ##
1758
+ # RPC-specific configuration for `get_model`
1759
+ # @return [Gapic::Config::Method]
1760
+ #
1761
+ attr_reader :get_model
1762
+ ##
1763
+ # RPC-specific configuration for `list_models`
1764
+ # @return [Gapic::Config::Method]
1765
+ #
1766
+ attr_reader :list_models
1767
+ ##
1768
+ # RPC-specific configuration for `delete_model`
1769
+ # @return [Gapic::Config::Method]
1770
+ #
1771
+ attr_reader :delete_model
1772
+ ##
1773
+ # RPC-specific configuration for `update_model`
1774
+ # @return [Gapic::Config::Method]
1775
+ #
1776
+ attr_reader :update_model
1777
+ ##
1778
+ # RPC-specific configuration for `deploy_model`
1779
+ # @return [Gapic::Config::Method]
1780
+ #
1781
+ attr_reader :deploy_model
1782
+ ##
1783
+ # RPC-specific configuration for `undeploy_model`
1784
+ # @return [Gapic::Config::Method]
1785
+ #
1786
+ attr_reader :undeploy_model
1787
+ ##
1788
+ # RPC-specific configuration for `export_model`
1789
+ # @return [Gapic::Config::Method]
1790
+ #
1791
+ attr_reader :export_model
1792
+ ##
1793
+ # RPC-specific configuration for `get_model_evaluation`
1794
+ # @return [Gapic::Config::Method]
1795
+ #
1796
+ attr_reader :get_model_evaluation
1797
+ ##
1798
+ # RPC-specific configuration for `list_model_evaluations`
1799
+ # @return [Gapic::Config::Method]
1800
+ #
1801
+ attr_reader :list_model_evaluations
1802
+
1803
+ # @private
1804
+ def initialize parent_rpcs = nil
1805
+ create_dataset_config = parent_rpcs&.create_dataset if parent_rpcs&.respond_to? :create_dataset
1806
+ @create_dataset = Gapic::Config::Method.new create_dataset_config
1807
+ get_dataset_config = parent_rpcs&.get_dataset if parent_rpcs&.respond_to? :get_dataset
1808
+ @get_dataset = Gapic::Config::Method.new get_dataset_config
1809
+ list_datasets_config = parent_rpcs&.list_datasets if parent_rpcs&.respond_to? :list_datasets
1810
+ @list_datasets = Gapic::Config::Method.new list_datasets_config
1811
+ update_dataset_config = parent_rpcs&.update_dataset if parent_rpcs&.respond_to? :update_dataset
1812
+ @update_dataset = Gapic::Config::Method.new update_dataset_config
1813
+ delete_dataset_config = parent_rpcs&.delete_dataset if parent_rpcs&.respond_to? :delete_dataset
1814
+ @delete_dataset = Gapic::Config::Method.new delete_dataset_config
1815
+ import_data_config = parent_rpcs&.import_data if parent_rpcs&.respond_to? :import_data
1816
+ @import_data = Gapic::Config::Method.new import_data_config
1817
+ export_data_config = parent_rpcs&.export_data if parent_rpcs&.respond_to? :export_data
1818
+ @export_data = Gapic::Config::Method.new export_data_config
1819
+ get_annotation_spec_config = parent_rpcs&.get_annotation_spec if parent_rpcs&.respond_to? :get_annotation_spec
1820
+ @get_annotation_spec = Gapic::Config::Method.new get_annotation_spec_config
1821
+ create_model_config = parent_rpcs&.create_model if parent_rpcs&.respond_to? :create_model
1822
+ @create_model = Gapic::Config::Method.new create_model_config
1823
+ get_model_config = parent_rpcs&.get_model if parent_rpcs&.respond_to? :get_model
1824
+ @get_model = Gapic::Config::Method.new get_model_config
1825
+ list_models_config = parent_rpcs&.list_models if parent_rpcs&.respond_to? :list_models
1826
+ @list_models = Gapic::Config::Method.new list_models_config
1827
+ delete_model_config = parent_rpcs&.delete_model if parent_rpcs&.respond_to? :delete_model
1828
+ @delete_model = Gapic::Config::Method.new delete_model_config
1829
+ update_model_config = parent_rpcs&.update_model if parent_rpcs&.respond_to? :update_model
1830
+ @update_model = Gapic::Config::Method.new update_model_config
1831
+ deploy_model_config = parent_rpcs&.deploy_model if parent_rpcs&.respond_to? :deploy_model
1832
+ @deploy_model = Gapic::Config::Method.new deploy_model_config
1833
+ undeploy_model_config = parent_rpcs&.undeploy_model if parent_rpcs&.respond_to? :undeploy_model
1834
+ @undeploy_model = Gapic::Config::Method.new undeploy_model_config
1835
+ export_model_config = parent_rpcs&.export_model if parent_rpcs&.respond_to? :export_model
1836
+ @export_model = Gapic::Config::Method.new export_model_config
1837
+ get_model_evaluation_config = parent_rpcs&.get_model_evaluation if parent_rpcs&.respond_to? :get_model_evaluation
1838
+ @get_model_evaluation = Gapic::Config::Method.new get_model_evaluation_config
1839
+ list_model_evaluations_config = parent_rpcs&.list_model_evaluations if parent_rpcs&.respond_to? :list_model_evaluations
1840
+ @list_model_evaluations = Gapic::Config::Method.new list_model_evaluations_config
1841
+
1842
+ yield self if block_given?
1843
+ end
1844
+ end
1845
+ end
1846
+ end
1847
+ end
1848
+ end
1849
+ end
1850
+ end
1851
+ end