google-cloud-automl-v1beta1 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +1 -1
- data/lib/google/cloud/automl/v1beta1.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/automl.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/automl/client.rb +488 -488
- data/lib/google/cloud/automl/v1beta1/automl/credentials.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/automl/operations.rb +100 -100
- data/lib/google/cloud/automl/v1beta1/automl/paths.rb +25 -25
- data/lib/google/cloud/automl/v1beta1/prediction_service.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +78 -78
- data/lib/google/cloud/automl/v1beta1/prediction_service/credentials.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +100 -100
- data/lib/google/cloud/automl/v1beta1/prediction_service/paths.rb +3 -3
- data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/automl/v1beta1/annotation_payload.rb +13 -13
- data/proto_docs/google/cloud/automl/v1beta1/annotation_spec.rb +5 -5
- data/proto_docs/google/cloud/automl/v1beta1/classification.rb +43 -43
- data/proto_docs/google/cloud/automl/v1beta1/column_spec.rb +12 -12
- data/proto_docs/google/cloud/automl/v1beta1/data_items.rb +49 -49
- data/proto_docs/google/cloud/automl/v1beta1/data_stats.rb +65 -65
- data/proto_docs/google/cloud/automl/v1beta1/data_types.rb +23 -23
- data/proto_docs/google/cloud/automl/v1beta1/dataset.rb +17 -17
- data/proto_docs/google/cloud/automl/v1beta1/detection.rb +32 -32
- data/proto_docs/google/cloud/automl/v1beta1/geometry.rb +7 -7
- data/proto_docs/google/cloud/automl/v1beta1/image.rb +38 -38
- data/proto_docs/google/cloud/automl/v1beta1/io.rb +85 -85
- data/proto_docs/google/cloud/automl/v1beta1/model.rb +17 -17
- data/proto_docs/google/cloud/automl/v1beta1/model_evaluation.rb +17 -17
- data/proto_docs/google/cloud/automl/v1beta1/operations.rb +56 -56
- data/proto_docs/google/cloud/automl/v1beta1/prediction_service.rb +41 -41
- data/proto_docs/google/cloud/automl/v1beta1/ranges.rb +4 -4
- data/proto_docs/google/cloud/automl/v1beta1/regression.rb +7 -7
- data/proto_docs/google/cloud/automl/v1beta1/service.rb +167 -167
- data/proto_docs/google/cloud/automl/v1beta1/table_spec.rb +9 -9
- data/proto_docs/google/cloud/automl/v1beta1/tables.rb +47 -47
- data/proto_docs/google/cloud/automl/v1beta1/temporal.rb +4 -4
- data/proto_docs/google/cloud/automl/v1beta1/text.rb +15 -15
- data/proto_docs/google/cloud/automl/v1beta1/text_extraction.rb +14 -14
- data/proto_docs/google/cloud/automl/v1beta1/text_segment.rb +5 -5
- data/proto_docs/google/cloud/automl/v1beta1/text_sentiment.rb +15 -15
- data/proto_docs/google/cloud/automl/v1beta1/translation.rb +16 -16
- data/proto_docs/google/cloud/automl/v1beta1/video.rb +8 -8
- data/proto_docs/google/longrunning/operations.rb +30 -30
- data/proto_docs/google/protobuf/any.rb +4 -4
- data/proto_docs/google/protobuf/duration.rb +4 -4
- data/proto_docs/google/protobuf/empty.rb +2 -2
- data/proto_docs/google/protobuf/field_mask.rb +3 -3
- data/proto_docs/google/protobuf/struct.rb +18 -18
- data/proto_docs/google/protobuf/timestamp.rb +4 -4
- data/proto_docs/google/rpc/status.rb +6 -6
- metadata +2 -2
@@ -36,11 +36,11 @@ module Google
|
|
36
36
|
# @param dataset [String]
|
37
37
|
# @param annotation_spec [String]
|
38
38
|
#
|
39
|
-
# @return [String]
|
39
|
+
# @return [::String]
|
40
40
|
def annotation_spec_path project:, location:, dataset:, annotation_spec:
|
41
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
42
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
43
|
-
raise ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
42
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
43
|
+
raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
44
44
|
|
45
45
|
"projects/#{project}/locations/#{location}/datasets/#{dataset}/annotationSpecs/#{annotation_spec}"
|
46
46
|
end
|
@@ -58,12 +58,12 @@ module Google
|
|
58
58
|
# @param table_spec [String]
|
59
59
|
# @param column_spec [String]
|
60
60
|
#
|
61
|
-
# @return [String]
|
61
|
+
# @return [::String]
|
62
62
|
def column_spec_path project:, location:, dataset:, table_spec:, column_spec:
|
63
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
64
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
65
|
-
raise ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
66
|
-
raise ArgumentError, "table_spec cannot contain /" if table_spec.to_s.include? "/"
|
63
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
64
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
65
|
+
raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
66
|
+
raise ::ArgumentError, "table_spec cannot contain /" if table_spec.to_s.include? "/"
|
67
67
|
|
68
68
|
"projects/#{project}/locations/#{location}/datasets/#{dataset}/tableSpecs/#{table_spec}/columnSpecs/#{column_spec}"
|
69
69
|
end
|
@@ -79,10 +79,10 @@ module Google
|
|
79
79
|
# @param location [String]
|
80
80
|
# @param dataset [String]
|
81
81
|
#
|
82
|
-
# @return [String]
|
82
|
+
# @return [::String]
|
83
83
|
def dataset_path project:, location:, dataset:
|
84
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
85
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
84
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
85
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
86
86
|
|
87
87
|
"projects/#{project}/locations/#{location}/datasets/#{dataset}"
|
88
88
|
end
|
@@ -97,9 +97,9 @@ module Google
|
|
97
97
|
# @param project [String]
|
98
98
|
# @param location [String]
|
99
99
|
#
|
100
|
-
# @return [String]
|
100
|
+
# @return [::String]
|
101
101
|
def location_path project:, location:
|
102
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
102
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
103
103
|
|
104
104
|
"projects/#{project}/locations/#{location}"
|
105
105
|
end
|
@@ -115,10 +115,10 @@ module Google
|
|
115
115
|
# @param location [String]
|
116
116
|
# @param model [String]
|
117
117
|
#
|
118
|
-
# @return [String]
|
118
|
+
# @return [::String]
|
119
119
|
def model_path project:, location:, model:
|
120
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
121
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
120
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
121
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
122
122
|
|
123
123
|
"projects/#{project}/locations/#{location}/models/#{model}"
|
124
124
|
end
|
@@ -135,11 +135,11 @@ module Google
|
|
135
135
|
# @param model [String]
|
136
136
|
# @param model_evaluation [String]
|
137
137
|
#
|
138
|
-
# @return [String]
|
138
|
+
# @return [::String]
|
139
139
|
def model_evaluation_path project:, location:, model:, model_evaluation:
|
140
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
141
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
142
|
-
raise ArgumentError, "model cannot contain /" if model.to_s.include? "/"
|
140
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
141
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
142
|
+
raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/"
|
143
143
|
|
144
144
|
"projects/#{project}/locations/#{location}/models/#{model}/modelEvaluations/#{model_evaluation}"
|
145
145
|
end
|
@@ -156,11 +156,11 @@ module Google
|
|
156
156
|
# @param dataset [String]
|
157
157
|
# @param table_spec [String]
|
158
158
|
#
|
159
|
-
# @return [String]
|
159
|
+
# @return [::String]
|
160
160
|
def table_spec_path project:, location:, dataset:, table_spec:
|
161
|
-
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
162
|
-
raise ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
163
|
-
raise ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
161
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
162
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
163
|
+
raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
164
164
|
|
165
165
|
"projects/#{project}/locations/#{location}/datasets/#{dataset}/tableSpecs/#{table_spec}"
|
166
166
|
end
|
@@ -40,7 +40,7 @@ module Google
|
|
40
40
|
# To load this service and instantiate a client:
|
41
41
|
#
|
42
42
|
# require "google/cloud/automl/v1beta1/prediction_service"
|
43
|
-
# client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
43
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
44
44
|
#
|
45
45
|
module PredictionService
|
46
46
|
end
|
@@ -41,15 +41,15 @@ module Google
|
|
41
41
|
##
|
42
42
|
# Configure the PredictionService Client class.
|
43
43
|
#
|
44
|
-
# See {Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration}
|
44
|
+
# See {::Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration}
|
45
45
|
# for a description of the configuration fields.
|
46
46
|
#
|
47
47
|
# ## Example
|
48
48
|
#
|
49
49
|
# To modify the configuration for all PredictionService clients:
|
50
50
|
#
|
51
|
-
# Google::Cloud::AutoML::V1beta1::PredictionService::Client.configure do |config|
|
52
|
-
# config.timeout =
|
51
|
+
# ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.configure do |config|
|
52
|
+
# config.timeout = 10.0
|
53
53
|
# end
|
54
54
|
#
|
55
55
|
# @yield [config] Configure the Client client.
|
@@ -85,7 +85,7 @@ module Google
|
|
85
85
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
86
86
|
# should be made on {Client.configure}.
|
87
87
|
#
|
88
|
-
# See {Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration}
|
88
|
+
# See {::Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration}
|
89
89
|
# for a description of the configuration fields.
|
90
90
|
#
|
91
91
|
# @yield [config] Configure the Client client.
|
@@ -106,13 +106,13 @@ module Google
|
|
106
106
|
# To create a new PredictionService client with the default
|
107
107
|
# configuration:
|
108
108
|
#
|
109
|
-
# client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
109
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
110
110
|
#
|
111
111
|
# To create a new PredictionService client with a custom
|
112
112
|
# configuration:
|
113
113
|
#
|
114
|
-
# client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config|
|
115
|
-
# config.timeout =
|
114
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config|
|
115
|
+
# config.timeout = 10.0
|
116
116
|
# end
|
117
117
|
#
|
118
118
|
# @yield [config] Configure the PredictionService client.
|
@@ -144,8 +144,8 @@ module Google
|
|
144
144
|
config.endpoint = @config.endpoint
|
145
145
|
end
|
146
146
|
|
147
|
-
@prediction_service_stub = Gapic::ServiceStub.new(
|
148
|
-
Google::Cloud::AutoML::V1beta1::PredictionService::Stub,
|
147
|
+
@prediction_service_stub = ::Gapic::ServiceStub.new(
|
148
|
+
::Google::Cloud::AutoML::V1beta1::PredictionService::Stub,
|
149
149
|
credentials: credentials,
|
150
150
|
endpoint: @config.endpoint,
|
151
151
|
channel_args: @config.channel_args,
|
@@ -156,7 +156,7 @@ module Google
|
|
156
156
|
##
|
157
157
|
# Get the associated client for long-running operations.
|
158
158
|
#
|
159
|
-
# @return [Google::Cloud::AutoML::V1beta1::PredictionService::Operations]
|
159
|
+
# @return [::Google::Cloud::AutoML::V1beta1::PredictionService::Operations]
|
160
160
|
#
|
161
161
|
attr_reader :operations_client
|
162
162
|
|
@@ -185,12 +185,12 @@ module Google
|
|
185
185
|
#
|
186
186
|
# @overload predict(request, options = nil)
|
187
187
|
# Pass arguments to `predict` via a request object, either of type
|
188
|
-
# {Google::Cloud::AutoML::V1beta1::PredictRequest} or an equivalent Hash.
|
188
|
+
# {::Google::Cloud::AutoML::V1beta1::PredictRequest} or an equivalent Hash.
|
189
189
|
#
|
190
|
-
# @param request [Google::Cloud::AutoML::V1beta1::PredictRequest, Hash]
|
190
|
+
# @param request [::Google::Cloud::AutoML::V1beta1::PredictRequest, ::Hash]
|
191
191
|
# A request object representing the call parameters. Required. To specify no
|
192
192
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
193
|
-
# @param options [Gapic::CallOptions, Hash]
|
193
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
194
194
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
195
195
|
#
|
196
196
|
# @overload predict(name: nil, payload: nil, params: nil)
|
@@ -198,12 +198,12 @@ module Google
|
|
198
198
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
199
199
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
200
200
|
#
|
201
|
-
# @param name [String]
|
201
|
+
# @param name [::String]
|
202
202
|
# Required. Name of the model requested to serve the prediction.
|
203
|
-
# @param payload [Google::Cloud::AutoML::V1beta1::ExamplePayload, Hash]
|
203
|
+
# @param payload [::Google::Cloud::AutoML::V1beta1::ExamplePayload, ::Hash]
|
204
204
|
# Required. Payload to perform a prediction on. The payload must match the
|
205
205
|
# problem type that the model was trained to solve.
|
206
|
-
# @param params [Hash{String => String}]
|
206
|
+
# @param params [::Hash{::String => ::String}]
|
207
207
|
# Additional domain-specific parameters, any string must be up to 25000
|
208
208
|
# characters long.
|
209
209
|
#
|
@@ -226,26 +226,26 @@ module Google
|
|
226
226
|
# The default is false.
|
227
227
|
#
|
228
228
|
# @yield [response, operation] Access the result along with the RPC operation
|
229
|
-
# @yieldparam response [Google::Cloud::AutoML::V1beta1::PredictResponse]
|
230
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
229
|
+
# @yieldparam response [::Google::Cloud::AutoML::V1beta1::PredictResponse]
|
230
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
231
231
|
#
|
232
|
-
# @return [Google::Cloud::AutoML::V1beta1::PredictResponse]
|
232
|
+
# @return [::Google::Cloud::AutoML::V1beta1::PredictResponse]
|
233
233
|
#
|
234
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
234
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
235
235
|
#
|
236
236
|
def predict request, options = nil
|
237
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
237
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
238
238
|
|
239
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::PredictRequest
|
239
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::PredictRequest
|
240
240
|
|
241
241
|
# Converts hash and nil to an options object
|
242
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
242
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
243
243
|
|
244
244
|
# Customize the options with defaults
|
245
245
|
metadata = @config.rpcs.predict.metadata.to_h
|
246
246
|
|
247
247
|
# Set x-goog-api-client and x-goog-user-project headers
|
248
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
248
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
249
249
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
250
250
|
gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
|
251
251
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -266,17 +266,17 @@ module Google
|
|
266
266
|
yield response, operation if block_given?
|
267
267
|
return response
|
268
268
|
end
|
269
|
-
rescue GRPC::BadStatus => e
|
270
|
-
raise Google::Cloud::Error.from_error(e)
|
269
|
+
rescue ::GRPC::BadStatus => e
|
270
|
+
raise ::Google::Cloud::Error.from_error(e)
|
271
271
|
end
|
272
272
|
|
273
273
|
##
|
274
|
-
# Perform a batch prediction. Unlike the online {Google::Cloud::AutoML::V1beta1::PredictionService::Client#predict Predict}, batch
|
274
|
+
# Perform a batch prediction. Unlike the online {::Google::Cloud::AutoML::V1beta1::PredictionService::Client#predict Predict}, batch
|
275
275
|
# prediction result won't be immediately available in the response. Instead,
|
276
276
|
# a long running operation object is returned. User can poll the operation
|
277
277
|
# result via GetOperation
|
278
|
-
# method. Once the operation is done, {Google::Cloud::AutoML::V1beta1::BatchPredictResult BatchPredictResult} is returned in
|
279
|
-
# the {Google::Longrunning::Operation#response response} field.
|
278
|
+
# method. Once the operation is done, {::Google::Cloud::AutoML::V1beta1::BatchPredictResult BatchPredictResult} is returned in
|
279
|
+
# the {::Google::Longrunning::Operation#response response} field.
|
280
280
|
# Available for following ML problems:
|
281
281
|
# * Image Classification
|
282
282
|
# * Image Object Detection
|
@@ -286,12 +286,12 @@ module Google
|
|
286
286
|
#
|
287
287
|
# @overload batch_predict(request, options = nil)
|
288
288
|
# Pass arguments to `batch_predict` via a request object, either of type
|
289
|
-
# {Google::Cloud::AutoML::V1beta1::BatchPredictRequest} or an equivalent Hash.
|
289
|
+
# {::Google::Cloud::AutoML::V1beta1::BatchPredictRequest} or an equivalent Hash.
|
290
290
|
#
|
291
|
-
# @param request [Google::Cloud::AutoML::V1beta1::BatchPredictRequest, Hash]
|
291
|
+
# @param request [::Google::Cloud::AutoML::V1beta1::BatchPredictRequest, ::Hash]
|
292
292
|
# A request object representing the call parameters. Required. To specify no
|
293
293
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
294
|
-
# @param options [Gapic::CallOptions, Hash]
|
294
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
295
295
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
296
296
|
#
|
297
297
|
# @overload batch_predict(name: nil, input_config: nil, output_config: nil, params: nil)
|
@@ -299,14 +299,14 @@ module Google
|
|
299
299
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
300
300
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
301
301
|
#
|
302
|
-
# @param name [String]
|
302
|
+
# @param name [::String]
|
303
303
|
# Required. Name of the model requested to serve the batch prediction.
|
304
|
-
# @param input_config [Google::Cloud::AutoML::V1beta1::BatchPredictInputConfig, Hash]
|
304
|
+
# @param input_config [::Google::Cloud::AutoML::V1beta1::BatchPredictInputConfig, ::Hash]
|
305
305
|
# Required. The input configuration for batch prediction.
|
306
|
-
# @param output_config [Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig, Hash]
|
306
|
+
# @param output_config [::Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig, ::Hash]
|
307
307
|
# Required. The Configuration specifying where output predictions should
|
308
308
|
# be written.
|
309
|
-
# @param params [Hash{String => String}]
|
309
|
+
# @param params [::Hash{::String => ::String}]
|
310
310
|
# Required. Additional domain-specific parameters for the predictions, any string must
|
311
311
|
# be up to 25000 characters long.
|
312
312
|
#
|
@@ -379,26 +379,26 @@ module Google
|
|
379
379
|
# returned. Value in 0 to 1 range. Default is 0.
|
380
380
|
#
|
381
381
|
# @yield [response, operation] Access the result along with the RPC operation
|
382
|
-
# @yieldparam response [Gapic::Operation]
|
383
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
382
|
+
# @yieldparam response [::Gapic::Operation]
|
383
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
384
384
|
#
|
385
|
-
# @return [Gapic::Operation]
|
385
|
+
# @return [::Gapic::Operation]
|
386
386
|
#
|
387
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
387
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
388
388
|
#
|
389
389
|
def batch_predict request, options = nil
|
390
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
390
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
391
391
|
|
392
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::AutoML::V1beta1::BatchPredictRequest
|
392
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AutoML::V1beta1::BatchPredictRequest
|
393
393
|
|
394
394
|
# Converts hash and nil to an options object
|
395
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
395
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
396
396
|
|
397
397
|
# Customize the options with defaults
|
398
398
|
metadata = @config.rpcs.batch_predict.metadata.to_h
|
399
399
|
|
400
400
|
# Set x-goog-api-client and x-goog-user-project headers
|
401
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
401
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
402
402
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
403
403
|
gapic_version: ::Google::Cloud::Automl::V1beta1::VERSION
|
404
404
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -416,12 +416,12 @@ module Google
|
|
416
416
|
retry_policy: @config.retry_policy
|
417
417
|
|
418
418
|
@prediction_service_stub.call_rpc :batch_predict, request, options: options do |response, operation|
|
419
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
419
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
420
420
|
yield response, operation if block_given?
|
421
421
|
return response
|
422
422
|
end
|
423
|
-
rescue GRPC::BadStatus => e
|
424
|
-
raise Google::Cloud::Error.from_error(e)
|
423
|
+
rescue ::GRPC::BadStatus => e
|
424
|
+
raise ::Google::Cloud::Error.from_error(e)
|
425
425
|
end
|
426
426
|
|
427
427
|
##
|
@@ -431,7 +431,7 @@ module Google
|
|
431
431
|
# providing control over timeouts, retry behavior, logging, transport
|
432
432
|
# parameters, and other low-level controls. Certain parameters can also be
|
433
433
|
# applied individually to specific RPCs. See
|
434
|
-
# {Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration::Rpcs}
|
434
|
+
# {::Google::Cloud::AutoML::V1beta1::PredictionService::Client::Configuration::Rpcs}
|
435
435
|
# for a list of RPCs that can be configured independently.
|
436
436
|
#
|
437
437
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -442,22 +442,22 @@ module Google
|
|
442
442
|
# To modify the global config, setting the timeout for predict
|
443
443
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
444
444
|
#
|
445
|
-
# Google::Cloud::AutoML::V1beta1::PredictionService::Client.configure do |config|
|
446
|
-
# config.timeout =
|
447
|
-
# config.rpcs.predict.timeout =
|
445
|
+
# ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.configure do |config|
|
446
|
+
# config.timeout = 10.0
|
447
|
+
# config.rpcs.predict.timeout = 20.0
|
448
448
|
# end
|
449
449
|
#
|
450
450
|
# To apply the above configuration only to a new client:
|
451
451
|
#
|
452
|
-
# client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config|
|
453
|
-
# config.timeout =
|
454
|
-
# config.rpcs.predict.timeout =
|
452
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new do |config|
|
453
|
+
# config.timeout = 10.0
|
454
|
+
# config.rpcs.predict.timeout = 20.0
|
455
455
|
# end
|
456
456
|
#
|
457
457
|
# @!attribute [rw] endpoint
|
458
458
|
# The hostname or hostname:port of the service endpoint.
|
459
459
|
# Defaults to `"automl.googleapis.com"`.
|
460
|
-
# @return [String]
|
460
|
+
# @return [::String]
|
461
461
|
# @!attribute [rw] credentials
|
462
462
|
# Credentials to send with calls. You may provide any of the following types:
|
463
463
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -469,29 +469,29 @@ module Google
|
|
469
469
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
470
470
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
471
471
|
# * (`nil`) indicating no credentials
|
472
|
-
# @return [Object]
|
472
|
+
# @return [::Object]
|
473
473
|
# @!attribute [rw] scope
|
474
474
|
# The OAuth scopes
|
475
|
-
# @return [Array
|
475
|
+
# @return [::Array<::String>]
|
476
476
|
# @!attribute [rw] lib_name
|
477
477
|
# The library name as recorded in instrumentation and logging
|
478
|
-
# @return [String]
|
478
|
+
# @return [::String]
|
479
479
|
# @!attribute [rw] lib_version
|
480
480
|
# The library version as recorded in instrumentation and logging
|
481
|
-
# @return [String]
|
481
|
+
# @return [::String]
|
482
482
|
# @!attribute [rw] channel_args
|
483
483
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
484
484
|
# `GRPC::Core::Channel` object is provided as the credential.
|
485
|
-
# @return [Hash]
|
485
|
+
# @return [::Hash]
|
486
486
|
# @!attribute [rw] interceptors
|
487
487
|
# An array of interceptors that are run before calls are executed.
|
488
|
-
# @return [Array
|
488
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
489
489
|
# @!attribute [rw] timeout
|
490
|
-
# The call timeout in
|
491
|
-
# @return [Numeric]
|
490
|
+
# The call timeout in seconds.
|
491
|
+
# @return [::Numeric]
|
492
492
|
# @!attribute [rw] metadata
|
493
493
|
# Additional gRPC headers to be sent with the call.
|
494
|
-
# @return [Hash{Symbol
|
494
|
+
# @return [::Hash{::Symbol=>::String}]
|
495
495
|
# @!attribute [rw] retry_policy
|
496
496
|
# The retry policy. The value is a hash with the following keys:
|
497
497
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -499,10 +499,10 @@ module Google
|
|
499
499
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
500
500
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
501
501
|
# trigger a retry.
|
502
|
-
# @return [Hash]
|
502
|
+
# @return [::Hash]
|
503
503
|
#
|
504
504
|
class Configuration
|
505
|
-
extend Gapic::Config
|
505
|
+
extend ::Gapic::Config
|
506
506
|
|
507
507
|
config_attr :endpoint, "automl.googleapis.com", String
|
508
508
|
config_attr :credentials, nil do |value|
|
@@ -510,14 +510,14 @@ module Google
|
|
510
510
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
511
511
|
allowed.any? { |klass| klass === value }
|
512
512
|
end
|
513
|
-
config_attr :scope, nil, String, Array, nil
|
514
|
-
config_attr :lib_name, nil, String, nil
|
515
|
-
config_attr :lib_version, nil, String, nil
|
516
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
517
|
-
config_attr :interceptors, nil, Array, nil
|
518
|
-
config_attr :timeout, nil, Numeric, nil
|
519
|
-
config_attr :metadata, nil, Hash, nil
|
520
|
-
config_attr :retry_policy, nil, Hash, Proc, nil
|
513
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
514
|
+
config_attr :lib_name, nil, ::String, nil
|
515
|
+
config_attr :lib_version, nil, ::String, nil
|
516
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
517
|
+
config_attr :interceptors, nil, ::Array, nil
|
518
|
+
config_attr :timeout, nil, ::Numeric, nil
|
519
|
+
config_attr :metadata, nil, ::Hash, nil
|
520
|
+
config_attr :retry_policy, nil, ::Hash, Proc, nil
|
521
521
|
|
522
522
|
# @private
|
523
523
|
def initialize parent_config = nil
|
@@ -558,21 +558,21 @@ module Google
|
|
558
558
|
class Rpcs
|
559
559
|
##
|
560
560
|
# RPC-specific configuration for `predict`
|
561
|
-
# @return [Gapic::Config::Method]
|
561
|
+
# @return [::Gapic::Config::Method]
|
562
562
|
#
|
563
563
|
attr_reader :predict
|
564
564
|
##
|
565
565
|
# RPC-specific configuration for `batch_predict`
|
566
|
-
# @return [Gapic::Config::Method]
|
566
|
+
# @return [::Gapic::Config::Method]
|
567
567
|
#
|
568
568
|
attr_reader :batch_predict
|
569
569
|
|
570
570
|
# @private
|
571
571
|
def initialize parent_rpcs = nil
|
572
572
|
predict_config = parent_rpcs&.predict if parent_rpcs&.respond_to? :predict
|
573
|
-
@predict = Gapic::Config::Method.new predict_config
|
573
|
+
@predict = ::Gapic::Config::Method.new predict_config
|
574
574
|
batch_predict_config = parent_rpcs&.batch_predict if parent_rpcs&.respond_to? :batch_predict
|
575
|
-
@batch_predict = Gapic::Config::Method.new batch_predict_config
|
575
|
+
@batch_predict = ::Gapic::Config::Method.new batch_predict_config
|
576
576
|
|
577
577
|
yield self if block_given?
|
578
578
|
end
|