google-cloud-automl 0.6.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +324 -0
  6. data/README.md +95 -25
  7. data/lib/google-cloud-automl.rb +6 -2
  8. data/lib/google/cloud/automl.rb +132 -190
  9. data/lib/google/cloud/automl/version.rb +6 -2
  10. metadata +74 -110
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/automl/v1beta1.rb +0 -231
  13. data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +0 -34
  14. data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +0 -19
  15. data/lib/google/cloud/automl/v1beta1/automl_client.rb +0 -1906
  16. data/lib/google/cloud/automl/v1beta1/automl_client_config.json +0 -146
  17. data/lib/google/cloud/automl/v1beta1/automl_client_helpers.rb +0 -109
  18. data/lib/google/cloud/automl/v1beta1/classification_pb.rb +0 -66
  19. data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +0 -29
  20. data/lib/google/cloud/automl/v1beta1/credentials.rb +0 -41
  21. data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +0 -88
  22. data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +0 -77
  23. data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +0 -36
  24. data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +0 -39
  25. data/lib/google/cloud/automl/v1beta1/detection_pb.rb +0 -52
  26. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_payload.rb +0 -63
  27. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_spec.rb +0 -39
  28. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/classification.rb +0 -212
  29. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/column_spec.rb +0 -67
  30. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb +0 -202
  31. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_stats.rb +0 -160
  32. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_types.rb +0 -99
  33. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/dataset.rb +0 -77
  34. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/detection.rb +0 -130
  35. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/geometry.rb +0 -43
  36. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/image.rb +0 -183
  37. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/io.rb +0 -1110
  38. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model.rb +0 -88
  39. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model_evaluation.rb +0 -96
  40. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/prediction_service.rb +0 -186
  41. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/ranges.rb +0 -31
  42. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/regression.rb +0 -41
  43. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/service.rb +0 -356
  44. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/table_spec.rb +0 -68
  45. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/tables.rb +0 -275
  46. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/temporal.rb +0 -33
  47. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text.rb +0 -54
  48. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_extraction.rb +0 -60
  49. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_segment.rb +0 -37
  50. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_sentiment.rb +0 -76
  51. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/translation.rb +0 -63
  52. data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/video.rb +0 -35
  53. data/lib/google/cloud/automl/v1beta1/doc/google/longrunning/operations.rb +0 -51
  54. data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/any.rb +0 -131
  55. data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/duration.rb +0 -91
  56. data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/field_mask.rb +0 -222
  57. data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/struct.rb +0 -74
  58. data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
  59. data/lib/google/cloud/automl/v1beta1/doc/google/rpc/status.rb +0 -39
  60. data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +0 -21
  61. data/lib/google/cloud/automl/v1beta1/image_pb.rb +0 -50
  62. data/lib/google/cloud/automl/v1beta1/io_pb.rb +0 -80
  63. data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +0 -38
  64. data/lib/google/cloud/automl/v1beta1/model_pb.rb +0 -45
  65. data/lib/google/cloud/automl/v1beta1/operations_pb.rb +0 -90
  66. data/lib/google/cloud/automl/v1beta1/prediction_service_client.rb +0 -477
  67. data/lib/google/cloud/automl/v1beta1/prediction_service_client_config.json +0 -36
  68. data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +0 -43
  69. data/lib/google/cloud/automl/v1beta1/prediction_service_services_pb.rb +0 -74
  70. data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +0 -17
  71. data/lib/google/cloud/automl/v1beta1/regression_pb.rb +0 -20
  72. data/lib/google/cloud/automl/v1beta1/service_pb.rb +0 -180
  73. data/lib/google/cloud/automl/v1beta1/service_services_pb.rb +0 -158
  74. data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +0 -24
  75. data/lib/google/cloud/automl/v1beta1/tables_pb.rb +0 -58
  76. data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +0 -18
  77. data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +0 -32
  78. data/lib/google/cloud/automl/v1beta1/text_pb.rb +0 -34
  79. data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +0 -18
  80. data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +0 -29
  81. data/lib/google/cloud/automl/v1beta1/translation_pb.rb +0 -34
  82. data/lib/google/cloud/automl/v1beta1/video_pb.rb +0 -25
@@ -1,231 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/automl/v1beta1/automl_client"
17
- require "google/cloud/automl/v1beta1/prediction_service_client"
18
- require "google/cloud/automl/v1beta1/prediction_service_pb"
19
- require "google/cloud/automl/v1beta1/operations_pb"
20
-
21
- module Google
22
- module Cloud
23
- module AutoML
24
- # rubocop:disable LineLength
25
-
26
- ##
27
- # # Ruby Client for Cloud AutoML API
28
- #
29
- # [Cloud AutoML API][Product Documentation]:
30
- # Train high-quality custom machine learning models with minimum effort and
31
- # machine learning expertise.
32
- # - [Product Documentation][]
33
- #
34
- # ## Quick Start
35
- # In order to use this library, you first need to go through the following
36
- # steps:
37
- #
38
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
39
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
40
- # 3. [Enable the Cloud AutoML API.](https://console.cloud.google.com/apis/library/automl.googleapis.com)
41
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-automl/latest/file.AUTHENTICATION.html)
42
- #
43
- # ### Installation
44
- # ```
45
- # $ gem install google-cloud-automl
46
- # ```
47
- #
48
- # ### Next Steps
49
- # - Read the [Cloud AutoML API Product documentation][Product Documentation]
50
- # to learn more about the product and see How-to Guides.
51
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
52
- # to see the full list of Cloud APIs that we cover.
53
- #
54
- # [Product Documentation]: https://cloud.google.com/automl
55
- #
56
- # ## Enabling Logging
57
- #
58
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
59
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
60
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
61
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
62
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
63
- #
64
- # Configuring a Ruby stdlib logger:
65
- #
66
- # ```ruby
67
- # require "logger"
68
- #
69
- # module MyLogger
70
- # LOGGER = Logger.new $stderr, level: Logger::WARN
71
- # def logger
72
- # LOGGER
73
- # end
74
- # end
75
- #
76
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
77
- # module GRPC
78
- # extend MyLogger
79
- # end
80
- # ```
81
- #
82
- module V1beta1
83
- # rubocop:enable LineLength
84
-
85
- module AutoML
86
- ##
87
- # AutoML Server API.
88
- #
89
- # The resource names are assigned by the server.
90
- # The server never reuses names that it has created after the resources with
91
- # those names are deleted.
92
- #
93
- # An ID of a resource is the last element of the item's resource name. For
94
- # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
95
- # the id for the item is `{dataset_id}`.
96
- #
97
- # Currently the only supported `location_id` is "us-central1".
98
- #
99
- # On any input that is documented to expect a string parameter in
100
- # snake_case or kebab-case, either of those cases is accepted.
101
- #
102
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
103
- # Provides the means for authenticating requests made by the client. This parameter can
104
- # be many types.
105
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
106
- # authenticating requests made by this client.
107
- # A `String` will be treated as the path to the keyfile to be used for the construction of
108
- # credentials for this client.
109
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
110
- # credentials for this client.
111
- # A `GRPC::Core::Channel` will be used to make calls through.
112
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
113
- # should already be composed with a `GRPC::Core::CallCredentials` object.
114
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
115
- # metadata for requests, generally, to give OAuth credentials.
116
- # @param scopes [Array<String>]
117
- # The OAuth scopes for this service. This parameter is ignored if
118
- # an updater_proc is supplied.
119
- # @param client_config [Hash]
120
- # A Hash for call options for each method. See
121
- # Google::Gax#construct_settings for the structure of
122
- # this data. Falls back to the default config if not specified
123
- # or the specified config is missing data points.
124
- # @param timeout [Numeric]
125
- # The default timeout, in seconds, for calls made through this client.
126
- # @param metadata [Hash]
127
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
128
- # @param service_address [String]
129
- # Override for the service hostname, or `nil` to leave as the default.
130
- # @param service_port [Integer]
131
- # Override for the service port, or `nil` to leave as the default.
132
- # @param exception_transformer [Proc]
133
- # An optional proc that intercepts any exceptions raised during an API call to inject
134
- # custom error handling.
135
- def self.new \
136
- credentials: nil,
137
- scopes: nil,
138
- client_config: nil,
139
- timeout: nil,
140
- metadata: nil,
141
- service_address: nil,
142
- service_port: nil,
143
- exception_transformer: nil,
144
- lib_name: nil,
145
- lib_version: nil
146
- kwargs = {
147
- credentials: credentials,
148
- scopes: scopes,
149
- client_config: client_config,
150
- timeout: timeout,
151
- metadata: metadata,
152
- exception_transformer: exception_transformer,
153
- lib_name: lib_name,
154
- service_address: service_address,
155
- service_port: service_port,
156
- lib_version: lib_version
157
- }.select { |_, v| v != nil }
158
- Google::Cloud::AutoML::V1beta1::AutoMLClient.new(**kwargs)
159
- end
160
- end
161
-
162
- module Prediction
163
- ##
164
- # AutoML Prediction API.
165
- #
166
- # On any input that is documented to expect a string parameter in
167
- # snake_case or kebab-case, either of those cases is accepted.
168
- #
169
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
170
- # Provides the means for authenticating requests made by the client. This parameter can
171
- # be many types.
172
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
173
- # authenticating requests made by this client.
174
- # A `String` will be treated as the path to the keyfile to be used for the construction of
175
- # credentials for this client.
176
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
177
- # credentials for this client.
178
- # A `GRPC::Core::Channel` will be used to make calls through.
179
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
180
- # should already be composed with a `GRPC::Core::CallCredentials` object.
181
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
182
- # metadata for requests, generally, to give OAuth credentials.
183
- # @param scopes [Array<String>]
184
- # The OAuth scopes for this service. This parameter is ignored if
185
- # an updater_proc is supplied.
186
- # @param client_config [Hash]
187
- # A Hash for call options for each method. See
188
- # Google::Gax#construct_settings for the structure of
189
- # this data. Falls back to the default config if not specified
190
- # or the specified config is missing data points.
191
- # @param timeout [Numeric]
192
- # The default timeout, in seconds, for calls made through this client.
193
- # @param metadata [Hash]
194
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
195
- # @param service_address [String]
196
- # Override for the service hostname, or `nil` to leave as the default.
197
- # @param service_port [Integer]
198
- # Override for the service port, or `nil` to leave as the default.
199
- # @param exception_transformer [Proc]
200
- # An optional proc that intercepts any exceptions raised during an API call to inject
201
- # custom error handling.
202
- def self.new \
203
- credentials: nil,
204
- scopes: nil,
205
- client_config: nil,
206
- timeout: nil,
207
- metadata: nil,
208
- service_address: nil,
209
- service_port: nil,
210
- exception_transformer: nil,
211
- lib_name: nil,
212
- lib_version: nil
213
- kwargs = {
214
- credentials: credentials,
215
- scopes: scopes,
216
- client_config: client_config,
217
- timeout: timeout,
218
- metadata: metadata,
219
- exception_transformer: exception_transformer,
220
- lib_name: lib_name,
221
- service_address: service_address,
222
- service_port: service_port,
223
- lib_version: lib_version
224
- }.select { |_, v| v != nil }
225
- Google::Cloud::AutoML::V1beta1::PredictionServiceClient.new(**kwargs)
226
- end
227
- end
228
- end
229
- end
230
- end
231
- end
@@ -1,34 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/automl/v1beta1/annotation_payload.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/cloud/automl/v1beta1/classification_pb'
8
- require 'google/cloud/automl/v1beta1/detection_pb'
9
- require 'google/cloud/automl/v1beta1/tables_pb'
10
- require 'google/cloud/automl/v1beta1/text_extraction_pb'
11
- require 'google/cloud/automl/v1beta1/text_sentiment_pb'
12
- require 'google/cloud/automl/v1beta1/translation_pb'
13
- require 'google/protobuf/any_pb'
14
- require 'google/api/annotations_pb'
15
- Google::Protobuf::DescriptorPool.generated_pool.build 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
-
32
- module Google::Cloud::AutoML::V1beta1
33
- AnnotationPayload = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.AnnotationPayload").msgclass
34
- end
@@ -1,19 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/automl/v1beta1/annotation_spec.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/resource_pb'
8
- require 'google/api/annotations_pb'
9
- Google::Protobuf::DescriptorPool.generated_pool.build 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
-
17
- module Google::Cloud::AutoML::V1beta1
18
- AnnotationSpec = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.AnnotationSpec").msgclass
19
- end
@@ -1,1906 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1beta1/service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
- require "google/gax/operation"
28
- require "google/longrunning/operations_client"
29
-
30
- require "google/cloud/automl/v1beta1/service_pb"
31
- require "google/cloud/automl/v1beta1/credentials"
32
- require "google/cloud/automl/version"
33
- require "google/cloud/automl/v1beta1/automl_client_helpers"
34
-
35
- module Google
36
- module Cloud
37
- module AutoML
38
- module V1beta1
39
- # AutoML Server API.
40
- #
41
- # The resource names are assigned by the server.
42
- # The server never reuses names that it has created after the resources with
43
- # those names are deleted.
44
- #
45
- # An ID of a resource is the last element of the item's resource name. For
46
- # `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then
47
- # the id for the item is `{dataset_id}`.
48
- #
49
- # Currently the only supported `location_id` is "us-central1".
50
- #
51
- # On any input that is documented to expect a string parameter in
52
- # snake_case or kebab-case, either of those cases is accepted.
53
- #
54
- # @!attribute [r] automl_stub
55
- # @return [Google::Cloud::AutoML::V1beta1::AutoML::Stub]
56
- class AutoMLClient
57
- # @private
58
- attr_reader :automl_stub
59
-
60
- # The default address of the service.
61
- SERVICE_ADDRESS = "automl.googleapis.com".freeze
62
-
63
- # The default port of the service.
64
- DEFAULT_SERVICE_PORT = 443
65
-
66
- # The default set of gRPC interceptors.
67
- GRPC_INTERCEPTORS = []
68
-
69
- DEFAULT_TIMEOUT = 30
70
-
71
- PAGE_DESCRIPTORS = {
72
- "list_datasets" => Google::Gax::PageDescriptor.new(
73
- "page_token",
74
- "next_page_token",
75
- "datasets"),
76
- "list_models" => Google::Gax::PageDescriptor.new(
77
- "page_token",
78
- "next_page_token",
79
- "model"),
80
- "list_model_evaluations" => Google::Gax::PageDescriptor.new(
81
- "page_token",
82
- "next_page_token",
83
- "model_evaluation"),
84
- "list_table_specs" => Google::Gax::PageDescriptor.new(
85
- "page_token",
86
- "next_page_token",
87
- "table_specs"),
88
- "list_column_specs" => Google::Gax::PageDescriptor.new(
89
- "page_token",
90
- "next_page_token",
91
- "column_specs")
92
- }.freeze
93
-
94
- private_constant :PAGE_DESCRIPTORS
95
-
96
- # The scopes needed to make gRPC calls to all of the methods defined in
97
- # this service.
98
- ALL_SCOPES = [
99
- "https://www.googleapis.com/auth/cloud-platform"
100
- ].freeze
101
-
102
- class OperationsClient < Google::Longrunning::OperationsClient
103
- self::SERVICE_ADDRESS = AutoMLClient::SERVICE_ADDRESS
104
- self::GRPC_INTERCEPTORS = AutoMLClient::GRPC_INTERCEPTORS
105
- end
106
-
107
- ANNOTATION_SPEC_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
108
- "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}"
109
- )
110
-
111
- private_constant :ANNOTATION_SPEC_PATH_TEMPLATE
112
-
113
- COLUMN_SPEC_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
114
- "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}"
115
- )
116
-
117
- private_constant :COLUMN_SPEC_PATH_TEMPLATE
118
-
119
- DATASET_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
120
- "projects/{project}/locations/{location}/datasets/{dataset}"
121
- )
122
-
123
- private_constant :DATASET_PATH_TEMPLATE
124
-
125
- LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
126
- "projects/{project}/locations/{location}"
127
- )
128
-
129
- private_constant :LOCATION_PATH_TEMPLATE
130
-
131
- MODEL_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
132
- "projects/{project}/locations/{location}/models/{model}"
133
- )
134
-
135
- private_constant :MODEL_PATH_TEMPLATE
136
-
137
- MODEL_EVALUATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
138
- "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}"
139
- )
140
-
141
- private_constant :MODEL_EVALUATION_PATH_TEMPLATE
142
-
143
- TABLE_SPEC_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
144
- "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}"
145
- )
146
-
147
- private_constant :TABLE_SPEC_PATH_TEMPLATE
148
-
149
- # Returns a fully-qualified annotation_spec resource name string.
150
- # @param project [String]
151
- # @param location [String]
152
- # @param dataset [String]
153
- # @param annotation_spec [String]
154
- # @return [String]
155
- def self.annotation_spec_path project, location, dataset, annotation_spec
156
- ANNOTATION_SPEC_PATH_TEMPLATE.render(
157
- :"project" => project,
158
- :"location" => location,
159
- :"dataset" => dataset,
160
- :"annotation_spec" => annotation_spec
161
- )
162
- end
163
-
164
- # Returns a fully-qualified column_spec resource name string.
165
- # @param project [String]
166
- # @param location [String]
167
- # @param dataset [String]
168
- # @param table_spec [String]
169
- # @param column_spec [String]
170
- # @return [String]
171
- def self.column_spec_path project, location, dataset, table_spec, column_spec
172
- COLUMN_SPEC_PATH_TEMPLATE.render(
173
- :"project" => project,
174
- :"location" => location,
175
- :"dataset" => dataset,
176
- :"table_spec" => table_spec,
177
- :"column_spec" => column_spec
178
- )
179
- end
180
-
181
- # Returns a fully-qualified dataset resource name string.
182
- # @param project [String]
183
- # @param location [String]
184
- # @param dataset [String]
185
- # @return [String]
186
- def self.dataset_path project, location, dataset
187
- DATASET_PATH_TEMPLATE.render(
188
- :"project" => project,
189
- :"location" => location,
190
- :"dataset" => dataset
191
- )
192
- end
193
-
194
- # Returns a fully-qualified location resource name string.
195
- # @param project [String]
196
- # @param location [String]
197
- # @return [String]
198
- def self.location_path project, location
199
- LOCATION_PATH_TEMPLATE.render(
200
- :"project" => project,
201
- :"location" => location
202
- )
203
- end
204
-
205
- # Returns a fully-qualified model resource name string.
206
- # @param project [String]
207
- # @param location [String]
208
- # @param model [String]
209
- # @return [String]
210
- def self.model_path project, location, model
211
- MODEL_PATH_TEMPLATE.render(
212
- :"project" => project,
213
- :"location" => location,
214
- :"model" => model
215
- )
216
- end
217
-
218
- # Returns a fully-qualified model_evaluation resource name string.
219
- # @param project [String]
220
- # @param location [String]
221
- # @param model [String]
222
- # @param model_evaluation [String]
223
- # @return [String]
224
- def self.model_evaluation_path project, location, model, model_evaluation
225
- MODEL_EVALUATION_PATH_TEMPLATE.render(
226
- :"project" => project,
227
- :"location" => location,
228
- :"model" => model,
229
- :"model_evaluation" => model_evaluation
230
- )
231
- end
232
-
233
- # Returns a fully-qualified table_spec resource name string.
234
- # @param project [String]
235
- # @param location [String]
236
- # @param dataset [String]
237
- # @param table_spec [String]
238
- # @return [String]
239
- def self.table_spec_path project, location, dataset, table_spec
240
- TABLE_SPEC_PATH_TEMPLATE.render(
241
- :"project" => project,
242
- :"location" => location,
243
- :"dataset" => dataset,
244
- :"table_spec" => table_spec
245
- )
246
- end
247
-
248
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
249
- # Provides the means for authenticating requests made by the client. This parameter can
250
- # be many types.
251
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
252
- # authenticating requests made by this client.
253
- # A `String` will be treated as the path to the keyfile to be used for the construction of
254
- # credentials for this client.
255
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
256
- # credentials for this client.
257
- # A `GRPC::Core::Channel` will be used to make calls through.
258
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
259
- # should already be composed with a `GRPC::Core::CallCredentials` object.
260
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
261
- # metadata for requests, generally, to give OAuth credentials.
262
- # @param scopes [Array<String>]
263
- # The OAuth scopes for this service. This parameter is ignored if
264
- # an updater_proc is supplied.
265
- # @param client_config [Hash]
266
- # A Hash for call options for each method. See
267
- # Google::Gax#construct_settings for the structure of
268
- # this data. Falls back to the default config if not specified
269
- # or the specified config is missing data points.
270
- # @param timeout [Numeric]
271
- # The default timeout, in seconds, for calls made through this client.
272
- # @param metadata [Hash]
273
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
274
- # @param service_address [String]
275
- # Override for the service hostname, or `nil` to leave as the default.
276
- # @param service_port [Integer]
277
- # Override for the service port, or `nil` to leave as the default.
278
- # @param exception_transformer [Proc]
279
- # An optional proc that intercepts any exceptions raised during an API call to inject
280
- # custom error handling.
281
- def initialize \
282
- credentials: nil,
283
- scopes: ALL_SCOPES,
284
- client_config: {},
285
- timeout: DEFAULT_TIMEOUT,
286
- metadata: nil,
287
- service_address: nil,
288
- service_port: nil,
289
- exception_transformer: nil,
290
- lib_name: nil,
291
- lib_version: ""
292
- # These require statements are intentionally placed here to initialize
293
- # the gRPC module only when it's required.
294
- # See https://github.com/googleapis/toolkit/issues/446
295
- require "google/gax/grpc"
296
- require "google/cloud/automl/v1beta1/service_services_pb"
297
-
298
- credentials ||= Google::Cloud::AutoML::V1beta1::Credentials.default
299
-
300
- @operations_client = OperationsClient.new(
301
- credentials: credentials,
302
- scopes: scopes,
303
- client_config: client_config,
304
- timeout: timeout,
305
- lib_name: lib_name,
306
- service_address: service_address,
307
- service_port: service_port,
308
- lib_version: lib_version,
309
- metadata: metadata,
310
- )
311
-
312
- if credentials.is_a?(String) || credentials.is_a?(Hash)
313
- updater_proc = Google::Cloud::AutoML::V1beta1::Credentials.new(credentials).updater_proc
314
- end
315
- if credentials.is_a?(GRPC::Core::Channel)
316
- channel = credentials
317
- end
318
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
319
- chan_creds = credentials
320
- end
321
- if credentials.is_a?(Proc)
322
- updater_proc = credentials
323
- end
324
- if credentials.is_a?(Google::Auth::Credentials)
325
- updater_proc = credentials.updater_proc
326
- end
327
-
328
- package_version = Google::Cloud::AutoML::VERSION
329
-
330
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
331
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
332
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
333
- google_api_client << " grpc/#{GRPC::VERSION}"
334
- google_api_client.freeze
335
-
336
- headers = { :"x-goog-api-client" => google_api_client }
337
- headers.merge!(metadata) unless metadata.nil?
338
- client_config_file = Pathname.new(__dir__).join(
339
- "automl_client_config.json"
340
- )
341
- defaults = client_config_file.open do |f|
342
- Google::Gax.construct_settings(
343
- "google.cloud.automl.v1beta1.AutoMl",
344
- JSON.parse(f.read),
345
- client_config,
346
- Google::Gax::Grpc::STATUS_CODE_NAMES,
347
- timeout,
348
- page_descriptors: PAGE_DESCRIPTORS,
349
- errors: Google::Gax::Grpc::API_ERRORS,
350
- metadata: headers
351
- )
352
- end
353
-
354
- # Allow overriding the service path/port in subclasses.
355
- service_path = service_address || self.class::SERVICE_ADDRESS
356
- port = service_port || self.class::DEFAULT_SERVICE_PORT
357
- interceptors = self.class::GRPC_INTERCEPTORS
358
- @automl_stub = Google::Gax::Grpc.create_stub(
359
- service_path,
360
- port,
361
- chan_creds: chan_creds,
362
- channel: channel,
363
- updater_proc: updater_proc,
364
- scopes: scopes,
365
- interceptors: interceptors,
366
- &Google::Cloud::AutoML::V1beta1::AutoML::Stub.method(:new)
367
- )
368
-
369
- @create_dataset = Google::Gax.create_api_call(
370
- @automl_stub.method(:create_dataset),
371
- defaults["create_dataset"],
372
- exception_transformer: exception_transformer,
373
- params_extractor: proc do |request|
374
- {'parent' => request.parent}
375
- end
376
- )
377
- @update_dataset = Google::Gax.create_api_call(
378
- @automl_stub.method(:update_dataset),
379
- defaults["update_dataset"],
380
- exception_transformer: exception_transformer,
381
- params_extractor: proc do |request|
382
- {'dataset.name' => request.dataset.name}
383
- end
384
- )
385
- @get_dataset = Google::Gax.create_api_call(
386
- @automl_stub.method(:get_dataset),
387
- defaults["get_dataset"],
388
- exception_transformer: exception_transformer,
389
- params_extractor: proc do |request|
390
- {'name' => request.name}
391
- end
392
- )
393
- @list_datasets = Google::Gax.create_api_call(
394
- @automl_stub.method(:list_datasets),
395
- defaults["list_datasets"],
396
- exception_transformer: exception_transformer,
397
- params_extractor: proc do |request|
398
- {'parent' => request.parent}
399
- end
400
- )
401
- @delete_dataset = Google::Gax.create_api_call(
402
- @automl_stub.method(:delete_dataset),
403
- defaults["delete_dataset"],
404
- exception_transformer: exception_transformer,
405
- params_extractor: proc do |request|
406
- {'name' => request.name}
407
- end
408
- )
409
- @import_data = Google::Gax.create_api_call(
410
- @automl_stub.method(:import_data),
411
- defaults["import_data"],
412
- exception_transformer: exception_transformer,
413
- params_extractor: proc do |request|
414
- {'name' => request.name}
415
- end
416
- )
417
- @export_data = Google::Gax.create_api_call(
418
- @automl_stub.method(:export_data),
419
- defaults["export_data"],
420
- exception_transformer: exception_transformer,
421
- params_extractor: proc do |request|
422
- {'name' => request.name}
423
- end
424
- )
425
- @create_model = Google::Gax.create_api_call(
426
- @automl_stub.method(:create_model),
427
- defaults["create_model"],
428
- exception_transformer: exception_transformer,
429
- params_extractor: proc do |request|
430
- {'parent' => request.parent}
431
- end
432
- )
433
- @get_model = Google::Gax.create_api_call(
434
- @automl_stub.method(:get_model),
435
- defaults["get_model"],
436
- exception_transformer: exception_transformer,
437
- params_extractor: proc do |request|
438
- {'name' => request.name}
439
- end
440
- )
441
- @list_models = Google::Gax.create_api_call(
442
- @automl_stub.method(:list_models),
443
- defaults["list_models"],
444
- exception_transformer: exception_transformer,
445
- params_extractor: proc do |request|
446
- {'parent' => request.parent}
447
- end
448
- )
449
- @delete_model = Google::Gax.create_api_call(
450
- @automl_stub.method(:delete_model),
451
- defaults["delete_model"],
452
- exception_transformer: exception_transformer,
453
- params_extractor: proc do |request|
454
- {'name' => request.name}
455
- end
456
- )
457
- @deploy_model = Google::Gax.create_api_call(
458
- @automl_stub.method(:deploy_model),
459
- defaults["deploy_model"],
460
- exception_transformer: exception_transformer,
461
- params_extractor: proc do |request|
462
- {'name' => request.name}
463
- end
464
- )
465
- @undeploy_model = Google::Gax.create_api_call(
466
- @automl_stub.method(:undeploy_model),
467
- defaults["undeploy_model"],
468
- exception_transformer: exception_transformer,
469
- params_extractor: proc do |request|
470
- {'name' => request.name}
471
- end
472
- )
473
- @get_model_evaluation = Google::Gax.create_api_call(
474
- @automl_stub.method(:get_model_evaluation),
475
- defaults["get_model_evaluation"],
476
- exception_transformer: exception_transformer,
477
- params_extractor: proc do |request|
478
- {'name' => request.name}
479
- end
480
- )
481
- @export_model = Google::Gax.create_api_call(
482
- @automl_stub.method(:export_model),
483
- defaults["export_model"],
484
- exception_transformer: exception_transformer,
485
- params_extractor: proc do |request|
486
- {'name' => request.name}
487
- end
488
- )
489
- @export_evaluated_examples = Google::Gax.create_api_call(
490
- @automl_stub.method(:export_evaluated_examples),
491
- defaults["export_evaluated_examples"],
492
- exception_transformer: exception_transformer,
493
- params_extractor: proc do |request|
494
- {'name' => request.name}
495
- end
496
- )
497
- @list_model_evaluations = Google::Gax.create_api_call(
498
- @automl_stub.method(:list_model_evaluations),
499
- defaults["list_model_evaluations"],
500
- exception_transformer: exception_transformer,
501
- params_extractor: proc do |request|
502
- {'parent' => request.parent}
503
- end
504
- )
505
- @get_annotation_spec = Google::Gax.create_api_call(
506
- @automl_stub.method(:get_annotation_spec),
507
- defaults["get_annotation_spec"],
508
- exception_transformer: exception_transformer,
509
- params_extractor: proc do |request|
510
- {'name' => request.name}
511
- end
512
- )
513
- @get_table_spec = Google::Gax.create_api_call(
514
- @automl_stub.method(:get_table_spec),
515
- defaults["get_table_spec"],
516
- exception_transformer: exception_transformer,
517
- params_extractor: proc do |request|
518
- {'name' => request.name}
519
- end
520
- )
521
- @list_table_specs = Google::Gax.create_api_call(
522
- @automl_stub.method(:list_table_specs),
523
- defaults["list_table_specs"],
524
- exception_transformer: exception_transformer,
525
- params_extractor: proc do |request|
526
- {'parent' => request.parent}
527
- end
528
- )
529
- @update_table_spec = Google::Gax.create_api_call(
530
- @automl_stub.method(:update_table_spec),
531
- defaults["update_table_spec"],
532
- exception_transformer: exception_transformer,
533
- params_extractor: proc do |request|
534
- {'table_spec.name' => request.table_spec.name}
535
- end
536
- )
537
- @get_column_spec = Google::Gax.create_api_call(
538
- @automl_stub.method(:get_column_spec),
539
- defaults["get_column_spec"],
540
- exception_transformer: exception_transformer,
541
- params_extractor: proc do |request|
542
- {'name' => request.name}
543
- end
544
- )
545
- @list_column_specs = Google::Gax.create_api_call(
546
- @automl_stub.method(:list_column_specs),
547
- defaults["list_column_specs"],
548
- exception_transformer: exception_transformer,
549
- params_extractor: proc do |request|
550
- {'parent' => request.parent}
551
- end
552
- )
553
- @update_column_spec = Google::Gax.create_api_call(
554
- @automl_stub.method(:update_column_spec),
555
- defaults["update_column_spec"],
556
- exception_transformer: exception_transformer,
557
- params_extractor: proc do |request|
558
- {'column_spec.name' => request.column_spec.name}
559
- end
560
- )
561
- end
562
-
563
- # Service calls
564
-
565
- # Creates a dataset.
566
- #
567
- # @param parent [String]
568
- # Required. The resource name of the project to create the dataset for.
569
- # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset | Hash]
570
- # Required. The dataset to create.
571
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Dataset`
572
- # can also be provided.
573
- # @param options [Google::Gax::CallOptions]
574
- # Overrides the default settings for this call, e.g, timeout,
575
- # retries, etc.
576
- # @yield [result, operation] Access the result along with the RPC operation
577
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
578
- # @yieldparam operation [GRPC::ActiveCall::Operation]
579
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
580
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
581
- # @example
582
- # require "google/cloud/automl"
583
- #
584
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
585
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
586
- #
587
- # # TODO: Initialize `dataset`:
588
- # dataset = {}
589
- # response = automl_client.create_dataset(formatted_parent, dataset)
590
-
591
- def create_dataset \
592
- parent,
593
- dataset,
594
- options: nil,
595
- &block
596
- req = {
597
- parent: parent,
598
- dataset: dataset
599
- }.delete_if { |_, v| v.nil? }
600
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateDatasetRequest)
601
- @create_dataset.call(req, options, &block)
602
- end
603
-
604
- # Updates a dataset.
605
- #
606
- # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset | Hash]
607
- # Required. The dataset which replaces the resource on the server.
608
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Dataset`
609
- # can also be provided.
610
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
611
- # The update mask applies to the resource.
612
- # A hash of the same form as `Google::Protobuf::FieldMask`
613
- # can also be provided.
614
- # @param options [Google::Gax::CallOptions]
615
- # Overrides the default settings for this call, e.g, timeout,
616
- # retries, etc.
617
- # @yield [result, operation] Access the result along with the RPC operation
618
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
619
- # @yieldparam operation [GRPC::ActiveCall::Operation]
620
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
621
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
622
- # @example
623
- # require "google/cloud/automl"
624
- #
625
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
626
- #
627
- # # TODO: Initialize `dataset`:
628
- # dataset = {}
629
- # response = automl_client.update_dataset(dataset)
630
-
631
- def update_dataset \
632
- dataset,
633
- update_mask: nil,
634
- options: nil,
635
- &block
636
- req = {
637
- dataset: dataset,
638
- update_mask: update_mask
639
- }.delete_if { |_, v| v.nil? }
640
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest)
641
- @update_dataset.call(req, options, &block)
642
- end
643
-
644
- # Gets a dataset.
645
- #
646
- # @param name [String]
647
- # Required. The resource name of the dataset to retrieve.
648
- # @param options [Google::Gax::CallOptions]
649
- # Overrides the default settings for this call, e.g, timeout,
650
- # retries, etc.
651
- # @yield [result, operation] Access the result along with the RPC operation
652
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
653
- # @yieldparam operation [GRPC::ActiveCall::Operation]
654
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
655
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
656
- # @example
657
- # require "google/cloud/automl"
658
- #
659
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
660
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
661
- # response = automl_client.get_dataset(formatted_name)
662
-
663
- def get_dataset \
664
- name,
665
- options: nil,
666
- &block
667
- req = {
668
- name: name
669
- }.delete_if { |_, v| v.nil? }
670
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetDatasetRequest)
671
- @get_dataset.call(req, options, &block)
672
- end
673
-
674
- # Lists datasets in a project.
675
- #
676
- # @param parent [String]
677
- # Required. The resource name of the project from which to list datasets.
678
- # @param filter [String]
679
- # An expression for filtering the results of the request.
680
- #
681
- # * `dataset_metadata` - for existence of the case (e.g.
682
- # image_classification_dataset_metadata:*). Some examples of using the filter are:
683
- #
684
- # * `translation_dataset_metadata:*` --> The dataset has
685
- # translation_dataset_metadata.
686
- # @param page_size [Integer]
687
- # The maximum number of resources contained in the underlying API
688
- # response. If page streaming is performed per-resource, this
689
- # parameter does not affect the return value. If page streaming is
690
- # performed per-page, this determines the maximum number of
691
- # resources in a page.
692
- # @param options [Google::Gax::CallOptions]
693
- # Overrides the default settings for this call, e.g, timeout,
694
- # retries, etc.
695
- # @yield [result, operation] Access the result along with the RPC operation
696
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
697
- # @yieldparam operation [GRPC::ActiveCall::Operation]
698
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
699
- # An enumerable of Google::Cloud::AutoML::V1beta1::Dataset instances.
700
- # See Google::Gax::PagedEnumerable documentation for other
701
- # operations such as per-page iteration or access to the response
702
- # object.
703
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
704
- # @example
705
- # require "google/cloud/automl"
706
- #
707
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
708
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
709
- #
710
- # # Iterate over all results.
711
- # automl_client.list_datasets(formatted_parent).each do |element|
712
- # # Process element.
713
- # end
714
- #
715
- # # Or iterate over results one page at a time.
716
- # automl_client.list_datasets(formatted_parent).each_page do |page|
717
- # # Process each page at a time.
718
- # page.each do |element|
719
- # # Process element.
720
- # end
721
- # end
722
-
723
- def list_datasets \
724
- parent,
725
- filter: nil,
726
- page_size: nil,
727
- options: nil,
728
- &block
729
- req = {
730
- parent: parent,
731
- filter: filter,
732
- page_size: page_size
733
- }.delete_if { |_, v| v.nil? }
734
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListDatasetsRequest)
735
- @list_datasets.call(req, options, &block)
736
- end
737
-
738
- # Deletes a dataset and all of its contents.
739
- # Returns empty response in the
740
- # {Google::Longrunning::Operation#response response} field when it completes,
741
- # and `delete_details` in the
742
- # {Google::Longrunning::Operation#metadata metadata} field.
743
- #
744
- # @param name [String]
745
- # Required. The resource name of the dataset to delete.
746
- # @param options [Google::Gax::CallOptions]
747
- # Overrides the default settings for this call, e.g, timeout,
748
- # retries, etc.
749
- # @return [Google::Gax::Operation]
750
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
751
- # @example
752
- # require "google/cloud/automl"
753
- #
754
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
755
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
756
- #
757
- # # Register a callback during the method call.
758
- # operation = automl_client.delete_dataset(formatted_name) do |op|
759
- # raise op.results.message if op.error?
760
- # op_results = op.results
761
- # # Process the results.
762
- #
763
- # metadata = op.metadata
764
- # # Process the metadata.
765
- # end
766
- #
767
- # # Or use the return value to register a callback.
768
- # operation.on_done do |op|
769
- # raise op.results.message if op.error?
770
- # op_results = op.results
771
- # # Process the results.
772
- #
773
- # metadata = op.metadata
774
- # # Process the metadata.
775
- # end
776
- #
777
- # # Manually reload the operation.
778
- # operation.reload!
779
- #
780
- # # Or block until the operation completes, triggering callbacks on
781
- # # completion.
782
- # operation.wait_until_done!
783
-
784
- def delete_dataset \
785
- name,
786
- options: nil
787
- req = {
788
- name: name
789
- }.delete_if { |_, v| v.nil? }
790
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest)
791
- operation = Google::Gax::Operation.new(
792
- @delete_dataset.call(req, options),
793
- @operations_client,
794
- Google::Protobuf::Empty,
795
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
796
- call_options: options
797
- )
798
- operation.on_done { |operation| yield(operation) } if block_given?
799
- operation
800
- end
801
-
802
- # Imports data into a dataset.
803
- # For Tables this method can only be called on an empty Dataset.
804
- #
805
- # For Tables:
806
- # * A
807
- # {Google::Cloud::AutoML::V1beta1::InputConfig#params schema_inference_version}
808
- # parameter must be explicitly set.
809
- # Returns an empty response in the
810
- # {Google::Longrunning::Operation#response response} field when it completes.
811
- #
812
- # @param name [String]
813
- # Required. Dataset name. Dataset must already exist. All imported
814
- # annotations and examples will be added.
815
- # @param input_config [Google::Cloud::AutoML::V1beta1::InputConfig | Hash]
816
- # Required. The desired input location and its domain specific semantics,
817
- # if any.
818
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::InputConfig`
819
- # can also be provided.
820
- # @param options [Google::Gax::CallOptions]
821
- # Overrides the default settings for this call, e.g, timeout,
822
- # retries, etc.
823
- # @return [Google::Gax::Operation]
824
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
825
- # @example
826
- # require "google/cloud/automl"
827
- #
828
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
829
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
830
- #
831
- # # TODO: Initialize `input_config`:
832
- # input_config = {}
833
- #
834
- # # Register a callback during the method call.
835
- # operation = automl_client.import_data(formatted_name, input_config) do |op|
836
- # raise op.results.message if op.error?
837
- # op_results = op.results
838
- # # Process the results.
839
- #
840
- # metadata = op.metadata
841
- # # Process the metadata.
842
- # end
843
- #
844
- # # Or use the return value to register a callback.
845
- # operation.on_done do |op|
846
- # raise op.results.message if op.error?
847
- # op_results = op.results
848
- # # Process the results.
849
- #
850
- # metadata = op.metadata
851
- # # Process the metadata.
852
- # end
853
- #
854
- # # Manually reload the operation.
855
- # operation.reload!
856
- #
857
- # # Or block until the operation completes, triggering callbacks on
858
- # # completion.
859
- # operation.wait_until_done!
860
-
861
- def import_data \
862
- name,
863
- input_config,
864
- options: nil
865
- req = {
866
- name: name,
867
- input_config: input_config
868
- }.delete_if { |_, v| v.nil? }
869
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ImportDataRequest)
870
- operation = Google::Gax::Operation.new(
871
- @import_data.call(req, options),
872
- @operations_client,
873
- Google::Protobuf::Empty,
874
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
875
- call_options: options
876
- )
877
- operation.on_done { |operation| yield(operation) } if block_given?
878
- operation
879
- end
880
-
881
- # Exports dataset's data to the provided output location.
882
- # Returns an empty response in the
883
- # {Google::Longrunning::Operation#response response} field when it completes.
884
- #
885
- # @param name [String]
886
- # Required. The resource name of the dataset.
887
- # @param output_config [Google::Cloud::AutoML::V1beta1::OutputConfig | Hash]
888
- # Required. The desired output location.
889
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::OutputConfig`
890
- # can also be provided.
891
- # @param options [Google::Gax::CallOptions]
892
- # Overrides the default settings for this call, e.g, timeout,
893
- # retries, etc.
894
- # @return [Google::Gax::Operation]
895
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
896
- # @example
897
- # require "google/cloud/automl"
898
- #
899
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
900
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
901
- #
902
- # # TODO: Initialize `output_config`:
903
- # output_config = {}
904
- #
905
- # # Register a callback during the method call.
906
- # operation = automl_client.export_data(formatted_name, output_config) do |op|
907
- # raise op.results.message if op.error?
908
- # op_results = op.results
909
- # # Process the results.
910
- #
911
- # metadata = op.metadata
912
- # # Process the metadata.
913
- # end
914
- #
915
- # # Or use the return value to register a callback.
916
- # operation.on_done do |op|
917
- # raise op.results.message if op.error?
918
- # op_results = op.results
919
- # # Process the results.
920
- #
921
- # metadata = op.metadata
922
- # # Process the metadata.
923
- # end
924
- #
925
- # # Manually reload the operation.
926
- # operation.reload!
927
- #
928
- # # Or block until the operation completes, triggering callbacks on
929
- # # completion.
930
- # operation.wait_until_done!
931
-
932
- def export_data \
933
- name,
934
- output_config,
935
- options: nil
936
- req = {
937
- name: name,
938
- output_config: output_config
939
- }.delete_if { |_, v| v.nil? }
940
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportDataRequest)
941
- operation = Google::Gax::Operation.new(
942
- @export_data.call(req, options),
943
- @operations_client,
944
- Google::Protobuf::Empty,
945
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
946
- call_options: options
947
- )
948
- operation.on_done { |operation| yield(operation) } if block_given?
949
- operation
950
- end
951
-
952
- # Creates a model.
953
- # Returns a Model in the {Google::Longrunning::Operation#response response}
954
- # field when it completes.
955
- # When you create a model, several model evaluations are created for it:
956
- # a global evaluation, and one evaluation for each annotation spec.
957
- #
958
- # @param parent [String]
959
- # Required. Resource name of the parent project where the model is being created.
960
- # @param model [Google::Cloud::AutoML::V1beta1::Model | Hash]
961
- # Required. The model to create.
962
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Model`
963
- # can also be provided.
964
- # @param options [Google::Gax::CallOptions]
965
- # Overrides the default settings for this call, e.g, timeout,
966
- # retries, etc.
967
- # @return [Google::Gax::Operation]
968
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
969
- # @example
970
- # require "google/cloud/automl"
971
- #
972
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
973
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
974
- #
975
- # # TODO: Initialize `model`:
976
- # model = {}
977
- #
978
- # # Register a callback during the method call.
979
- # operation = automl_client.create_model(formatted_parent, model) do |op|
980
- # raise op.results.message if op.error?
981
- # op_results = op.results
982
- # # Process the results.
983
- #
984
- # metadata = op.metadata
985
- # # Process the metadata.
986
- # end
987
- #
988
- # # Or use the return value to register a callback.
989
- # operation.on_done do |op|
990
- # raise op.results.message if op.error?
991
- # op_results = op.results
992
- # # Process the results.
993
- #
994
- # metadata = op.metadata
995
- # # Process the metadata.
996
- # end
997
- #
998
- # # Manually reload the operation.
999
- # operation.reload!
1000
- #
1001
- # # Or block until the operation completes, triggering callbacks on
1002
- # # completion.
1003
- # operation.wait_until_done!
1004
-
1005
- def create_model \
1006
- parent,
1007
- model,
1008
- options: nil
1009
- req = {
1010
- parent: parent,
1011
- model: model
1012
- }.delete_if { |_, v| v.nil? }
1013
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateModelRequest)
1014
- operation = Google::Gax::Operation.new(
1015
- @create_model.call(req, options),
1016
- @operations_client,
1017
- Google::Cloud::AutoML::V1beta1::Model,
1018
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1019
- call_options: options
1020
- )
1021
- operation.on_done { |operation| yield(operation) } if block_given?
1022
- operation
1023
- end
1024
-
1025
- # Gets a model.
1026
- #
1027
- # @param name [String]
1028
- # Required. Resource name of the model.
1029
- # @param options [Google::Gax::CallOptions]
1030
- # Overrides the default settings for this call, e.g, timeout,
1031
- # retries, etc.
1032
- # @yield [result, operation] Access the result along with the RPC operation
1033
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Model]
1034
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1035
- # @return [Google::Cloud::AutoML::V1beta1::Model]
1036
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1037
- # @example
1038
- # require "google/cloud/automl"
1039
- #
1040
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1041
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1042
- # response = automl_client.get_model(formatted_name)
1043
-
1044
- def get_model \
1045
- name,
1046
- options: nil,
1047
- &block
1048
- req = {
1049
- name: name
1050
- }.delete_if { |_, v| v.nil? }
1051
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelRequest)
1052
- @get_model.call(req, options, &block)
1053
- end
1054
-
1055
- # Lists models.
1056
- #
1057
- # @param parent [String]
1058
- # Required. Resource name of the project, from which to list the models.
1059
- # @param filter [String]
1060
- # An expression for filtering the results of the request.
1061
- #
1062
- # * `model_metadata` - for existence of the case (e.g.
1063
- # video_classification_model_metadata:*).
1064
- # * `dataset_id` - for = or !=. Some examples of using the filter are:
1065
- #
1066
- # * `image_classification_model_metadata:*` --> The model has
1067
- # image_classification_model_metadata.
1068
- # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1069
- # @param page_size [Integer]
1070
- # The maximum number of resources contained in the underlying API
1071
- # response. If page streaming is performed per-resource, this
1072
- # parameter does not affect the return value. If page streaming is
1073
- # performed per-page, this determines the maximum number of
1074
- # resources in a page.
1075
- # @param options [Google::Gax::CallOptions]
1076
- # Overrides the default settings for this call, e.g, timeout,
1077
- # retries, etc.
1078
- # @yield [result, operation] Access the result along with the RPC operation
1079
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1080
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1081
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1082
- # An enumerable of Google::Cloud::AutoML::V1beta1::Model instances.
1083
- # See Google::Gax::PagedEnumerable documentation for other
1084
- # operations such as per-page iteration or access to the response
1085
- # object.
1086
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1087
- # @example
1088
- # require "google/cloud/automl"
1089
- #
1090
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1091
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
1092
- #
1093
- # # Iterate over all results.
1094
- # automl_client.list_models(formatted_parent).each do |element|
1095
- # # Process element.
1096
- # end
1097
- #
1098
- # # Or iterate over results one page at a time.
1099
- # automl_client.list_models(formatted_parent).each_page do |page|
1100
- # # Process each page at a time.
1101
- # page.each do |element|
1102
- # # Process element.
1103
- # end
1104
- # end
1105
-
1106
- def list_models \
1107
- parent,
1108
- filter: nil,
1109
- page_size: nil,
1110
- options: nil,
1111
- &block
1112
- req = {
1113
- parent: parent,
1114
- filter: filter,
1115
- page_size: page_size
1116
- }.delete_if { |_, v| v.nil? }
1117
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelsRequest)
1118
- @list_models.call(req, options, &block)
1119
- end
1120
-
1121
- # Deletes a model.
1122
- # Returns `google.protobuf.Empty` in the
1123
- # {Google::Longrunning::Operation#response response} field when it completes,
1124
- # and `delete_details` in the
1125
- # {Google::Longrunning::Operation#metadata metadata} field.
1126
- #
1127
- # @param name [String]
1128
- # Required. Resource name of the model being deleted.
1129
- # @param options [Google::Gax::CallOptions]
1130
- # Overrides the default settings for this call, e.g, timeout,
1131
- # retries, etc.
1132
- # @return [Google::Gax::Operation]
1133
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1134
- # @example
1135
- # require "google/cloud/automl"
1136
- #
1137
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1138
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1139
- #
1140
- # # Register a callback during the method call.
1141
- # operation = automl_client.delete_model(formatted_name) do |op|
1142
- # raise op.results.message if op.error?
1143
- # op_results = op.results
1144
- # # Process the results.
1145
- #
1146
- # metadata = op.metadata
1147
- # # Process the metadata.
1148
- # end
1149
- #
1150
- # # Or use the return value to register a callback.
1151
- # operation.on_done do |op|
1152
- # raise op.results.message if op.error?
1153
- # op_results = op.results
1154
- # # Process the results.
1155
- #
1156
- # metadata = op.metadata
1157
- # # Process the metadata.
1158
- # end
1159
- #
1160
- # # Manually reload the operation.
1161
- # operation.reload!
1162
- #
1163
- # # Or block until the operation completes, triggering callbacks on
1164
- # # completion.
1165
- # operation.wait_until_done!
1166
-
1167
- def delete_model \
1168
- name,
1169
- options: nil
1170
- req = {
1171
- name: name
1172
- }.delete_if { |_, v| v.nil? }
1173
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteModelRequest)
1174
- operation = Google::Gax::Operation.new(
1175
- @delete_model.call(req, options),
1176
- @operations_client,
1177
- Google::Protobuf::Empty,
1178
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1179
- call_options: options
1180
- )
1181
- operation.on_done { |operation| yield(operation) } if block_given?
1182
- operation
1183
- end
1184
-
1185
- # Deploys a model. If a model is already deployed, deploying it with the
1186
- # same parameters has no effect. Deploying with different parametrs
1187
- # (as e.g. changing
1188
- #
1189
- # {Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata#node_number node_number})
1190
- # will reset the deployment state without pausing the model's availability.
1191
- #
1192
- # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage
1193
- # deployment automatically.
1194
- #
1195
- # Returns an empty response in the
1196
- # {Google::Longrunning::Operation#response response} field when it completes.
1197
- #
1198
- # @param name [String]
1199
- # Required. Resource name of the model to deploy.
1200
- # @param image_object_detection_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata | Hash]
1201
- # Model deployment metadata specific to Image Object Detection.
1202
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata`
1203
- # can also be provided.
1204
- # @param image_classification_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata | Hash]
1205
- # Model deployment metadata specific to Image Classification.
1206
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata`
1207
- # can also be provided.
1208
- # @param options [Google::Gax::CallOptions]
1209
- # Overrides the default settings for this call, e.g, timeout,
1210
- # retries, etc.
1211
- # @return [Google::Gax::Operation]
1212
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1213
- # @example
1214
- # require "google/cloud/automl"
1215
- #
1216
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1217
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1218
- #
1219
- # # Register a callback during the method call.
1220
- # operation = automl_client.deploy_model(formatted_name) do |op|
1221
- # raise op.results.message if op.error?
1222
- # op_results = op.results
1223
- # # Process the results.
1224
- #
1225
- # metadata = op.metadata
1226
- # # Process the metadata.
1227
- # end
1228
- #
1229
- # # Or use the return value to register a callback.
1230
- # operation.on_done do |op|
1231
- # raise op.results.message if op.error?
1232
- # op_results = op.results
1233
- # # Process the results.
1234
- #
1235
- # metadata = op.metadata
1236
- # # Process the metadata.
1237
- # end
1238
- #
1239
- # # Manually reload the operation.
1240
- # operation.reload!
1241
- #
1242
- # # Or block until the operation completes, triggering callbacks on
1243
- # # completion.
1244
- # operation.wait_until_done!
1245
-
1246
- def deploy_model \
1247
- name,
1248
- image_object_detection_model_deployment_metadata: nil,
1249
- image_classification_model_deployment_metadata: nil,
1250
- options: nil
1251
- req = {
1252
- name: name,
1253
- image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata,
1254
- image_classification_model_deployment_metadata: image_classification_model_deployment_metadata
1255
- }.delete_if { |_, v| v.nil? }
1256
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeployModelRequest)
1257
- operation = Google::Gax::Operation.new(
1258
- @deploy_model.call(req, options),
1259
- @operations_client,
1260
- Google::Protobuf::Empty,
1261
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1262
- call_options: options
1263
- )
1264
- operation.on_done { |operation| yield(operation) } if block_given?
1265
- operation
1266
- end
1267
-
1268
- # Undeploys a model. If the model is not deployed this method has no effect.
1269
- #
1270
- # Only applicable for Text Classification, Image Object Detection and Tables;
1271
- # all other domains manage deployment automatically.
1272
- #
1273
- # Returns an empty response in the
1274
- # {Google::Longrunning::Operation#response response} field when it completes.
1275
- #
1276
- # @param name [String]
1277
- # Required. Resource name of the model to undeploy.
1278
- # @param options [Google::Gax::CallOptions]
1279
- # Overrides the default settings for this call, e.g, timeout,
1280
- # retries, etc.
1281
- # @return [Google::Gax::Operation]
1282
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1283
- # @example
1284
- # require "google/cloud/automl"
1285
- #
1286
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1287
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1288
- #
1289
- # # Register a callback during the method call.
1290
- # operation = automl_client.undeploy_model(formatted_name) do |op|
1291
- # raise op.results.message if op.error?
1292
- # op_results = op.results
1293
- # # Process the results.
1294
- #
1295
- # metadata = op.metadata
1296
- # # Process the metadata.
1297
- # end
1298
- #
1299
- # # Or use the return value to register a callback.
1300
- # operation.on_done do |op|
1301
- # raise op.results.message if op.error?
1302
- # op_results = op.results
1303
- # # Process the results.
1304
- #
1305
- # metadata = op.metadata
1306
- # # Process the metadata.
1307
- # end
1308
- #
1309
- # # Manually reload the operation.
1310
- # operation.reload!
1311
- #
1312
- # # Or block until the operation completes, triggering callbacks on
1313
- # # completion.
1314
- # operation.wait_until_done!
1315
-
1316
- def undeploy_model \
1317
- name,
1318
- options: nil
1319
- req = {
1320
- name: name
1321
- }.delete_if { |_, v| v.nil? }
1322
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UndeployModelRequest)
1323
- operation = Google::Gax::Operation.new(
1324
- @undeploy_model.call(req, options),
1325
- @operations_client,
1326
- Google::Protobuf::Empty,
1327
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1328
- call_options: options
1329
- )
1330
- operation.on_done { |operation| yield(operation) } if block_given?
1331
- operation
1332
- end
1333
-
1334
- # Gets a model evaluation.
1335
- #
1336
- # @param name [String]
1337
- # Required. Resource name for the model evaluation.
1338
- # @param options [Google::Gax::CallOptions]
1339
- # Overrides the default settings for this call, e.g, timeout,
1340
- # retries, etc.
1341
- # @yield [result, operation] Access the result along with the RPC operation
1342
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1343
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1344
- # @return [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1345
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1346
- # @example
1347
- # require "google/cloud/automl"
1348
- #
1349
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1350
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_evaluation_path("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]")
1351
- # response = automl_client.get_model_evaluation(formatted_name)
1352
-
1353
- def get_model_evaluation \
1354
- name,
1355
- options: nil,
1356
- &block
1357
- req = {
1358
- name: name
1359
- }.delete_if { |_, v| v.nil? }
1360
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest)
1361
- @get_model_evaluation.call(req, options, &block)
1362
- end
1363
-
1364
- # Exports a trained, "export-able", model to a user specified Google Cloud
1365
- # Storage location. A model is considered export-able if and only if it has
1366
- # an export format defined for it in
1367
- #
1368
- # {Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig ModelExportOutputConfig}.
1369
- #
1370
- # Returns an empty response in the
1371
- # {Google::Longrunning::Operation#response response} field when it completes.
1372
- #
1373
- # @param name [String]
1374
- # Required. The resource name of the model to export.
1375
- # @param output_config [Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig | Hash]
1376
- # Required. The desired output location and configuration.
1377
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig`
1378
- # can also be provided.
1379
- # @param options [Google::Gax::CallOptions]
1380
- # Overrides the default settings for this call, e.g, timeout,
1381
- # retries, etc.
1382
- # @return [Google::Gax::Operation]
1383
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1384
- # @example
1385
- # require "google/cloud/automl"
1386
- #
1387
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1388
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1389
- #
1390
- # # TODO: Initialize `output_config`:
1391
- # output_config = {}
1392
- #
1393
- # # Register a callback during the method call.
1394
- # operation = automl_client.export_model(formatted_name, output_config) do |op|
1395
- # raise op.results.message if op.error?
1396
- # op_results = op.results
1397
- # # Process the results.
1398
- #
1399
- # metadata = op.metadata
1400
- # # Process the metadata.
1401
- # end
1402
- #
1403
- # # Or use the return value to register a callback.
1404
- # operation.on_done do |op|
1405
- # raise op.results.message if op.error?
1406
- # op_results = op.results
1407
- # # Process the results.
1408
- #
1409
- # metadata = op.metadata
1410
- # # Process the metadata.
1411
- # end
1412
- #
1413
- # # Manually reload the operation.
1414
- # operation.reload!
1415
- #
1416
- # # Or block until the operation completes, triggering callbacks on
1417
- # # completion.
1418
- # operation.wait_until_done!
1419
-
1420
- def export_model \
1421
- name,
1422
- output_config,
1423
- options: nil
1424
- req = {
1425
- name: name,
1426
- output_config: output_config
1427
- }.delete_if { |_, v| v.nil? }
1428
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportModelRequest)
1429
- operation = Google::Gax::Operation.new(
1430
- @export_model.call(req, options),
1431
- @operations_client,
1432
- Google::Protobuf::Empty,
1433
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1434
- call_options: options
1435
- )
1436
- operation.on_done { |operation| yield(operation) } if block_given?
1437
- operation
1438
- end
1439
-
1440
- # Exports examples on which the model was evaluated (i.e. which were in the
1441
- # TEST set of the dataset the model was created from), together with their
1442
- # ground truth annotations and the annotations created (predicted) by the
1443
- # model.
1444
- # The examples, ground truth and predictions are exported in the state
1445
- # they were at the moment the model was evaluated.
1446
- #
1447
- # This export is available only for 30 days since the model evaluation is
1448
- # created.
1449
- #
1450
- # Currently only available for Tables.
1451
- #
1452
- # Returns an empty response in the
1453
- # {Google::Longrunning::Operation#response response} field when it completes.
1454
- #
1455
- # @param name [String]
1456
- # Required. The resource name of the model whose evaluated examples are to
1457
- # be exported.
1458
- # @param output_config [Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesOutputConfig | Hash]
1459
- # Required. The desired output location and configuration.
1460
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesOutputConfig`
1461
- # can also be provided.
1462
- # @param options [Google::Gax::CallOptions]
1463
- # Overrides the default settings for this call, e.g, timeout,
1464
- # retries, etc.
1465
- # @return [Google::Gax::Operation]
1466
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1467
- # @example
1468
- # require "google/cloud/automl"
1469
- #
1470
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1471
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1472
- #
1473
- # # TODO: Initialize `output_config`:
1474
- # output_config = {}
1475
- #
1476
- # # Register a callback during the method call.
1477
- # operation = automl_client.export_evaluated_examples(formatted_name, output_config) do |op|
1478
- # raise op.results.message if op.error?
1479
- # op_results = op.results
1480
- # # Process the results.
1481
- #
1482
- # metadata = op.metadata
1483
- # # Process the metadata.
1484
- # end
1485
- #
1486
- # # Or use the return value to register a callback.
1487
- # operation.on_done do |op|
1488
- # raise op.results.message if op.error?
1489
- # op_results = op.results
1490
- # # Process the results.
1491
- #
1492
- # metadata = op.metadata
1493
- # # Process the metadata.
1494
- # end
1495
- #
1496
- # # Manually reload the operation.
1497
- # operation.reload!
1498
- #
1499
- # # Or block until the operation completes, triggering callbacks on
1500
- # # completion.
1501
- # operation.wait_until_done!
1502
-
1503
- def export_evaluated_examples \
1504
- name,
1505
- output_config,
1506
- options: nil
1507
- req = {
1508
- name: name,
1509
- output_config: output_config
1510
- }.delete_if { |_, v| v.nil? }
1511
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest)
1512
- operation = Google::Gax::Operation.new(
1513
- @export_evaluated_examples.call(req, options),
1514
- @operations_client,
1515
- Google::Protobuf::Empty,
1516
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1517
- call_options: options
1518
- )
1519
- operation.on_done { |operation| yield(operation) } if block_given?
1520
- operation
1521
- end
1522
-
1523
- # Lists model evaluations.
1524
- #
1525
- # @param parent [String]
1526
- # Required. Resource name of the model to list the model evaluations for.
1527
- # If modelId is set as "-", this will list model evaluations from across all
1528
- # models of the parent location.
1529
- # @param filter [String]
1530
- # An expression for filtering the results of the request.
1531
- #
1532
- # * `annotation_spec_id` - for =, != or existence. See example below for
1533
- # the last.
1534
- #
1535
- # Some examples of using the filter are:
1536
- #
1537
- # * `annotation_spec_id!=4` --> The model evaluation was done for
1538
- # annotation spec with ID different than 4.
1539
- # * `NOT annotation_spec_id:*` --> The model evaluation was done for
1540
- # aggregate of all annotation specs.
1541
- # @param page_size [Integer]
1542
- # The maximum number of resources contained in the underlying API
1543
- # response. If page streaming is performed per-resource, this
1544
- # parameter does not affect the return value. If page streaming is
1545
- # performed per-page, this determines the maximum number of
1546
- # resources in a page.
1547
- # @param options [Google::Gax::CallOptions]
1548
- # Overrides the default settings for this call, e.g, timeout,
1549
- # retries, etc.
1550
- # @yield [result, operation] Access the result along with the RPC operation
1551
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
1552
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1553
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
1554
- # An enumerable of Google::Cloud::AutoML::V1beta1::ModelEvaluation instances.
1555
- # See Google::Gax::PagedEnumerable documentation for other
1556
- # operations such as per-page iteration or access to the response
1557
- # object.
1558
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1559
- # @example
1560
- # require "google/cloud/automl"
1561
- #
1562
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1563
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1564
- #
1565
- # # Iterate over all results.
1566
- # automl_client.list_model_evaluations(formatted_parent).each do |element|
1567
- # # Process element.
1568
- # end
1569
- #
1570
- # # Or iterate over results one page at a time.
1571
- # automl_client.list_model_evaluations(formatted_parent).each_page do |page|
1572
- # # Process each page at a time.
1573
- # page.each do |element|
1574
- # # Process element.
1575
- # end
1576
- # end
1577
-
1578
- def list_model_evaluations \
1579
- parent,
1580
- filter: nil,
1581
- page_size: nil,
1582
- options: nil,
1583
- &block
1584
- req = {
1585
- parent: parent,
1586
- filter: filter,
1587
- page_size: page_size
1588
- }.delete_if { |_, v| v.nil? }
1589
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest)
1590
- @list_model_evaluations.call(req, options, &block)
1591
- end
1592
-
1593
- # Gets an annotation spec.
1594
- #
1595
- # @param name [String]
1596
- # Required. The resource name of the annotation spec to retrieve.
1597
- # @param options [Google::Gax::CallOptions]
1598
- # Overrides the default settings for this call, e.g, timeout,
1599
- # retries, etc.
1600
- # @yield [result, operation] Access the result along with the RPC operation
1601
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
1602
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1603
- # @return [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
1604
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1605
- # @example
1606
- # require "google/cloud/automl"
1607
- #
1608
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1609
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.annotation_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
1610
- # response = automl_client.get_annotation_spec(formatted_name)
1611
-
1612
- def get_annotation_spec \
1613
- name,
1614
- options: nil,
1615
- &block
1616
- req = {
1617
- name: name
1618
- }.delete_if { |_, v| v.nil? }
1619
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest)
1620
- @get_annotation_spec.call(req, options, &block)
1621
- end
1622
-
1623
- # Gets a table spec.
1624
- #
1625
- # @param name [String]
1626
- # Required. The resource name of the table spec to retrieve.
1627
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1628
- # Mask specifying which fields to read.
1629
- # A hash of the same form as `Google::Protobuf::FieldMask`
1630
- # can also be provided.
1631
- # @param options [Google::Gax::CallOptions]
1632
- # Overrides the default settings for this call, e.g, timeout,
1633
- # retries, etc.
1634
- # @yield [result, operation] Access the result along with the RPC operation
1635
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::TableSpec]
1636
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1637
- # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
1638
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1639
- # @example
1640
- # require "google/cloud/automl"
1641
- #
1642
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1643
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.table_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
1644
- # response = automl_client.get_table_spec(formatted_name)
1645
-
1646
- def get_table_spec \
1647
- name,
1648
- field_mask: nil,
1649
- options: nil,
1650
- &block
1651
- req = {
1652
- name: name,
1653
- field_mask: field_mask
1654
- }.delete_if { |_, v| v.nil? }
1655
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetTableSpecRequest)
1656
- @get_table_spec.call(req, options, &block)
1657
- end
1658
-
1659
- # Lists table specs in a dataset.
1660
- #
1661
- # @param parent [String]
1662
- # Required. The resource name of the dataset to list table specs from.
1663
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1664
- # Mask specifying which fields to read.
1665
- # A hash of the same form as `Google::Protobuf::FieldMask`
1666
- # can also be provided.
1667
- # @param filter [String]
1668
- # Filter expression, see go/filtering.
1669
- # @param page_size [Integer]
1670
- # The maximum number of resources contained in the underlying API
1671
- # response. If page streaming is performed per-resource, this
1672
- # parameter does not affect the return value. If page streaming is
1673
- # performed per-page, this determines the maximum number of
1674
- # resources in a page.
1675
- # @param options [Google::Gax::CallOptions]
1676
- # Overrides the default settings for this call, e.g, timeout,
1677
- # retries, etc.
1678
- # @yield [result, operation] Access the result along with the RPC operation
1679
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
1680
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1681
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
1682
- # An enumerable of Google::Cloud::AutoML::V1beta1::TableSpec instances.
1683
- # See Google::Gax::PagedEnumerable documentation for other
1684
- # operations such as per-page iteration or access to the response
1685
- # object.
1686
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1687
- # @example
1688
- # require "google/cloud/automl"
1689
- #
1690
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1691
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
1692
- #
1693
- # # Iterate over all results.
1694
- # automl_client.list_table_specs(formatted_parent).each do |element|
1695
- # # Process element.
1696
- # end
1697
- #
1698
- # # Or iterate over results one page at a time.
1699
- # automl_client.list_table_specs(formatted_parent).each_page do |page|
1700
- # # Process each page at a time.
1701
- # page.each do |element|
1702
- # # Process element.
1703
- # end
1704
- # end
1705
-
1706
- def list_table_specs \
1707
- parent,
1708
- field_mask: nil,
1709
- filter: nil,
1710
- page_size: nil,
1711
- options: nil,
1712
- &block
1713
- req = {
1714
- parent: parent,
1715
- field_mask: field_mask,
1716
- filter: filter,
1717
- page_size: page_size
1718
- }.delete_if { |_, v| v.nil? }
1719
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest)
1720
- @list_table_specs.call(req, options, &block)
1721
- end
1722
-
1723
- # Updates a table spec.
1724
- #
1725
- # @param table_spec [Google::Cloud::AutoML::V1beta1::TableSpec | Hash]
1726
- # Required. The table spec which replaces the resource on the server.
1727
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::TableSpec`
1728
- # can also be provided.
1729
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1730
- # The update mask applies to the resource.
1731
- # A hash of the same form as `Google::Protobuf::FieldMask`
1732
- # can also be provided.
1733
- # @param options [Google::Gax::CallOptions]
1734
- # Overrides the default settings for this call, e.g, timeout,
1735
- # retries, etc.
1736
- # @yield [result, operation] Access the result along with the RPC operation
1737
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::TableSpec]
1738
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1739
- # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
1740
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1741
- # @example
1742
- # require "google/cloud/automl"
1743
- #
1744
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1745
- #
1746
- # # TODO: Initialize `table_spec`:
1747
- # table_spec = {}
1748
- # response = automl_client.update_table_spec(table_spec)
1749
-
1750
- def update_table_spec \
1751
- table_spec,
1752
- update_mask: nil,
1753
- options: nil,
1754
- &block
1755
- req = {
1756
- table_spec: table_spec,
1757
- update_mask: update_mask
1758
- }.delete_if { |_, v| v.nil? }
1759
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest)
1760
- @update_table_spec.call(req, options, &block)
1761
- end
1762
-
1763
- # Gets a column spec.
1764
- #
1765
- # @param name [String]
1766
- # Required. The resource name of the column spec to retrieve.
1767
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1768
- # Mask specifying which fields to read.
1769
- # A hash of the same form as `Google::Protobuf::FieldMask`
1770
- # can also be provided.
1771
- # @param options [Google::Gax::CallOptions]
1772
- # Overrides the default settings for this call, e.g, timeout,
1773
- # retries, etc.
1774
- # @yield [result, operation] Access the result along with the RPC operation
1775
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1776
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1777
- # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1778
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1779
- # @example
1780
- # require "google/cloud/automl"
1781
- #
1782
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1783
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.column_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]")
1784
- # response = automl_client.get_column_spec(formatted_name)
1785
-
1786
- def get_column_spec \
1787
- name,
1788
- field_mask: nil,
1789
- options: nil,
1790
- &block
1791
- req = {
1792
- name: name,
1793
- field_mask: field_mask
1794
- }.delete_if { |_, v| v.nil? }
1795
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest)
1796
- @get_column_spec.call(req, options, &block)
1797
- end
1798
-
1799
- # Lists column specs in a table spec.
1800
- #
1801
- # @param parent [String]
1802
- # Required. The resource name of the table spec to list column specs from.
1803
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1804
- # Mask specifying which fields to read.
1805
- # A hash of the same form as `Google::Protobuf::FieldMask`
1806
- # can also be provided.
1807
- # @param filter [String]
1808
- # Filter expression, see go/filtering.
1809
- # @param page_size [Integer]
1810
- # The maximum number of resources contained in the underlying API
1811
- # response. If page streaming is performed per-resource, this
1812
- # parameter does not affect the return value. If page streaming is
1813
- # performed per-page, this determines the maximum number of
1814
- # resources in a page.
1815
- # @param options [Google::Gax::CallOptions]
1816
- # Overrides the default settings for this call, e.g, timeout,
1817
- # retries, etc.
1818
- # @yield [result, operation] Access the result along with the RPC operation
1819
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1820
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1821
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1822
- # An enumerable of Google::Cloud::AutoML::V1beta1::ColumnSpec instances.
1823
- # See Google::Gax::PagedEnumerable documentation for other
1824
- # operations such as per-page iteration or access to the response
1825
- # object.
1826
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1827
- # @example
1828
- # require "google/cloud/automl"
1829
- #
1830
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1831
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.table_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
1832
- #
1833
- # # Iterate over all results.
1834
- # automl_client.list_column_specs(formatted_parent).each do |element|
1835
- # # Process element.
1836
- # end
1837
- #
1838
- # # Or iterate over results one page at a time.
1839
- # automl_client.list_column_specs(formatted_parent).each_page do |page|
1840
- # # Process each page at a time.
1841
- # page.each do |element|
1842
- # # Process element.
1843
- # end
1844
- # end
1845
-
1846
- def list_column_specs \
1847
- parent,
1848
- field_mask: nil,
1849
- filter: nil,
1850
- page_size: nil,
1851
- options: nil,
1852
- &block
1853
- req = {
1854
- parent: parent,
1855
- field_mask: field_mask,
1856
- filter: filter,
1857
- page_size: page_size
1858
- }.delete_if { |_, v| v.nil? }
1859
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest)
1860
- @list_column_specs.call(req, options, &block)
1861
- end
1862
-
1863
- # Updates a column spec.
1864
- #
1865
- # @param column_spec [Google::Cloud::AutoML::V1beta1::ColumnSpec | Hash]
1866
- # Required. The column spec which replaces the resource on the server.
1867
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ColumnSpec`
1868
- # can also be provided.
1869
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1870
- # The update mask applies to the resource.
1871
- # A hash of the same form as `Google::Protobuf::FieldMask`
1872
- # can also be provided.
1873
- # @param options [Google::Gax::CallOptions]
1874
- # Overrides the default settings for this call, e.g, timeout,
1875
- # retries, etc.
1876
- # @yield [result, operation] Access the result along with the RPC operation
1877
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1878
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1879
- # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1880
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1881
- # @example
1882
- # require "google/cloud/automl"
1883
- #
1884
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1885
- #
1886
- # # TODO: Initialize `column_spec`:
1887
- # column_spec = {}
1888
- # response = automl_client.update_column_spec(column_spec)
1889
-
1890
- def update_column_spec \
1891
- column_spec,
1892
- update_mask: nil,
1893
- options: nil,
1894
- &block
1895
- req = {
1896
- column_spec: column_spec,
1897
- update_mask: update_mask
1898
- }.delete_if { |_, v| v.nil? }
1899
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest)
1900
- @update_column_spec.call(req, options, &block)
1901
- end
1902
- end
1903
- end
1904
- end
1905
- end
1906
- end