google-cloud-automl 0.7.1 → 1.1.1

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 +56 -59
  4. data/LICENSE.md +201 -0
  5. data/MIGRATING.md +324 -0
  6. data/README.md +97 -27
  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 +83 -107
  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 -1909
  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 -480
  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,1909 +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
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
338
- headers[:"x-goog-user-project"] = credentials.quota_project_id
339
- end
340
- headers.merge!(metadata) unless metadata.nil?
341
- client_config_file = Pathname.new(__dir__).join(
342
- "automl_client_config.json"
343
- )
344
- defaults = client_config_file.open do |f|
345
- Google::Gax.construct_settings(
346
- "google.cloud.automl.v1beta1.AutoMl",
347
- JSON.parse(f.read),
348
- client_config,
349
- Google::Gax::Grpc::STATUS_CODE_NAMES,
350
- timeout,
351
- page_descriptors: PAGE_DESCRIPTORS,
352
- errors: Google::Gax::Grpc::API_ERRORS,
353
- metadata: headers
354
- )
355
- end
356
-
357
- # Allow overriding the service path/port in subclasses.
358
- service_path = service_address || self.class::SERVICE_ADDRESS
359
- port = service_port || self.class::DEFAULT_SERVICE_PORT
360
- interceptors = self.class::GRPC_INTERCEPTORS
361
- @automl_stub = Google::Gax::Grpc.create_stub(
362
- service_path,
363
- port,
364
- chan_creds: chan_creds,
365
- channel: channel,
366
- updater_proc: updater_proc,
367
- scopes: scopes,
368
- interceptors: interceptors,
369
- &Google::Cloud::AutoML::V1beta1::AutoML::Stub.method(:new)
370
- )
371
-
372
- @create_dataset = Google::Gax.create_api_call(
373
- @automl_stub.method(:create_dataset),
374
- defaults["create_dataset"],
375
- exception_transformer: exception_transformer,
376
- params_extractor: proc do |request|
377
- {'parent' => request.parent}
378
- end
379
- )
380
- @update_dataset = Google::Gax.create_api_call(
381
- @automl_stub.method(:update_dataset),
382
- defaults["update_dataset"],
383
- exception_transformer: exception_transformer,
384
- params_extractor: proc do |request|
385
- {'dataset.name' => request.dataset.name}
386
- end
387
- )
388
- @get_dataset = Google::Gax.create_api_call(
389
- @automl_stub.method(:get_dataset),
390
- defaults["get_dataset"],
391
- exception_transformer: exception_transformer,
392
- params_extractor: proc do |request|
393
- {'name' => request.name}
394
- end
395
- )
396
- @list_datasets = Google::Gax.create_api_call(
397
- @automl_stub.method(:list_datasets),
398
- defaults["list_datasets"],
399
- exception_transformer: exception_transformer,
400
- params_extractor: proc do |request|
401
- {'parent' => request.parent}
402
- end
403
- )
404
- @delete_dataset = Google::Gax.create_api_call(
405
- @automl_stub.method(:delete_dataset),
406
- defaults["delete_dataset"],
407
- exception_transformer: exception_transformer,
408
- params_extractor: proc do |request|
409
- {'name' => request.name}
410
- end
411
- )
412
- @import_data = Google::Gax.create_api_call(
413
- @automl_stub.method(:import_data),
414
- defaults["import_data"],
415
- exception_transformer: exception_transformer,
416
- params_extractor: proc do |request|
417
- {'name' => request.name}
418
- end
419
- )
420
- @export_data = Google::Gax.create_api_call(
421
- @automl_stub.method(:export_data),
422
- defaults["export_data"],
423
- exception_transformer: exception_transformer,
424
- params_extractor: proc do |request|
425
- {'name' => request.name}
426
- end
427
- )
428
- @create_model = Google::Gax.create_api_call(
429
- @automl_stub.method(:create_model),
430
- defaults["create_model"],
431
- exception_transformer: exception_transformer,
432
- params_extractor: proc do |request|
433
- {'parent' => request.parent}
434
- end
435
- )
436
- @get_model = Google::Gax.create_api_call(
437
- @automl_stub.method(:get_model),
438
- defaults["get_model"],
439
- exception_transformer: exception_transformer,
440
- params_extractor: proc do |request|
441
- {'name' => request.name}
442
- end
443
- )
444
- @list_models = Google::Gax.create_api_call(
445
- @automl_stub.method(:list_models),
446
- defaults["list_models"],
447
- exception_transformer: exception_transformer,
448
- params_extractor: proc do |request|
449
- {'parent' => request.parent}
450
- end
451
- )
452
- @delete_model = Google::Gax.create_api_call(
453
- @automl_stub.method(:delete_model),
454
- defaults["delete_model"],
455
- exception_transformer: exception_transformer,
456
- params_extractor: proc do |request|
457
- {'name' => request.name}
458
- end
459
- )
460
- @deploy_model = Google::Gax.create_api_call(
461
- @automl_stub.method(:deploy_model),
462
- defaults["deploy_model"],
463
- exception_transformer: exception_transformer,
464
- params_extractor: proc do |request|
465
- {'name' => request.name}
466
- end
467
- )
468
- @undeploy_model = Google::Gax.create_api_call(
469
- @automl_stub.method(:undeploy_model),
470
- defaults["undeploy_model"],
471
- exception_transformer: exception_transformer,
472
- params_extractor: proc do |request|
473
- {'name' => request.name}
474
- end
475
- )
476
- @get_model_evaluation = Google::Gax.create_api_call(
477
- @automl_stub.method(:get_model_evaluation),
478
- defaults["get_model_evaluation"],
479
- exception_transformer: exception_transformer,
480
- params_extractor: proc do |request|
481
- {'name' => request.name}
482
- end
483
- )
484
- @export_model = Google::Gax.create_api_call(
485
- @automl_stub.method(:export_model),
486
- defaults["export_model"],
487
- exception_transformer: exception_transformer,
488
- params_extractor: proc do |request|
489
- {'name' => request.name}
490
- end
491
- )
492
- @export_evaluated_examples = Google::Gax.create_api_call(
493
- @automl_stub.method(:export_evaluated_examples),
494
- defaults["export_evaluated_examples"],
495
- exception_transformer: exception_transformer,
496
- params_extractor: proc do |request|
497
- {'name' => request.name}
498
- end
499
- )
500
- @list_model_evaluations = Google::Gax.create_api_call(
501
- @automl_stub.method(:list_model_evaluations),
502
- defaults["list_model_evaluations"],
503
- exception_transformer: exception_transformer,
504
- params_extractor: proc do |request|
505
- {'parent' => request.parent}
506
- end
507
- )
508
- @get_annotation_spec = Google::Gax.create_api_call(
509
- @automl_stub.method(:get_annotation_spec),
510
- defaults["get_annotation_spec"],
511
- exception_transformer: exception_transformer,
512
- params_extractor: proc do |request|
513
- {'name' => request.name}
514
- end
515
- )
516
- @get_table_spec = Google::Gax.create_api_call(
517
- @automl_stub.method(:get_table_spec),
518
- defaults["get_table_spec"],
519
- exception_transformer: exception_transformer,
520
- params_extractor: proc do |request|
521
- {'name' => request.name}
522
- end
523
- )
524
- @list_table_specs = Google::Gax.create_api_call(
525
- @automl_stub.method(:list_table_specs),
526
- defaults["list_table_specs"],
527
- exception_transformer: exception_transformer,
528
- params_extractor: proc do |request|
529
- {'parent' => request.parent}
530
- end
531
- )
532
- @update_table_spec = Google::Gax.create_api_call(
533
- @automl_stub.method(:update_table_spec),
534
- defaults["update_table_spec"],
535
- exception_transformer: exception_transformer,
536
- params_extractor: proc do |request|
537
- {'table_spec.name' => request.table_spec.name}
538
- end
539
- )
540
- @get_column_spec = Google::Gax.create_api_call(
541
- @automl_stub.method(:get_column_spec),
542
- defaults["get_column_spec"],
543
- exception_transformer: exception_transformer,
544
- params_extractor: proc do |request|
545
- {'name' => request.name}
546
- end
547
- )
548
- @list_column_specs = Google::Gax.create_api_call(
549
- @automl_stub.method(:list_column_specs),
550
- defaults["list_column_specs"],
551
- exception_transformer: exception_transformer,
552
- params_extractor: proc do |request|
553
- {'parent' => request.parent}
554
- end
555
- )
556
- @update_column_spec = Google::Gax.create_api_call(
557
- @automl_stub.method(:update_column_spec),
558
- defaults["update_column_spec"],
559
- exception_transformer: exception_transformer,
560
- params_extractor: proc do |request|
561
- {'column_spec.name' => request.column_spec.name}
562
- end
563
- )
564
- end
565
-
566
- # Service calls
567
-
568
- # Creates a dataset.
569
- #
570
- # @param parent [String]
571
- # Required. The resource name of the project to create the dataset for.
572
- # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset | Hash]
573
- # Required. The dataset to create.
574
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Dataset`
575
- # can also be provided.
576
- # @param options [Google::Gax::CallOptions]
577
- # Overrides the default settings for this call, e.g, timeout,
578
- # retries, etc.
579
- # @yield [result, operation] Access the result along with the RPC operation
580
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
581
- # @yieldparam operation [GRPC::ActiveCall::Operation]
582
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
583
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
584
- # @example
585
- # require "google/cloud/automl"
586
- #
587
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
588
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
589
- #
590
- # # TODO: Initialize `dataset`:
591
- # dataset = {}
592
- # response = automl_client.create_dataset(formatted_parent, dataset)
593
-
594
- def create_dataset \
595
- parent,
596
- dataset,
597
- options: nil,
598
- &block
599
- req = {
600
- parent: parent,
601
- dataset: dataset
602
- }.delete_if { |_, v| v.nil? }
603
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateDatasetRequest)
604
- @create_dataset.call(req, options, &block)
605
- end
606
-
607
- # Updates a dataset.
608
- #
609
- # @param dataset [Google::Cloud::AutoML::V1beta1::Dataset | Hash]
610
- # Required. The dataset which replaces the resource on the server.
611
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Dataset`
612
- # can also be provided.
613
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
614
- # The update mask applies to the resource.
615
- # A hash of the same form as `Google::Protobuf::FieldMask`
616
- # can also be provided.
617
- # @param options [Google::Gax::CallOptions]
618
- # Overrides the default settings for this call, e.g, timeout,
619
- # retries, etc.
620
- # @yield [result, operation] Access the result along with the RPC operation
621
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
622
- # @yieldparam operation [GRPC::ActiveCall::Operation]
623
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
624
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
625
- # @example
626
- # require "google/cloud/automl"
627
- #
628
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
629
- #
630
- # # TODO: Initialize `dataset`:
631
- # dataset = {}
632
- # response = automl_client.update_dataset(dataset)
633
-
634
- def update_dataset \
635
- dataset,
636
- update_mask: nil,
637
- options: nil,
638
- &block
639
- req = {
640
- dataset: dataset,
641
- update_mask: update_mask
642
- }.delete_if { |_, v| v.nil? }
643
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest)
644
- @update_dataset.call(req, options, &block)
645
- end
646
-
647
- # Gets a dataset.
648
- #
649
- # @param name [String]
650
- # Required. The resource name of the dataset to retrieve.
651
- # @param options [Google::Gax::CallOptions]
652
- # Overrides the default settings for this call, e.g, timeout,
653
- # retries, etc.
654
- # @yield [result, operation] Access the result along with the RPC operation
655
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Dataset]
656
- # @yieldparam operation [GRPC::ActiveCall::Operation]
657
- # @return [Google::Cloud::AutoML::V1beta1::Dataset]
658
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
659
- # @example
660
- # require "google/cloud/automl"
661
- #
662
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
663
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
664
- # response = automl_client.get_dataset(formatted_name)
665
-
666
- def get_dataset \
667
- name,
668
- options: nil,
669
- &block
670
- req = {
671
- name: name
672
- }.delete_if { |_, v| v.nil? }
673
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetDatasetRequest)
674
- @get_dataset.call(req, options, &block)
675
- end
676
-
677
- # Lists datasets in a project.
678
- #
679
- # @param parent [String]
680
- # Required. The resource name of the project from which to list datasets.
681
- # @param filter [String]
682
- # An expression for filtering the results of the request.
683
- #
684
- # * `dataset_metadata` - for existence of the case (e.g.
685
- # image_classification_dataset_metadata:*). Some examples of using the filter are:
686
- #
687
- # * `translation_dataset_metadata:*` --> The dataset has
688
- # translation_dataset_metadata.
689
- # @param page_size [Integer]
690
- # The maximum number of resources contained in the underlying API
691
- # response. If page streaming is performed per-resource, this
692
- # parameter does not affect the return value. If page streaming is
693
- # performed per-page, this determines the maximum number of
694
- # resources in a page.
695
- # @param options [Google::Gax::CallOptions]
696
- # Overrides the default settings for this call, e.g, timeout,
697
- # retries, etc.
698
- # @yield [result, operation] Access the result along with the RPC operation
699
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
700
- # @yieldparam operation [GRPC::ActiveCall::Operation]
701
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>]
702
- # An enumerable of Google::Cloud::AutoML::V1beta1::Dataset instances.
703
- # See Google::Gax::PagedEnumerable documentation for other
704
- # operations such as per-page iteration or access to the response
705
- # object.
706
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
707
- # @example
708
- # require "google/cloud/automl"
709
- #
710
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
711
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
712
- #
713
- # # Iterate over all results.
714
- # automl_client.list_datasets(formatted_parent).each do |element|
715
- # # Process element.
716
- # end
717
- #
718
- # # Or iterate over results one page at a time.
719
- # automl_client.list_datasets(formatted_parent).each_page do |page|
720
- # # Process each page at a time.
721
- # page.each do |element|
722
- # # Process element.
723
- # end
724
- # end
725
-
726
- def list_datasets \
727
- parent,
728
- filter: nil,
729
- page_size: nil,
730
- options: nil,
731
- &block
732
- req = {
733
- parent: parent,
734
- filter: filter,
735
- page_size: page_size
736
- }.delete_if { |_, v| v.nil? }
737
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListDatasetsRequest)
738
- @list_datasets.call(req, options, &block)
739
- end
740
-
741
- # Deletes a dataset and all of its contents.
742
- # Returns empty response in the
743
- # {Google::Longrunning::Operation#response response} field when it completes,
744
- # and `delete_details` in the
745
- # {Google::Longrunning::Operation#metadata metadata} field.
746
- #
747
- # @param name [String]
748
- # Required. The resource name of the dataset to delete.
749
- # @param options [Google::Gax::CallOptions]
750
- # Overrides the default settings for this call, e.g, timeout,
751
- # retries, etc.
752
- # @return [Google::Gax::Operation]
753
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
754
- # @example
755
- # require "google/cloud/automl"
756
- #
757
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
758
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
759
- #
760
- # # Register a callback during the method call.
761
- # operation = automl_client.delete_dataset(formatted_name) do |op|
762
- # raise op.results.message if op.error?
763
- # op_results = op.results
764
- # # Process the results.
765
- #
766
- # metadata = op.metadata
767
- # # Process the metadata.
768
- # end
769
- #
770
- # # Or use the return value to register a callback.
771
- # operation.on_done do |op|
772
- # raise op.results.message if op.error?
773
- # op_results = op.results
774
- # # Process the results.
775
- #
776
- # metadata = op.metadata
777
- # # Process the metadata.
778
- # end
779
- #
780
- # # Manually reload the operation.
781
- # operation.reload!
782
- #
783
- # # Or block until the operation completes, triggering callbacks on
784
- # # completion.
785
- # operation.wait_until_done!
786
-
787
- def delete_dataset \
788
- name,
789
- options: nil
790
- req = {
791
- name: name
792
- }.delete_if { |_, v| v.nil? }
793
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest)
794
- operation = Google::Gax::Operation.new(
795
- @delete_dataset.call(req, options),
796
- @operations_client,
797
- Google::Protobuf::Empty,
798
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
799
- call_options: options
800
- )
801
- operation.on_done { |operation| yield(operation) } if block_given?
802
- operation
803
- end
804
-
805
- # Imports data into a dataset.
806
- # For Tables this method can only be called on an empty Dataset.
807
- #
808
- # For Tables:
809
- # * A
810
- # {Google::Cloud::AutoML::V1beta1::InputConfig#params schema_inference_version}
811
- # parameter must be explicitly set.
812
- # Returns an empty response in the
813
- # {Google::Longrunning::Operation#response response} field when it completes.
814
- #
815
- # @param name [String]
816
- # Required. Dataset name. Dataset must already exist. All imported
817
- # annotations and examples will be added.
818
- # @param input_config [Google::Cloud::AutoML::V1beta1::InputConfig | Hash]
819
- # Required. The desired input location and its domain specific semantics,
820
- # if any.
821
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::InputConfig`
822
- # can also be provided.
823
- # @param options [Google::Gax::CallOptions]
824
- # Overrides the default settings for this call, e.g, timeout,
825
- # retries, etc.
826
- # @return [Google::Gax::Operation]
827
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
828
- # @example
829
- # require "google/cloud/automl"
830
- #
831
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
832
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
833
- #
834
- # # TODO: Initialize `input_config`:
835
- # input_config = {}
836
- #
837
- # # Register a callback during the method call.
838
- # operation = automl_client.import_data(formatted_name, input_config) do |op|
839
- # raise op.results.message if op.error?
840
- # op_results = op.results
841
- # # Process the results.
842
- #
843
- # metadata = op.metadata
844
- # # Process the metadata.
845
- # end
846
- #
847
- # # Or use the return value to register a callback.
848
- # operation.on_done do |op|
849
- # raise op.results.message if op.error?
850
- # op_results = op.results
851
- # # Process the results.
852
- #
853
- # metadata = op.metadata
854
- # # Process the metadata.
855
- # end
856
- #
857
- # # Manually reload the operation.
858
- # operation.reload!
859
- #
860
- # # Or block until the operation completes, triggering callbacks on
861
- # # completion.
862
- # operation.wait_until_done!
863
-
864
- def import_data \
865
- name,
866
- input_config,
867
- options: nil
868
- req = {
869
- name: name,
870
- input_config: input_config
871
- }.delete_if { |_, v| v.nil? }
872
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ImportDataRequest)
873
- operation = Google::Gax::Operation.new(
874
- @import_data.call(req, options),
875
- @operations_client,
876
- Google::Protobuf::Empty,
877
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
878
- call_options: options
879
- )
880
- operation.on_done { |operation| yield(operation) } if block_given?
881
- operation
882
- end
883
-
884
- # Exports dataset's data to the provided output location.
885
- # Returns an empty response in the
886
- # {Google::Longrunning::Operation#response response} field when it completes.
887
- #
888
- # @param name [String]
889
- # Required. The resource name of the dataset.
890
- # @param output_config [Google::Cloud::AutoML::V1beta1::OutputConfig | Hash]
891
- # Required. The desired output location.
892
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::OutputConfig`
893
- # can also be provided.
894
- # @param options [Google::Gax::CallOptions]
895
- # Overrides the default settings for this call, e.g, timeout,
896
- # retries, etc.
897
- # @return [Google::Gax::Operation]
898
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
899
- # @example
900
- # require "google/cloud/automl"
901
- #
902
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
903
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
904
- #
905
- # # TODO: Initialize `output_config`:
906
- # output_config = {}
907
- #
908
- # # Register a callback during the method call.
909
- # operation = automl_client.export_data(formatted_name, output_config) do |op|
910
- # raise op.results.message if op.error?
911
- # op_results = op.results
912
- # # Process the results.
913
- #
914
- # metadata = op.metadata
915
- # # Process the metadata.
916
- # end
917
- #
918
- # # Or use the return value to register a callback.
919
- # operation.on_done do |op|
920
- # raise op.results.message if op.error?
921
- # op_results = op.results
922
- # # Process the results.
923
- #
924
- # metadata = op.metadata
925
- # # Process the metadata.
926
- # end
927
- #
928
- # # Manually reload the operation.
929
- # operation.reload!
930
- #
931
- # # Or block until the operation completes, triggering callbacks on
932
- # # completion.
933
- # operation.wait_until_done!
934
-
935
- def export_data \
936
- name,
937
- output_config,
938
- options: nil
939
- req = {
940
- name: name,
941
- output_config: output_config
942
- }.delete_if { |_, v| v.nil? }
943
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportDataRequest)
944
- operation = Google::Gax::Operation.new(
945
- @export_data.call(req, options),
946
- @operations_client,
947
- Google::Protobuf::Empty,
948
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
949
- call_options: options
950
- )
951
- operation.on_done { |operation| yield(operation) } if block_given?
952
- operation
953
- end
954
-
955
- # Creates a model.
956
- # Returns a Model in the {Google::Longrunning::Operation#response response}
957
- # field when it completes.
958
- # When you create a model, several model evaluations are created for it:
959
- # a global evaluation, and one evaluation for each annotation spec.
960
- #
961
- # @param parent [String]
962
- # Required. Resource name of the parent project where the model is being created.
963
- # @param model [Google::Cloud::AutoML::V1beta1::Model | Hash]
964
- # Required. The model to create.
965
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::Model`
966
- # can also be provided.
967
- # @param options [Google::Gax::CallOptions]
968
- # Overrides the default settings for this call, e.g, timeout,
969
- # retries, etc.
970
- # @return [Google::Gax::Operation]
971
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
972
- # @example
973
- # require "google/cloud/automl"
974
- #
975
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
976
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
977
- #
978
- # # TODO: Initialize `model`:
979
- # model = {}
980
- #
981
- # # Register a callback during the method call.
982
- # operation = automl_client.create_model(formatted_parent, model) do |op|
983
- # raise op.results.message if op.error?
984
- # op_results = op.results
985
- # # Process the results.
986
- #
987
- # metadata = op.metadata
988
- # # Process the metadata.
989
- # end
990
- #
991
- # # Or use the return value to register a callback.
992
- # operation.on_done do |op|
993
- # raise op.results.message if op.error?
994
- # op_results = op.results
995
- # # Process the results.
996
- #
997
- # metadata = op.metadata
998
- # # Process the metadata.
999
- # end
1000
- #
1001
- # # Manually reload the operation.
1002
- # operation.reload!
1003
- #
1004
- # # Or block until the operation completes, triggering callbacks on
1005
- # # completion.
1006
- # operation.wait_until_done!
1007
-
1008
- def create_model \
1009
- parent,
1010
- model,
1011
- options: nil
1012
- req = {
1013
- parent: parent,
1014
- model: model
1015
- }.delete_if { |_, v| v.nil? }
1016
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateModelRequest)
1017
- operation = Google::Gax::Operation.new(
1018
- @create_model.call(req, options),
1019
- @operations_client,
1020
- Google::Cloud::AutoML::V1beta1::Model,
1021
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1022
- call_options: options
1023
- )
1024
- operation.on_done { |operation| yield(operation) } if block_given?
1025
- operation
1026
- end
1027
-
1028
- # Gets a model.
1029
- #
1030
- # @param name [String]
1031
- # Required. Resource name of the model.
1032
- # @param options [Google::Gax::CallOptions]
1033
- # Overrides the default settings for this call, e.g, timeout,
1034
- # retries, etc.
1035
- # @yield [result, operation] Access the result along with the RPC operation
1036
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::Model]
1037
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1038
- # @return [Google::Cloud::AutoML::V1beta1::Model]
1039
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1040
- # @example
1041
- # require "google/cloud/automl"
1042
- #
1043
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1044
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1045
- # response = automl_client.get_model(formatted_name)
1046
-
1047
- def get_model \
1048
- name,
1049
- options: nil,
1050
- &block
1051
- req = {
1052
- name: name
1053
- }.delete_if { |_, v| v.nil? }
1054
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelRequest)
1055
- @get_model.call(req, options, &block)
1056
- end
1057
-
1058
- # Lists models.
1059
- #
1060
- # @param parent [String]
1061
- # Required. Resource name of the project, from which to list the models.
1062
- # @param filter [String]
1063
- # An expression for filtering the results of the request.
1064
- #
1065
- # * `model_metadata` - for existence of the case (e.g.
1066
- # video_classification_model_metadata:*).
1067
- # * `dataset_id` - for = or !=. Some examples of using the filter are:
1068
- #
1069
- # * `image_classification_model_metadata:*` --> The model has
1070
- # image_classification_model_metadata.
1071
- # * `dataset_id=5` --> The model was created from a dataset with ID 5.
1072
- # @param page_size [Integer]
1073
- # The maximum number of resources contained in the underlying API
1074
- # response. If page streaming is performed per-resource, this
1075
- # parameter does not affect the return value. If page streaming is
1076
- # performed per-page, this determines the maximum number of
1077
- # resources in a page.
1078
- # @param options [Google::Gax::CallOptions]
1079
- # Overrides the default settings for this call, e.g, timeout,
1080
- # retries, etc.
1081
- # @yield [result, operation] Access the result along with the RPC operation
1082
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1083
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1084
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>]
1085
- # An enumerable of Google::Cloud::AutoML::V1beta1::Model instances.
1086
- # See Google::Gax::PagedEnumerable documentation for other
1087
- # operations such as per-page iteration or access to the response
1088
- # object.
1089
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1090
- # @example
1091
- # require "google/cloud/automl"
1092
- #
1093
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1094
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.location_path("[PROJECT]", "[LOCATION]")
1095
- #
1096
- # # Iterate over all results.
1097
- # automl_client.list_models(formatted_parent).each do |element|
1098
- # # Process element.
1099
- # end
1100
- #
1101
- # # Or iterate over results one page at a time.
1102
- # automl_client.list_models(formatted_parent).each_page do |page|
1103
- # # Process each page at a time.
1104
- # page.each do |element|
1105
- # # Process element.
1106
- # end
1107
- # end
1108
-
1109
- def list_models \
1110
- parent,
1111
- filter: nil,
1112
- page_size: nil,
1113
- options: nil,
1114
- &block
1115
- req = {
1116
- parent: parent,
1117
- filter: filter,
1118
- page_size: page_size
1119
- }.delete_if { |_, v| v.nil? }
1120
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelsRequest)
1121
- @list_models.call(req, options, &block)
1122
- end
1123
-
1124
- # Deletes a model.
1125
- # Returns `google.protobuf.Empty` in the
1126
- # {Google::Longrunning::Operation#response response} field when it completes,
1127
- # and `delete_details` in the
1128
- # {Google::Longrunning::Operation#metadata metadata} field.
1129
- #
1130
- # @param name [String]
1131
- # Required. Resource name of the model being deleted.
1132
- # @param options [Google::Gax::CallOptions]
1133
- # Overrides the default settings for this call, e.g, timeout,
1134
- # retries, etc.
1135
- # @return [Google::Gax::Operation]
1136
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1137
- # @example
1138
- # require "google/cloud/automl"
1139
- #
1140
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1141
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1142
- #
1143
- # # Register a callback during the method call.
1144
- # operation = automl_client.delete_model(formatted_name) do |op|
1145
- # raise op.results.message if op.error?
1146
- # op_results = op.results
1147
- # # Process the results.
1148
- #
1149
- # metadata = op.metadata
1150
- # # Process the metadata.
1151
- # end
1152
- #
1153
- # # Or use the return value to register a callback.
1154
- # operation.on_done do |op|
1155
- # raise op.results.message if op.error?
1156
- # op_results = op.results
1157
- # # Process the results.
1158
- #
1159
- # metadata = op.metadata
1160
- # # Process the metadata.
1161
- # end
1162
- #
1163
- # # Manually reload the operation.
1164
- # operation.reload!
1165
- #
1166
- # # Or block until the operation completes, triggering callbacks on
1167
- # # completion.
1168
- # operation.wait_until_done!
1169
-
1170
- def delete_model \
1171
- name,
1172
- options: nil
1173
- req = {
1174
- name: name
1175
- }.delete_if { |_, v| v.nil? }
1176
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteModelRequest)
1177
- operation = Google::Gax::Operation.new(
1178
- @delete_model.call(req, options),
1179
- @operations_client,
1180
- Google::Protobuf::Empty,
1181
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1182
- call_options: options
1183
- )
1184
- operation.on_done { |operation| yield(operation) } if block_given?
1185
- operation
1186
- end
1187
-
1188
- # Deploys a model. If a model is already deployed, deploying it with the
1189
- # same parameters has no effect. Deploying with different parametrs
1190
- # (as e.g. changing
1191
- #
1192
- # {Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata#node_number node_number})
1193
- # will reset the deployment state without pausing the model's availability.
1194
- #
1195
- # Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage
1196
- # deployment automatically.
1197
- #
1198
- # Returns an empty response in the
1199
- # {Google::Longrunning::Operation#response response} field when it completes.
1200
- #
1201
- # @param name [String]
1202
- # Required. Resource name of the model to deploy.
1203
- # @param image_object_detection_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata | Hash]
1204
- # Model deployment metadata specific to Image Object Detection.
1205
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ImageObjectDetectionModelDeploymentMetadata`
1206
- # can also be provided.
1207
- # @param image_classification_model_deployment_metadata [Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata | Hash]
1208
- # Model deployment metadata specific to Image Classification.
1209
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ImageClassificationModelDeploymentMetadata`
1210
- # can also be provided.
1211
- # @param options [Google::Gax::CallOptions]
1212
- # Overrides the default settings for this call, e.g, timeout,
1213
- # retries, etc.
1214
- # @return [Google::Gax::Operation]
1215
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1216
- # @example
1217
- # require "google/cloud/automl"
1218
- #
1219
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1220
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1221
- #
1222
- # # Register a callback during the method call.
1223
- # operation = automl_client.deploy_model(formatted_name) do |op|
1224
- # raise op.results.message if op.error?
1225
- # op_results = op.results
1226
- # # Process the results.
1227
- #
1228
- # metadata = op.metadata
1229
- # # Process the metadata.
1230
- # end
1231
- #
1232
- # # Or use the return value to register a callback.
1233
- # operation.on_done do |op|
1234
- # raise op.results.message if op.error?
1235
- # op_results = op.results
1236
- # # Process the results.
1237
- #
1238
- # metadata = op.metadata
1239
- # # Process the metadata.
1240
- # end
1241
- #
1242
- # # Manually reload the operation.
1243
- # operation.reload!
1244
- #
1245
- # # Or block until the operation completes, triggering callbacks on
1246
- # # completion.
1247
- # operation.wait_until_done!
1248
-
1249
- def deploy_model \
1250
- name,
1251
- image_object_detection_model_deployment_metadata: nil,
1252
- image_classification_model_deployment_metadata: nil,
1253
- options: nil
1254
- req = {
1255
- name: name,
1256
- image_object_detection_model_deployment_metadata: image_object_detection_model_deployment_metadata,
1257
- image_classification_model_deployment_metadata: image_classification_model_deployment_metadata
1258
- }.delete_if { |_, v| v.nil? }
1259
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeployModelRequest)
1260
- operation = Google::Gax::Operation.new(
1261
- @deploy_model.call(req, options),
1262
- @operations_client,
1263
- Google::Protobuf::Empty,
1264
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1265
- call_options: options
1266
- )
1267
- operation.on_done { |operation| yield(operation) } if block_given?
1268
- operation
1269
- end
1270
-
1271
- # Undeploys a model. If the model is not deployed this method has no effect.
1272
- #
1273
- # Only applicable for Text Classification, Image Object Detection and Tables;
1274
- # all other domains manage deployment automatically.
1275
- #
1276
- # Returns an empty response in the
1277
- # {Google::Longrunning::Operation#response response} field when it completes.
1278
- #
1279
- # @param name [String]
1280
- # Required. Resource name of the model to undeploy.
1281
- # @param options [Google::Gax::CallOptions]
1282
- # Overrides the default settings for this call, e.g, timeout,
1283
- # retries, etc.
1284
- # @return [Google::Gax::Operation]
1285
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1286
- # @example
1287
- # require "google/cloud/automl"
1288
- #
1289
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1290
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1291
- #
1292
- # # Register a callback during the method call.
1293
- # operation = automl_client.undeploy_model(formatted_name) do |op|
1294
- # raise op.results.message if op.error?
1295
- # op_results = op.results
1296
- # # Process the results.
1297
- #
1298
- # metadata = op.metadata
1299
- # # Process the metadata.
1300
- # end
1301
- #
1302
- # # Or use the return value to register a callback.
1303
- # operation.on_done do |op|
1304
- # raise op.results.message if op.error?
1305
- # op_results = op.results
1306
- # # Process the results.
1307
- #
1308
- # metadata = op.metadata
1309
- # # Process the metadata.
1310
- # end
1311
- #
1312
- # # Manually reload the operation.
1313
- # operation.reload!
1314
- #
1315
- # # Or block until the operation completes, triggering callbacks on
1316
- # # completion.
1317
- # operation.wait_until_done!
1318
-
1319
- def undeploy_model \
1320
- name,
1321
- options: nil
1322
- req = {
1323
- name: name
1324
- }.delete_if { |_, v| v.nil? }
1325
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UndeployModelRequest)
1326
- operation = Google::Gax::Operation.new(
1327
- @undeploy_model.call(req, options),
1328
- @operations_client,
1329
- Google::Protobuf::Empty,
1330
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1331
- call_options: options
1332
- )
1333
- operation.on_done { |operation| yield(operation) } if block_given?
1334
- operation
1335
- end
1336
-
1337
- # Gets a model evaluation.
1338
- #
1339
- # @param name [String]
1340
- # Required. Resource name for the model evaluation.
1341
- # @param options [Google::Gax::CallOptions]
1342
- # Overrides the default settings for this call, e.g, timeout,
1343
- # retries, etc.
1344
- # @yield [result, operation] Access the result along with the RPC operation
1345
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1346
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1347
- # @return [Google::Cloud::AutoML::V1beta1::ModelEvaluation]
1348
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1349
- # @example
1350
- # require "google/cloud/automl"
1351
- #
1352
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1353
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_evaluation_path("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]")
1354
- # response = automl_client.get_model_evaluation(formatted_name)
1355
-
1356
- def get_model_evaluation \
1357
- name,
1358
- options: nil,
1359
- &block
1360
- req = {
1361
- name: name
1362
- }.delete_if { |_, v| v.nil? }
1363
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest)
1364
- @get_model_evaluation.call(req, options, &block)
1365
- end
1366
-
1367
- # Exports a trained, "export-able", model to a user specified Google Cloud
1368
- # Storage location. A model is considered export-able if and only if it has
1369
- # an export format defined for it in
1370
- #
1371
- # {Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig ModelExportOutputConfig}.
1372
- #
1373
- # Returns an empty response in the
1374
- # {Google::Longrunning::Operation#response response} field when it completes.
1375
- #
1376
- # @param name [String]
1377
- # Required. The resource name of the model to export.
1378
- # @param output_config [Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig | Hash]
1379
- # Required. The desired output location and configuration.
1380
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ModelExportOutputConfig`
1381
- # can also be provided.
1382
- # @param options [Google::Gax::CallOptions]
1383
- # Overrides the default settings for this call, e.g, timeout,
1384
- # retries, etc.
1385
- # @return [Google::Gax::Operation]
1386
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1387
- # @example
1388
- # require "google/cloud/automl"
1389
- #
1390
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1391
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1392
- #
1393
- # # TODO: Initialize `output_config`:
1394
- # output_config = {}
1395
- #
1396
- # # Register a callback during the method call.
1397
- # operation = automl_client.export_model(formatted_name, output_config) do |op|
1398
- # raise op.results.message if op.error?
1399
- # op_results = op.results
1400
- # # Process the results.
1401
- #
1402
- # metadata = op.metadata
1403
- # # Process the metadata.
1404
- # end
1405
- #
1406
- # # Or use the return value to register a callback.
1407
- # operation.on_done do |op|
1408
- # raise op.results.message if op.error?
1409
- # op_results = op.results
1410
- # # Process the results.
1411
- #
1412
- # metadata = op.metadata
1413
- # # Process the metadata.
1414
- # end
1415
- #
1416
- # # Manually reload the operation.
1417
- # operation.reload!
1418
- #
1419
- # # Or block until the operation completes, triggering callbacks on
1420
- # # completion.
1421
- # operation.wait_until_done!
1422
-
1423
- def export_model \
1424
- name,
1425
- output_config,
1426
- options: nil
1427
- req = {
1428
- name: name,
1429
- output_config: output_config
1430
- }.delete_if { |_, v| v.nil? }
1431
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportModelRequest)
1432
- operation = Google::Gax::Operation.new(
1433
- @export_model.call(req, options),
1434
- @operations_client,
1435
- Google::Protobuf::Empty,
1436
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1437
- call_options: options
1438
- )
1439
- operation.on_done { |operation| yield(operation) } if block_given?
1440
- operation
1441
- end
1442
-
1443
- # Exports examples on which the model was evaluated (i.e. which were in the
1444
- # TEST set of the dataset the model was created from), together with their
1445
- # ground truth annotations and the annotations created (predicted) by the
1446
- # model.
1447
- # The examples, ground truth and predictions are exported in the state
1448
- # they were at the moment the model was evaluated.
1449
- #
1450
- # This export is available only for 30 days since the model evaluation is
1451
- # created.
1452
- #
1453
- # Currently only available for Tables.
1454
- #
1455
- # Returns an empty response in the
1456
- # {Google::Longrunning::Operation#response response} field when it completes.
1457
- #
1458
- # @param name [String]
1459
- # Required. The resource name of the model whose evaluated examples are to
1460
- # be exported.
1461
- # @param output_config [Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesOutputConfig | Hash]
1462
- # Required. The desired output location and configuration.
1463
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesOutputConfig`
1464
- # can also be provided.
1465
- # @param options [Google::Gax::CallOptions]
1466
- # Overrides the default settings for this call, e.g, timeout,
1467
- # retries, etc.
1468
- # @return [Google::Gax::Operation]
1469
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1470
- # @example
1471
- # require "google/cloud/automl"
1472
- #
1473
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1474
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1475
- #
1476
- # # TODO: Initialize `output_config`:
1477
- # output_config = {}
1478
- #
1479
- # # Register a callback during the method call.
1480
- # operation = automl_client.export_evaluated_examples(formatted_name, output_config) do |op|
1481
- # raise op.results.message if op.error?
1482
- # op_results = op.results
1483
- # # Process the results.
1484
- #
1485
- # metadata = op.metadata
1486
- # # Process the metadata.
1487
- # end
1488
- #
1489
- # # Or use the return value to register a callback.
1490
- # operation.on_done do |op|
1491
- # raise op.results.message if op.error?
1492
- # op_results = op.results
1493
- # # Process the results.
1494
- #
1495
- # metadata = op.metadata
1496
- # # Process the metadata.
1497
- # end
1498
- #
1499
- # # Manually reload the operation.
1500
- # operation.reload!
1501
- #
1502
- # # Or block until the operation completes, triggering callbacks on
1503
- # # completion.
1504
- # operation.wait_until_done!
1505
-
1506
- def export_evaluated_examples \
1507
- name,
1508
- output_config,
1509
- options: nil
1510
- req = {
1511
- name: name,
1512
- output_config: output_config
1513
- }.delete_if { |_, v| v.nil? }
1514
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest)
1515
- operation = Google::Gax::Operation.new(
1516
- @export_evaluated_examples.call(req, options),
1517
- @operations_client,
1518
- Google::Protobuf::Empty,
1519
- Google::Cloud::AutoML::V1beta1::OperationMetadata,
1520
- call_options: options
1521
- )
1522
- operation.on_done { |operation| yield(operation) } if block_given?
1523
- operation
1524
- end
1525
-
1526
- # Lists model evaluations.
1527
- #
1528
- # @param parent [String]
1529
- # Required. Resource name of the model to list the model evaluations for.
1530
- # If modelId is set as "-", this will list model evaluations from across all
1531
- # models of the parent location.
1532
- # @param filter [String]
1533
- # An expression for filtering the results of the request.
1534
- #
1535
- # * `annotation_spec_id` - for =, != or existence. See example below for
1536
- # the last.
1537
- #
1538
- # Some examples of using the filter are:
1539
- #
1540
- # * `annotation_spec_id!=4` --> The model evaluation was done for
1541
- # annotation spec with ID different than 4.
1542
- # * `NOT annotation_spec_id:*` --> The model evaluation was done for
1543
- # aggregate of all annotation specs.
1544
- # @param page_size [Integer]
1545
- # The maximum number of resources contained in the underlying API
1546
- # response. If page streaming is performed per-resource, this
1547
- # parameter does not affect the return value. If page streaming is
1548
- # performed per-page, this determines the maximum number of
1549
- # resources in a page.
1550
- # @param options [Google::Gax::CallOptions]
1551
- # Overrides the default settings for this call, e.g, timeout,
1552
- # retries, etc.
1553
- # @yield [result, operation] Access the result along with the RPC operation
1554
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
1555
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1556
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>]
1557
- # An enumerable of Google::Cloud::AutoML::V1beta1::ModelEvaluation instances.
1558
- # See Google::Gax::PagedEnumerable documentation for other
1559
- # operations such as per-page iteration or access to the response
1560
- # object.
1561
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1562
- # @example
1563
- # require "google/cloud/automl"
1564
- #
1565
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1566
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
1567
- #
1568
- # # Iterate over all results.
1569
- # automl_client.list_model_evaluations(formatted_parent).each do |element|
1570
- # # Process element.
1571
- # end
1572
- #
1573
- # # Or iterate over results one page at a time.
1574
- # automl_client.list_model_evaluations(formatted_parent).each_page do |page|
1575
- # # Process each page at a time.
1576
- # page.each do |element|
1577
- # # Process element.
1578
- # end
1579
- # end
1580
-
1581
- def list_model_evaluations \
1582
- parent,
1583
- filter: nil,
1584
- page_size: nil,
1585
- options: nil,
1586
- &block
1587
- req = {
1588
- parent: parent,
1589
- filter: filter,
1590
- page_size: page_size
1591
- }.delete_if { |_, v| v.nil? }
1592
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest)
1593
- @list_model_evaluations.call(req, options, &block)
1594
- end
1595
-
1596
- # Gets an annotation spec.
1597
- #
1598
- # @param name [String]
1599
- # Required. The resource name of the annotation spec to retrieve.
1600
- # @param options [Google::Gax::CallOptions]
1601
- # Overrides the default settings for this call, e.g, timeout,
1602
- # retries, etc.
1603
- # @yield [result, operation] Access the result along with the RPC operation
1604
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
1605
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1606
- # @return [Google::Cloud::AutoML::V1beta1::AnnotationSpec]
1607
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1608
- # @example
1609
- # require "google/cloud/automl"
1610
- #
1611
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1612
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.annotation_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
1613
- # response = automl_client.get_annotation_spec(formatted_name)
1614
-
1615
- def get_annotation_spec \
1616
- name,
1617
- options: nil,
1618
- &block
1619
- req = {
1620
- name: name
1621
- }.delete_if { |_, v| v.nil? }
1622
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest)
1623
- @get_annotation_spec.call(req, options, &block)
1624
- end
1625
-
1626
- # Gets a table spec.
1627
- #
1628
- # @param name [String]
1629
- # Required. The resource name of the table spec to retrieve.
1630
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1631
- # Mask specifying which fields to read.
1632
- # A hash of the same form as `Google::Protobuf::FieldMask`
1633
- # can also be provided.
1634
- # @param options [Google::Gax::CallOptions]
1635
- # Overrides the default settings for this call, e.g, timeout,
1636
- # retries, etc.
1637
- # @yield [result, operation] Access the result along with the RPC operation
1638
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::TableSpec]
1639
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1640
- # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
1641
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1642
- # @example
1643
- # require "google/cloud/automl"
1644
- #
1645
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1646
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.table_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
1647
- # response = automl_client.get_table_spec(formatted_name)
1648
-
1649
- def get_table_spec \
1650
- name,
1651
- field_mask: nil,
1652
- options: nil,
1653
- &block
1654
- req = {
1655
- name: name,
1656
- field_mask: field_mask
1657
- }.delete_if { |_, v| v.nil? }
1658
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetTableSpecRequest)
1659
- @get_table_spec.call(req, options, &block)
1660
- end
1661
-
1662
- # Lists table specs in a dataset.
1663
- #
1664
- # @param parent [String]
1665
- # Required. The resource name of the dataset to list table specs from.
1666
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1667
- # Mask specifying which fields to read.
1668
- # A hash of the same form as `Google::Protobuf::FieldMask`
1669
- # can also be provided.
1670
- # @param filter [String]
1671
- # Filter expression, see go/filtering.
1672
- # @param page_size [Integer]
1673
- # The maximum number of resources contained in the underlying API
1674
- # response. If page streaming is performed per-resource, this
1675
- # parameter does not affect the return value. If page streaming is
1676
- # performed per-page, this determines the maximum number of
1677
- # resources in a page.
1678
- # @param options [Google::Gax::CallOptions]
1679
- # Overrides the default settings for this call, e.g, timeout,
1680
- # retries, etc.
1681
- # @yield [result, operation] Access the result along with the RPC operation
1682
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
1683
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1684
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>]
1685
- # An enumerable of Google::Cloud::AutoML::V1beta1::TableSpec instances.
1686
- # See Google::Gax::PagedEnumerable documentation for other
1687
- # operations such as per-page iteration or access to the response
1688
- # object.
1689
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1690
- # @example
1691
- # require "google/cloud/automl"
1692
- #
1693
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1694
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]")
1695
- #
1696
- # # Iterate over all results.
1697
- # automl_client.list_table_specs(formatted_parent).each do |element|
1698
- # # Process element.
1699
- # end
1700
- #
1701
- # # Or iterate over results one page at a time.
1702
- # automl_client.list_table_specs(formatted_parent).each_page do |page|
1703
- # # Process each page at a time.
1704
- # page.each do |element|
1705
- # # Process element.
1706
- # end
1707
- # end
1708
-
1709
- def list_table_specs \
1710
- parent,
1711
- field_mask: nil,
1712
- filter: nil,
1713
- page_size: nil,
1714
- options: nil,
1715
- &block
1716
- req = {
1717
- parent: parent,
1718
- field_mask: field_mask,
1719
- filter: filter,
1720
- page_size: page_size
1721
- }.delete_if { |_, v| v.nil? }
1722
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest)
1723
- @list_table_specs.call(req, options, &block)
1724
- end
1725
-
1726
- # Updates a table spec.
1727
- #
1728
- # @param table_spec [Google::Cloud::AutoML::V1beta1::TableSpec | Hash]
1729
- # Required. The table spec which replaces the resource on the server.
1730
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::TableSpec`
1731
- # can also be provided.
1732
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1733
- # The update mask applies to the resource.
1734
- # A hash of the same form as `Google::Protobuf::FieldMask`
1735
- # can also be provided.
1736
- # @param options [Google::Gax::CallOptions]
1737
- # Overrides the default settings for this call, e.g, timeout,
1738
- # retries, etc.
1739
- # @yield [result, operation] Access the result along with the RPC operation
1740
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::TableSpec]
1741
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1742
- # @return [Google::Cloud::AutoML::V1beta1::TableSpec]
1743
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1744
- # @example
1745
- # require "google/cloud/automl"
1746
- #
1747
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1748
- #
1749
- # # TODO: Initialize `table_spec`:
1750
- # table_spec = {}
1751
- # response = automl_client.update_table_spec(table_spec)
1752
-
1753
- def update_table_spec \
1754
- table_spec,
1755
- update_mask: nil,
1756
- options: nil,
1757
- &block
1758
- req = {
1759
- table_spec: table_spec,
1760
- update_mask: update_mask
1761
- }.delete_if { |_, v| v.nil? }
1762
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest)
1763
- @update_table_spec.call(req, options, &block)
1764
- end
1765
-
1766
- # Gets a column spec.
1767
- #
1768
- # @param name [String]
1769
- # Required. The resource name of the column spec to retrieve.
1770
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1771
- # Mask specifying which fields to read.
1772
- # A hash of the same form as `Google::Protobuf::FieldMask`
1773
- # can also be provided.
1774
- # @param options [Google::Gax::CallOptions]
1775
- # Overrides the default settings for this call, e.g, timeout,
1776
- # retries, etc.
1777
- # @yield [result, operation] Access the result along with the RPC operation
1778
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1779
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1780
- # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1781
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1782
- # @example
1783
- # require "google/cloud/automl"
1784
- #
1785
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1786
- # formatted_name = Google::Cloud::AutoML::V1beta1::AutoMLClient.column_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]")
1787
- # response = automl_client.get_column_spec(formatted_name)
1788
-
1789
- def get_column_spec \
1790
- name,
1791
- field_mask: nil,
1792
- options: nil,
1793
- &block
1794
- req = {
1795
- name: name,
1796
- field_mask: field_mask
1797
- }.delete_if { |_, v| v.nil? }
1798
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest)
1799
- @get_column_spec.call(req, options, &block)
1800
- end
1801
-
1802
- # Lists column specs in a table spec.
1803
- #
1804
- # @param parent [String]
1805
- # Required. The resource name of the table spec to list column specs from.
1806
- # @param field_mask [Google::Protobuf::FieldMask | Hash]
1807
- # Mask specifying which fields to read.
1808
- # A hash of the same form as `Google::Protobuf::FieldMask`
1809
- # can also be provided.
1810
- # @param filter [String]
1811
- # Filter expression, see go/filtering.
1812
- # @param page_size [Integer]
1813
- # The maximum number of resources contained in the underlying API
1814
- # response. If page streaming is performed per-resource, this
1815
- # parameter does not affect the return value. If page streaming is
1816
- # performed per-page, this determines the maximum number of
1817
- # resources in a page.
1818
- # @param options [Google::Gax::CallOptions]
1819
- # Overrides the default settings for this call, e.g, timeout,
1820
- # retries, etc.
1821
- # @yield [result, operation] Access the result along with the RPC operation
1822
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1823
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1824
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>]
1825
- # An enumerable of Google::Cloud::AutoML::V1beta1::ColumnSpec instances.
1826
- # See Google::Gax::PagedEnumerable documentation for other
1827
- # operations such as per-page iteration or access to the response
1828
- # object.
1829
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1830
- # @example
1831
- # require "google/cloud/automl"
1832
- #
1833
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1834
- # formatted_parent = Google::Cloud::AutoML::V1beta1::AutoMLClient.table_spec_path("[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]")
1835
- #
1836
- # # Iterate over all results.
1837
- # automl_client.list_column_specs(formatted_parent).each do |element|
1838
- # # Process element.
1839
- # end
1840
- #
1841
- # # Or iterate over results one page at a time.
1842
- # automl_client.list_column_specs(formatted_parent).each_page do |page|
1843
- # # Process each page at a time.
1844
- # page.each do |element|
1845
- # # Process element.
1846
- # end
1847
- # end
1848
-
1849
- def list_column_specs \
1850
- parent,
1851
- field_mask: nil,
1852
- filter: nil,
1853
- page_size: nil,
1854
- options: nil,
1855
- &block
1856
- req = {
1857
- parent: parent,
1858
- field_mask: field_mask,
1859
- filter: filter,
1860
- page_size: page_size
1861
- }.delete_if { |_, v| v.nil? }
1862
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest)
1863
- @list_column_specs.call(req, options, &block)
1864
- end
1865
-
1866
- # Updates a column spec.
1867
- #
1868
- # @param column_spec [Google::Cloud::AutoML::V1beta1::ColumnSpec | Hash]
1869
- # Required. The column spec which replaces the resource on the server.
1870
- # A hash of the same form as `Google::Cloud::AutoML::V1beta1::ColumnSpec`
1871
- # can also be provided.
1872
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1873
- # The update mask applies to the resource.
1874
- # A hash of the same form as `Google::Protobuf::FieldMask`
1875
- # can also be provided.
1876
- # @param options [Google::Gax::CallOptions]
1877
- # Overrides the default settings for this call, e.g, timeout,
1878
- # retries, etc.
1879
- # @yield [result, operation] Access the result along with the RPC operation
1880
- # @yieldparam result [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1881
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1882
- # @return [Google::Cloud::AutoML::V1beta1::ColumnSpec]
1883
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1884
- # @example
1885
- # require "google/cloud/automl"
1886
- #
1887
- # automl_client = Google::Cloud::AutoML::AutoML.new(version: :v1beta1)
1888
- #
1889
- # # TODO: Initialize `column_spec`:
1890
- # column_spec = {}
1891
- # response = automl_client.update_column_spec(column_spec)
1892
-
1893
- def update_column_spec \
1894
- column_spec,
1895
- update_mask: nil,
1896
- options: nil,
1897
- &block
1898
- req = {
1899
- column_spec: column_spec,
1900
- update_mask: update_mask
1901
- }.delete_if { |_, v| v.nil? }
1902
- req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest)
1903
- @update_column_spec.call(req, options, &block)
1904
- end
1905
- end
1906
- end
1907
- end
1908
- end
1909
- end