google-cloud-language-v1 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +1 -1
- data/lib/google/cloud/language/v1/language_service/client.rb +139 -139
- data/lib/google/cloud/language/v1/language_service/credentials.rb +1 -1
- data/lib/google/cloud/language/v1/language_service.rb +1 -1
- data/lib/google/cloud/language/v1/version.rb +1 -1
- data/lib/google/cloud/language/v1.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/language/v1/language_service.rb +136 -136
- metadata +2 -2
@@ -37,15 +37,15 @@ module Google
|
|
37
37
|
##
|
38
38
|
# Configure the LanguageService Client class.
|
39
39
|
#
|
40
|
-
# See {Google::Cloud::Language::V1::LanguageService::Client::Configuration}
|
40
|
+
# See {::Google::Cloud::Language::V1::LanguageService::Client::Configuration}
|
41
41
|
# for a description of the configuration fields.
|
42
42
|
#
|
43
43
|
# ## Example
|
44
44
|
#
|
45
45
|
# To modify the configuration for all LanguageService clients:
|
46
46
|
#
|
47
|
-
# Google::Cloud::Language::V1::LanguageService::Client.configure do |config|
|
48
|
-
# config.timeout =
|
47
|
+
# ::Google::Cloud::Language::V1::LanguageService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
49
|
# end
|
50
50
|
#
|
51
51
|
# @yield [config] Configure the Client client.
|
@@ -125,7 +125,7 @@ module Google
|
|
125
125
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
126
126
|
# should be made on {Client.configure}.
|
127
127
|
#
|
128
|
-
# See {Google::Cloud::Language::V1::LanguageService::Client::Configuration}
|
128
|
+
# See {::Google::Cloud::Language::V1::LanguageService::Client::Configuration}
|
129
129
|
# for a description of the configuration fields.
|
130
130
|
#
|
131
131
|
# @yield [config] Configure the Client client.
|
@@ -146,13 +146,13 @@ module Google
|
|
146
146
|
# To create a new LanguageService client with the default
|
147
147
|
# configuration:
|
148
148
|
#
|
149
|
-
# client = Google::Cloud::Language::V1::LanguageService::Client.new
|
149
|
+
# client = ::Google::Cloud::Language::V1::LanguageService::Client.new
|
150
150
|
#
|
151
151
|
# To create a new LanguageService client with a custom
|
152
152
|
# configuration:
|
153
153
|
#
|
154
|
-
# client = Google::Cloud::Language::V1::LanguageService::Client.new do |config|
|
155
|
-
# config.timeout =
|
154
|
+
# client = ::Google::Cloud::Language::V1::LanguageService::Client.new do |config|
|
155
|
+
# config.timeout = 10.0
|
156
156
|
# end
|
157
157
|
#
|
158
158
|
# @yield [config] Configure the LanguageService client.
|
@@ -179,8 +179,8 @@ module Google
|
|
179
179
|
end
|
180
180
|
@quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
|
181
181
|
|
182
|
-
@language_service_stub = Gapic::ServiceStub.new(
|
183
|
-
Google::Cloud::Language::V1::LanguageService::Stub,
|
182
|
+
@language_service_stub = ::Gapic::ServiceStub.new(
|
183
|
+
::Google::Cloud::Language::V1::LanguageService::Stub,
|
184
184
|
credentials: credentials,
|
185
185
|
endpoint: @config.endpoint,
|
186
186
|
channel_args: @config.channel_args,
|
@@ -195,12 +195,12 @@ module Google
|
|
195
195
|
#
|
196
196
|
# @overload analyze_sentiment(request, options = nil)
|
197
197
|
# Pass arguments to `analyze_sentiment` via a request object, either of type
|
198
|
-
# {Google::Cloud::Language::V1::AnalyzeSentimentRequest} or an equivalent Hash.
|
198
|
+
# {::Google::Cloud::Language::V1::AnalyzeSentimentRequest} or an equivalent Hash.
|
199
199
|
#
|
200
|
-
# @param request [Google::Cloud::Language::V1::AnalyzeSentimentRequest, Hash]
|
200
|
+
# @param request [::Google::Cloud::Language::V1::AnalyzeSentimentRequest, ::Hash]
|
201
201
|
# A request object representing the call parameters. Required. To specify no
|
202
202
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
203
|
-
# @param options [Gapic::CallOptions, Hash]
|
203
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
204
204
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
205
205
|
#
|
206
206
|
# @overload analyze_sentiment(document: nil, encoding_type: nil)
|
@@ -208,32 +208,32 @@ module Google
|
|
208
208
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
209
209
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
210
210
|
#
|
211
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
211
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
212
212
|
# Input document.
|
213
|
-
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
213
|
+
# @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
|
214
214
|
# The encoding type used by the API to calculate sentence offsets.
|
215
215
|
#
|
216
216
|
# @yield [response, operation] Access the result along with the RPC operation
|
217
|
-
# @yieldparam response [Google::Cloud::Language::V1::AnalyzeSentimentResponse]
|
218
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
217
|
+
# @yieldparam response [::Google::Cloud::Language::V1::AnalyzeSentimentResponse]
|
218
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
219
219
|
#
|
220
|
-
# @return [Google::Cloud::Language::V1::AnalyzeSentimentResponse]
|
220
|
+
# @return [::Google::Cloud::Language::V1::AnalyzeSentimentResponse]
|
221
221
|
#
|
222
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
222
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
223
223
|
#
|
224
224
|
def analyze_sentiment request, options = nil
|
225
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
225
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
226
226
|
|
227
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::AnalyzeSentimentRequest
|
227
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::AnalyzeSentimentRequest
|
228
228
|
|
229
229
|
# Converts hash and nil to an options object
|
230
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
230
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
231
231
|
|
232
232
|
# Customize the options with defaults
|
233
233
|
metadata = @config.rpcs.analyze_sentiment.metadata.to_h
|
234
234
|
|
235
235
|
# Set x-goog-api-client and x-goog-user-project headers
|
236
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
236
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
237
237
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
238
238
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
239
239
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -248,8 +248,8 @@ module Google
|
|
248
248
|
yield response, operation if block_given?
|
249
249
|
return response
|
250
250
|
end
|
251
|
-
rescue GRPC::BadStatus => e
|
252
|
-
raise Google::Cloud::Error.from_error(e)
|
251
|
+
rescue ::GRPC::BadStatus => e
|
252
|
+
raise ::Google::Cloud::Error.from_error(e)
|
253
253
|
end
|
254
254
|
|
255
255
|
##
|
@@ -259,12 +259,12 @@ module Google
|
|
259
259
|
#
|
260
260
|
# @overload analyze_entities(request, options = nil)
|
261
261
|
# Pass arguments to `analyze_entities` via a request object, either of type
|
262
|
-
# {Google::Cloud::Language::V1::AnalyzeEntitiesRequest} or an equivalent Hash.
|
262
|
+
# {::Google::Cloud::Language::V1::AnalyzeEntitiesRequest} or an equivalent Hash.
|
263
263
|
#
|
264
|
-
# @param request [Google::Cloud::Language::V1::AnalyzeEntitiesRequest, Hash]
|
264
|
+
# @param request [::Google::Cloud::Language::V1::AnalyzeEntitiesRequest, ::Hash]
|
265
265
|
# A request object representing the call parameters. Required. To specify no
|
266
266
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
267
|
-
# @param options [Gapic::CallOptions, Hash]
|
267
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
268
268
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
269
269
|
#
|
270
270
|
# @overload analyze_entities(document: nil, encoding_type: nil)
|
@@ -272,32 +272,32 @@ module Google
|
|
272
272
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
273
273
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
274
274
|
#
|
275
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
275
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
276
276
|
# Input document.
|
277
|
-
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
277
|
+
# @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
|
278
278
|
# The encoding type used by the API to calculate offsets.
|
279
279
|
#
|
280
280
|
# @yield [response, operation] Access the result along with the RPC operation
|
281
|
-
# @yieldparam response [Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
|
282
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
281
|
+
# @yieldparam response [::Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
|
282
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
283
283
|
#
|
284
|
-
# @return [Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
|
284
|
+
# @return [::Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
|
285
285
|
#
|
286
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
286
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
287
287
|
#
|
288
288
|
def analyze_entities request, options = nil
|
289
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
289
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
290
290
|
|
291
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::AnalyzeEntitiesRequest
|
291
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::AnalyzeEntitiesRequest
|
292
292
|
|
293
293
|
# Converts hash and nil to an options object
|
294
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
294
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
295
295
|
|
296
296
|
# Customize the options with defaults
|
297
297
|
metadata = @config.rpcs.analyze_entities.metadata.to_h
|
298
298
|
|
299
299
|
# Set x-goog-api-client and x-goog-user-project headers
|
300
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
300
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
301
301
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
302
302
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
303
303
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -312,22 +312,22 @@ module Google
|
|
312
312
|
yield response, operation if block_given?
|
313
313
|
return response
|
314
314
|
end
|
315
|
-
rescue GRPC::BadStatus => e
|
316
|
-
raise Google::Cloud::Error.from_error(e)
|
315
|
+
rescue ::GRPC::BadStatus => e
|
316
|
+
raise ::Google::Cloud::Error.from_error(e)
|
317
317
|
end
|
318
318
|
|
319
319
|
##
|
320
|
-
# Finds entities, similar to {Google::Cloud::Language::V1::LanguageService::Client#analyze_entities AnalyzeEntities} in the text and analyzes
|
320
|
+
# Finds entities, similar to {::Google::Cloud::Language::V1::LanguageService::Client#analyze_entities AnalyzeEntities} in the text and analyzes
|
321
321
|
# sentiment associated with each entity and its mentions.
|
322
322
|
#
|
323
323
|
# @overload analyze_entity_sentiment(request, options = nil)
|
324
324
|
# Pass arguments to `analyze_entity_sentiment` via a request object, either of type
|
325
|
-
# {Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest} or an equivalent Hash.
|
325
|
+
# {::Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest} or an equivalent Hash.
|
326
326
|
#
|
327
|
-
# @param request [Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest, Hash]
|
327
|
+
# @param request [::Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest, ::Hash]
|
328
328
|
# A request object representing the call parameters. Required. To specify no
|
329
329
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
330
|
-
# @param options [Gapic::CallOptions, Hash]
|
330
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
331
331
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
332
332
|
#
|
333
333
|
# @overload analyze_entity_sentiment(document: nil, encoding_type: nil)
|
@@ -335,32 +335,32 @@ module Google
|
|
335
335
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
336
336
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
337
337
|
#
|
338
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
338
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
339
339
|
# Input document.
|
340
|
-
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
340
|
+
# @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
|
341
341
|
# The encoding type used by the API to calculate offsets.
|
342
342
|
#
|
343
343
|
# @yield [response, operation] Access the result along with the RPC operation
|
344
|
-
# @yieldparam response [Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
|
345
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
344
|
+
# @yieldparam response [::Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
|
345
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
346
346
|
#
|
347
|
-
# @return [Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
|
347
|
+
# @return [::Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
|
348
348
|
#
|
349
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
349
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
350
350
|
#
|
351
351
|
def analyze_entity_sentiment request, options = nil
|
352
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
352
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
353
353
|
|
354
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest
|
354
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest
|
355
355
|
|
356
356
|
# Converts hash and nil to an options object
|
357
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
357
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
358
358
|
|
359
359
|
# Customize the options with defaults
|
360
360
|
metadata = @config.rpcs.analyze_entity_sentiment.metadata.to_h
|
361
361
|
|
362
362
|
# Set x-goog-api-client and x-goog-user-project headers
|
363
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
363
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
364
364
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
365
365
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
366
366
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -375,8 +375,8 @@ module Google
|
|
375
375
|
yield response, operation if block_given?
|
376
376
|
return response
|
377
377
|
end
|
378
|
-
rescue GRPC::BadStatus => e
|
379
|
-
raise Google::Cloud::Error.from_error(e)
|
378
|
+
rescue ::GRPC::BadStatus => e
|
379
|
+
raise ::Google::Cloud::Error.from_error(e)
|
380
380
|
end
|
381
381
|
|
382
382
|
##
|
@@ -386,12 +386,12 @@ module Google
|
|
386
386
|
#
|
387
387
|
# @overload analyze_syntax(request, options = nil)
|
388
388
|
# Pass arguments to `analyze_syntax` via a request object, either of type
|
389
|
-
# {Google::Cloud::Language::V1::AnalyzeSyntaxRequest} or an equivalent Hash.
|
389
|
+
# {::Google::Cloud::Language::V1::AnalyzeSyntaxRequest} or an equivalent Hash.
|
390
390
|
#
|
391
|
-
# @param request [Google::Cloud::Language::V1::AnalyzeSyntaxRequest, Hash]
|
391
|
+
# @param request [::Google::Cloud::Language::V1::AnalyzeSyntaxRequest, ::Hash]
|
392
392
|
# A request object representing the call parameters. Required. To specify no
|
393
393
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
394
|
-
# @param options [Gapic::CallOptions, Hash]
|
394
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
395
395
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
396
396
|
#
|
397
397
|
# @overload analyze_syntax(document: nil, encoding_type: nil)
|
@@ -399,32 +399,32 @@ module Google
|
|
399
399
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
400
400
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
401
401
|
#
|
402
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
402
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
403
403
|
# Input document.
|
404
|
-
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
404
|
+
# @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
|
405
405
|
# The encoding type used by the API to calculate offsets.
|
406
406
|
#
|
407
407
|
# @yield [response, operation] Access the result along with the RPC operation
|
408
|
-
# @yieldparam response [Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
|
409
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
408
|
+
# @yieldparam response [::Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
|
409
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
410
410
|
#
|
411
|
-
# @return [Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
|
411
|
+
# @return [::Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
|
412
412
|
#
|
413
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
413
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
414
414
|
#
|
415
415
|
def analyze_syntax request, options = nil
|
416
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
416
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
417
417
|
|
418
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::AnalyzeSyntaxRequest
|
418
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::AnalyzeSyntaxRequest
|
419
419
|
|
420
420
|
# Converts hash and nil to an options object
|
421
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
421
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
422
422
|
|
423
423
|
# Customize the options with defaults
|
424
424
|
metadata = @config.rpcs.analyze_syntax.metadata.to_h
|
425
425
|
|
426
426
|
# Set x-goog-api-client and x-goog-user-project headers
|
427
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
427
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
428
428
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
429
429
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
430
430
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -439,8 +439,8 @@ module Google
|
|
439
439
|
yield response, operation if block_given?
|
440
440
|
return response
|
441
441
|
end
|
442
|
-
rescue GRPC::BadStatus => e
|
443
|
-
raise Google::Cloud::Error.from_error(e)
|
442
|
+
rescue ::GRPC::BadStatus => e
|
443
|
+
raise ::Google::Cloud::Error.from_error(e)
|
444
444
|
end
|
445
445
|
|
446
446
|
##
|
@@ -448,12 +448,12 @@ module Google
|
|
448
448
|
#
|
449
449
|
# @overload classify_text(request, options = nil)
|
450
450
|
# Pass arguments to `classify_text` via a request object, either of type
|
451
|
-
# {Google::Cloud::Language::V1::ClassifyTextRequest} or an equivalent Hash.
|
451
|
+
# {::Google::Cloud::Language::V1::ClassifyTextRequest} or an equivalent Hash.
|
452
452
|
#
|
453
|
-
# @param request [Google::Cloud::Language::V1::ClassifyTextRequest, Hash]
|
453
|
+
# @param request [::Google::Cloud::Language::V1::ClassifyTextRequest, ::Hash]
|
454
454
|
# A request object representing the call parameters. Required. To specify no
|
455
455
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
456
|
-
# @param options [Gapic::CallOptions, Hash]
|
456
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
457
457
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
458
458
|
#
|
459
459
|
# @overload classify_text(document: nil)
|
@@ -461,30 +461,30 @@ module Google
|
|
461
461
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
462
462
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
463
463
|
#
|
464
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
464
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
465
465
|
# Input document.
|
466
466
|
#
|
467
467
|
# @yield [response, operation] Access the result along with the RPC operation
|
468
|
-
# @yieldparam response [Google::Cloud::Language::V1::ClassifyTextResponse]
|
469
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
468
|
+
# @yieldparam response [::Google::Cloud::Language::V1::ClassifyTextResponse]
|
469
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
470
470
|
#
|
471
|
-
# @return [Google::Cloud::Language::V1::ClassifyTextResponse]
|
471
|
+
# @return [::Google::Cloud::Language::V1::ClassifyTextResponse]
|
472
472
|
#
|
473
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
473
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
474
474
|
#
|
475
475
|
def classify_text request, options = nil
|
476
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
477
477
|
|
478
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::ClassifyTextRequest
|
478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::ClassifyTextRequest
|
479
479
|
|
480
480
|
# Converts hash and nil to an options object
|
481
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
482
482
|
|
483
483
|
# Customize the options with defaults
|
484
484
|
metadata = @config.rpcs.classify_text.metadata.to_h
|
485
485
|
|
486
486
|
# Set x-goog-api-client and x-goog-user-project headers
|
487
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
487
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
488
488
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
489
489
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
490
490
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -499,8 +499,8 @@ module Google
|
|
499
499
|
yield response, operation if block_given?
|
500
500
|
return response
|
501
501
|
end
|
502
|
-
rescue GRPC::BadStatus => e
|
503
|
-
raise Google::Cloud::Error.from_error(e)
|
502
|
+
rescue ::GRPC::BadStatus => e
|
503
|
+
raise ::Google::Cloud::Error.from_error(e)
|
504
504
|
end
|
505
505
|
|
506
506
|
##
|
@@ -509,12 +509,12 @@ module Google
|
|
509
509
|
#
|
510
510
|
# @overload annotate_text(request, options = nil)
|
511
511
|
# Pass arguments to `annotate_text` via a request object, either of type
|
512
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest} or an equivalent Hash.
|
512
|
+
# {::Google::Cloud::Language::V1::AnnotateTextRequest} or an equivalent Hash.
|
513
513
|
#
|
514
|
-
# @param request [Google::Cloud::Language::V1::AnnotateTextRequest, Hash]
|
514
|
+
# @param request [::Google::Cloud::Language::V1::AnnotateTextRequest, ::Hash]
|
515
515
|
# A request object representing the call parameters. Required. To specify no
|
516
516
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
517
|
-
# @param options [Gapic::CallOptions, Hash]
|
517
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
518
518
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
519
519
|
#
|
520
520
|
# @overload annotate_text(document: nil, features: nil, encoding_type: nil)
|
@@ -522,34 +522,34 @@ module Google
|
|
522
522
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
523
523
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
524
524
|
#
|
525
|
-
# @param document [Google::Cloud::Language::V1::Document, Hash]
|
525
|
+
# @param document [::Google::Cloud::Language::V1::Document, ::Hash]
|
526
526
|
# Input document.
|
527
|
-
# @param features [Google::Cloud::Language::V1::AnnotateTextRequest::Features, Hash]
|
527
|
+
# @param features [::Google::Cloud::Language::V1::AnnotateTextRequest::Features, ::Hash]
|
528
528
|
# The enabled features.
|
529
|
-
# @param encoding_type [Google::Cloud::Language::V1::EncodingType]
|
529
|
+
# @param encoding_type [::Google::Cloud::Language::V1::EncodingType]
|
530
530
|
# The encoding type used by the API to calculate offsets.
|
531
531
|
#
|
532
532
|
# @yield [response, operation] Access the result along with the RPC operation
|
533
|
-
# @yieldparam response [Google::Cloud::Language::V1::AnnotateTextResponse]
|
534
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
533
|
+
# @yieldparam response [::Google::Cloud::Language::V1::AnnotateTextResponse]
|
534
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
535
535
|
#
|
536
|
-
# @return [Google::Cloud::Language::V1::AnnotateTextResponse]
|
536
|
+
# @return [::Google::Cloud::Language::V1::AnnotateTextResponse]
|
537
537
|
#
|
538
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
538
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
539
539
|
#
|
540
540
|
def annotate_text request, options = nil
|
541
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
541
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
542
542
|
|
543
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Language::V1::AnnotateTextRequest
|
543
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1::AnnotateTextRequest
|
544
544
|
|
545
545
|
# Converts hash and nil to an options object
|
546
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
546
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
547
547
|
|
548
548
|
# Customize the options with defaults
|
549
549
|
metadata = @config.rpcs.annotate_text.metadata.to_h
|
550
550
|
|
551
551
|
# Set x-goog-api-client and x-goog-user-project headers
|
552
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
552
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
553
553
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
554
554
|
gapic_version: ::Google::Cloud::Language::V1::VERSION
|
555
555
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -564,8 +564,8 @@ module Google
|
|
564
564
|
yield response, operation if block_given?
|
565
565
|
return response
|
566
566
|
end
|
567
|
-
rescue GRPC::BadStatus => e
|
568
|
-
raise Google::Cloud::Error.from_error(e)
|
567
|
+
rescue ::GRPC::BadStatus => e
|
568
|
+
raise ::Google::Cloud::Error.from_error(e)
|
569
569
|
end
|
570
570
|
|
571
571
|
##
|
@@ -575,7 +575,7 @@ module Google
|
|
575
575
|
# providing control over timeouts, retry behavior, logging, transport
|
576
576
|
# parameters, and other low-level controls. Certain parameters can also be
|
577
577
|
# applied individually to specific RPCs. See
|
578
|
-
# {Google::Cloud::Language::V1::LanguageService::Client::Configuration::Rpcs}
|
578
|
+
# {::Google::Cloud::Language::V1::LanguageService::Client::Configuration::Rpcs}
|
579
579
|
# for a list of RPCs that can be configured independently.
|
580
580
|
#
|
581
581
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -586,22 +586,22 @@ module Google
|
|
586
586
|
# To modify the global config, setting the timeout for analyze_sentiment
|
587
587
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
588
588
|
#
|
589
|
-
# Google::Cloud::Language::V1::LanguageService::Client.configure do |config|
|
590
|
-
# config.timeout =
|
591
|
-
# config.rpcs.analyze_sentiment.timeout =
|
589
|
+
# ::Google::Cloud::Language::V1::LanguageService::Client.configure do |config|
|
590
|
+
# config.timeout = 10.0
|
591
|
+
# config.rpcs.analyze_sentiment.timeout = 20.0
|
592
592
|
# end
|
593
593
|
#
|
594
594
|
# To apply the above configuration only to a new client:
|
595
595
|
#
|
596
|
-
# client = Google::Cloud::Language::V1::LanguageService::Client.new do |config|
|
597
|
-
# config.timeout =
|
598
|
-
# config.rpcs.analyze_sentiment.timeout =
|
596
|
+
# client = ::Google::Cloud::Language::V1::LanguageService::Client.new do |config|
|
597
|
+
# config.timeout = 10.0
|
598
|
+
# config.rpcs.analyze_sentiment.timeout = 20.0
|
599
599
|
# end
|
600
600
|
#
|
601
601
|
# @!attribute [rw] endpoint
|
602
602
|
# The hostname or hostname:port of the service endpoint.
|
603
603
|
# Defaults to `"language.googleapis.com"`.
|
604
|
-
# @return [String]
|
604
|
+
# @return [::String]
|
605
605
|
# @!attribute [rw] credentials
|
606
606
|
# Credentials to send with calls. You may provide any of the following types:
|
607
607
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -613,29 +613,29 @@ module Google
|
|
613
613
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
614
614
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
615
615
|
# * (`nil`) indicating no credentials
|
616
|
-
# @return [Object]
|
616
|
+
# @return [::Object]
|
617
617
|
# @!attribute [rw] scope
|
618
618
|
# The OAuth scopes
|
619
|
-
# @return [Array
|
619
|
+
# @return [::Array<::String>]
|
620
620
|
# @!attribute [rw] lib_name
|
621
621
|
# The library name as recorded in instrumentation and logging
|
622
|
-
# @return [String]
|
622
|
+
# @return [::String]
|
623
623
|
# @!attribute [rw] lib_version
|
624
624
|
# The library version as recorded in instrumentation and logging
|
625
|
-
# @return [String]
|
625
|
+
# @return [::String]
|
626
626
|
# @!attribute [rw] channel_args
|
627
627
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
628
628
|
# `GRPC::Core::Channel` object is provided as the credential.
|
629
|
-
# @return [Hash]
|
629
|
+
# @return [::Hash]
|
630
630
|
# @!attribute [rw] interceptors
|
631
631
|
# An array of interceptors that are run before calls are executed.
|
632
|
-
# @return [Array
|
632
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
633
633
|
# @!attribute [rw] timeout
|
634
|
-
# The call timeout in
|
635
|
-
# @return [Numeric]
|
634
|
+
# The call timeout in seconds.
|
635
|
+
# @return [::Numeric]
|
636
636
|
# @!attribute [rw] metadata
|
637
637
|
# Additional gRPC headers to be sent with the call.
|
638
|
-
# @return [Hash{Symbol
|
638
|
+
# @return [::Hash{::Symbol=>::String}]
|
639
639
|
# @!attribute [rw] retry_policy
|
640
640
|
# The retry policy. The value is a hash with the following keys:
|
641
641
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -643,10 +643,10 @@ module Google
|
|
643
643
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
644
644
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
645
645
|
# trigger a retry.
|
646
|
-
# @return [Hash]
|
646
|
+
# @return [::Hash]
|
647
647
|
#
|
648
648
|
class Configuration
|
649
|
-
extend Gapic::Config
|
649
|
+
extend ::Gapic::Config
|
650
650
|
|
651
651
|
config_attr :endpoint, "language.googleapis.com", String
|
652
652
|
config_attr :credentials, nil do |value|
|
@@ -654,14 +654,14 @@ module Google
|
|
654
654
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
655
655
|
allowed.any? { |klass| klass === value }
|
656
656
|
end
|
657
|
-
config_attr :scope, nil, String, Array, nil
|
658
|
-
config_attr :lib_name, nil, String, nil
|
659
|
-
config_attr :lib_version, nil, String, nil
|
660
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
661
|
-
config_attr :interceptors, nil, Array, nil
|
662
|
-
config_attr :timeout, nil, Numeric, nil
|
663
|
-
config_attr :metadata, nil, Hash, nil
|
664
|
-
config_attr :retry_policy, nil, Hash, Proc, nil
|
657
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
658
|
+
config_attr :lib_name, nil, ::String, nil
|
659
|
+
config_attr :lib_version, nil, ::String, nil
|
660
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
661
|
+
config_attr :interceptors, nil, ::Array, nil
|
662
|
+
config_attr :timeout, nil, ::Numeric, nil
|
663
|
+
config_attr :metadata, nil, ::Hash, nil
|
664
|
+
config_attr :retry_policy, nil, ::Hash, Proc, nil
|
665
665
|
|
666
666
|
# @private
|
667
667
|
def initialize parent_config = nil
|
@@ -702,49 +702,49 @@ module Google
|
|
702
702
|
class Rpcs
|
703
703
|
##
|
704
704
|
# RPC-specific configuration for `analyze_sentiment`
|
705
|
-
# @return [Gapic::Config::Method]
|
705
|
+
# @return [::Gapic::Config::Method]
|
706
706
|
#
|
707
707
|
attr_reader :analyze_sentiment
|
708
708
|
##
|
709
709
|
# RPC-specific configuration for `analyze_entities`
|
710
|
-
# @return [Gapic::Config::Method]
|
710
|
+
# @return [::Gapic::Config::Method]
|
711
711
|
#
|
712
712
|
attr_reader :analyze_entities
|
713
713
|
##
|
714
714
|
# RPC-specific configuration for `analyze_entity_sentiment`
|
715
|
-
# @return [Gapic::Config::Method]
|
715
|
+
# @return [::Gapic::Config::Method]
|
716
716
|
#
|
717
717
|
attr_reader :analyze_entity_sentiment
|
718
718
|
##
|
719
719
|
# RPC-specific configuration for `analyze_syntax`
|
720
|
-
# @return [Gapic::Config::Method]
|
720
|
+
# @return [::Gapic::Config::Method]
|
721
721
|
#
|
722
722
|
attr_reader :analyze_syntax
|
723
723
|
##
|
724
724
|
# RPC-specific configuration for `classify_text`
|
725
|
-
# @return [Gapic::Config::Method]
|
725
|
+
# @return [::Gapic::Config::Method]
|
726
726
|
#
|
727
727
|
attr_reader :classify_text
|
728
728
|
##
|
729
729
|
# RPC-specific configuration for `annotate_text`
|
730
|
-
# @return [Gapic::Config::Method]
|
730
|
+
# @return [::Gapic::Config::Method]
|
731
731
|
#
|
732
732
|
attr_reader :annotate_text
|
733
733
|
|
734
734
|
# @private
|
735
735
|
def initialize parent_rpcs = nil
|
736
736
|
analyze_sentiment_config = parent_rpcs&.analyze_sentiment if parent_rpcs&.respond_to? :analyze_sentiment
|
737
|
-
@analyze_sentiment = Gapic::Config::Method.new analyze_sentiment_config
|
737
|
+
@analyze_sentiment = ::Gapic::Config::Method.new analyze_sentiment_config
|
738
738
|
analyze_entities_config = parent_rpcs&.analyze_entities if parent_rpcs&.respond_to? :analyze_entities
|
739
|
-
@analyze_entities = Gapic::Config::Method.new analyze_entities_config
|
739
|
+
@analyze_entities = ::Gapic::Config::Method.new analyze_entities_config
|
740
740
|
analyze_entity_sentiment_config = parent_rpcs&.analyze_entity_sentiment if parent_rpcs&.respond_to? :analyze_entity_sentiment
|
741
|
-
@analyze_entity_sentiment = Gapic::Config::Method.new analyze_entity_sentiment_config
|
741
|
+
@analyze_entity_sentiment = ::Gapic::Config::Method.new analyze_entity_sentiment_config
|
742
742
|
analyze_syntax_config = parent_rpcs&.analyze_syntax if parent_rpcs&.respond_to? :analyze_syntax
|
743
|
-
@analyze_syntax = Gapic::Config::Method.new analyze_syntax_config
|
743
|
+
@analyze_syntax = ::Gapic::Config::Method.new analyze_syntax_config
|
744
744
|
classify_text_config = parent_rpcs&.classify_text if parent_rpcs&.respond_to? :classify_text
|
745
|
-
@classify_text = Gapic::Config::Method.new classify_text_config
|
745
|
+
@classify_text = ::Gapic::Config::Method.new classify_text_config
|
746
746
|
annotate_text_config = parent_rpcs&.annotate_text if parent_rpcs&.respond_to? :annotate_text
|
747
|
-
@annotate_text = Gapic::Config::Method.new annotate_text_config
|
747
|
+
@annotate_text = ::Gapic::Config::Method.new annotate_text_config
|
748
748
|
|
749
749
|
yield self if block_given?
|
750
750
|
end
|