google-cloud-language-v2 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/language/v2/language_service/client.rb +16 -6
- data/lib/google/cloud/language/v2/language_service/rest/client.rb +16 -6
- data/lib/google/cloud/language/v2/language_service_pb.rb +2 -1
- data/lib/google/cloud/language/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +18 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/language/v2/language_service.rb +27 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93c224f839612ccfa7721972e82831bd08308e451d489be75092ccfc6a3a6990
|
4
|
+
data.tar.gz: 98a0b6ae36a39d9c9531768b8e4e096041cb0302cc252e49afcf307cde8b104c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfbc371aa41386fe234681c9feb0e3cf2a66909a6a78ad1d87da1deb0850957d59aa9e9e9ea56dffa997b0f7067c9c2e1f452b27430bdc508919c0b5c3586237
|
7
|
+
data.tar.gz: 35c9445bb64a65244409f6bcc17f65961d9f0b7cee46782dd898c7d182a44d0c1c39e438c10ae61e0191b334c41c22a155d318f3be23c0b4f074cfeb3c901cf1
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# recognition.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
API_VERSION = ""
|
36
|
+
|
34
37
|
# @private
|
35
38
|
DEFAULT_ENDPOINT_TEMPLATE = "language.$UNIVERSE_DOMAIN$"
|
36
39
|
|
@@ -241,10 +244,11 @@ module Google
|
|
241
244
|
# Customize the options with defaults
|
242
245
|
metadata = @config.rpcs.analyze_sentiment.metadata.to_h
|
243
246
|
|
244
|
-
# Set x-goog-api-client
|
247
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
245
248
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
246
249
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
247
250
|
gapic_version: ::Google::Cloud::Language::V2::VERSION
|
251
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
248
252
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
249
253
|
|
250
254
|
options.apply_defaults timeout: @config.rpcs.analyze_sentiment.timeout,
|
@@ -322,10 +326,11 @@ module Google
|
|
322
326
|
# Customize the options with defaults
|
323
327
|
metadata = @config.rpcs.analyze_entities.metadata.to_h
|
324
328
|
|
325
|
-
# Set x-goog-api-client
|
329
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
326
330
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
327
331
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
328
332
|
gapic_version: ::Google::Cloud::Language::V2::VERSION
|
333
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
329
334
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
330
335
|
|
331
336
|
options.apply_defaults timeout: @config.rpcs.analyze_entities.timeout,
|
@@ -399,10 +404,11 @@ module Google
|
|
399
404
|
# Customize the options with defaults
|
400
405
|
metadata = @config.rpcs.classify_text.metadata.to_h
|
401
406
|
|
402
|
-
# Set x-goog-api-client
|
407
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
403
408
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
404
409
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
405
410
|
gapic_version: ::Google::Cloud::Language::V2::VERSION
|
411
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
406
412
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
407
413
|
|
408
414
|
options.apply_defaults timeout: @config.rpcs.classify_text.timeout,
|
@@ -434,13 +440,15 @@ module Google
|
|
434
440
|
# @param options [::Gapic::CallOptions, ::Hash]
|
435
441
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
436
442
|
#
|
437
|
-
# @overload moderate_text(document: nil)
|
443
|
+
# @overload moderate_text(document: nil, model_version: nil)
|
438
444
|
# Pass arguments to `moderate_text` via keyword arguments. Note that at
|
439
445
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
440
446
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
441
447
|
#
|
442
448
|
# @param document [::Google::Cloud::Language::V2::Document, ::Hash]
|
443
449
|
# Required. Input document.
|
450
|
+
# @param model_version [::Google::Cloud::Language::V2::ModerateTextRequest::ModelVersion]
|
451
|
+
# Optional. The model version to use for ModerateText.
|
444
452
|
#
|
445
453
|
# @yield [response, operation] Access the result along with the RPC operation
|
446
454
|
# @yieldparam response [::Google::Cloud::Language::V2::ModerateTextResponse]
|
@@ -476,10 +484,11 @@ module Google
|
|
476
484
|
# Customize the options with defaults
|
477
485
|
metadata = @config.rpcs.moderate_text.metadata.to_h
|
478
486
|
|
479
|
-
# Set x-goog-api-client
|
487
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
480
488
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
481
489
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
482
490
|
gapic_version: ::Google::Cloud::Language::V2::VERSION
|
491
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
483
492
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
484
493
|
|
485
494
|
options.apply_defaults timeout: @config.rpcs.moderate_text.timeout,
|
@@ -557,10 +566,11 @@ module Google
|
|
557
566
|
# Customize the options with defaults
|
558
567
|
metadata = @config.rpcs.annotate_text.metadata.to_h
|
559
568
|
|
560
|
-
# Set x-goog-api-client
|
569
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
561
570
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
562
571
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
563
572
|
gapic_version: ::Google::Cloud::Language::V2::VERSION
|
573
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
564
574
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
565
575
|
|
566
576
|
options.apply_defaults timeout: @config.rpcs.annotate_text.timeout,
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# recognition.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
API_VERSION = ""
|
38
|
+
|
36
39
|
# @private
|
37
40
|
DEFAULT_ENDPOINT_TEMPLATE = "language.$UNIVERSE_DOMAIN$"
|
38
41
|
|
@@ -233,12 +236,13 @@ module Google
|
|
233
236
|
# Customize the options with defaults
|
234
237
|
call_metadata = @config.rpcs.analyze_sentiment.metadata.to_h
|
235
238
|
|
236
|
-
# Set x-goog-api-client
|
239
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
237
240
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
238
241
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
239
242
|
gapic_version: ::Google::Cloud::Language::V2::VERSION,
|
240
243
|
transports_version_send: [:rest]
|
241
244
|
|
245
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
242
246
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
243
247
|
|
244
248
|
options.apply_defaults timeout: @config.rpcs.analyze_sentiment.timeout,
|
@@ -315,12 +319,13 @@ module Google
|
|
315
319
|
# Customize the options with defaults
|
316
320
|
call_metadata = @config.rpcs.analyze_entities.metadata.to_h
|
317
321
|
|
318
|
-
# Set x-goog-api-client
|
322
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
319
323
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
320
324
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
321
325
|
gapic_version: ::Google::Cloud::Language::V2::VERSION,
|
322
326
|
transports_version_send: [:rest]
|
323
327
|
|
328
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
324
329
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
325
330
|
|
326
331
|
options.apply_defaults timeout: @config.rpcs.analyze_entities.timeout,
|
@@ -393,12 +398,13 @@ module Google
|
|
393
398
|
# Customize the options with defaults
|
394
399
|
call_metadata = @config.rpcs.classify_text.metadata.to_h
|
395
400
|
|
396
|
-
# Set x-goog-api-client
|
401
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
397
402
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
398
403
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
399
404
|
gapic_version: ::Google::Cloud::Language::V2::VERSION,
|
400
405
|
transports_version_send: [:rest]
|
401
406
|
|
407
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
402
408
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
403
409
|
|
404
410
|
options.apply_defaults timeout: @config.rpcs.classify_text.timeout,
|
@@ -430,13 +436,15 @@ module Google
|
|
430
436
|
# @param options [::Gapic::CallOptions, ::Hash]
|
431
437
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
432
438
|
#
|
433
|
-
# @overload moderate_text(document: nil)
|
439
|
+
# @overload moderate_text(document: nil, model_version: nil)
|
434
440
|
# Pass arguments to `moderate_text` via keyword arguments. Note that at
|
435
441
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
436
442
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
437
443
|
#
|
438
444
|
# @param document [::Google::Cloud::Language::V2::Document, ::Hash]
|
439
445
|
# Required. Input document.
|
446
|
+
# @param model_version [::Google::Cloud::Language::V2::ModerateTextRequest::ModelVersion]
|
447
|
+
# Optional. The model version to use for ModerateText.
|
440
448
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
441
449
|
# @yieldparam result [::Google::Cloud::Language::V2::ModerateTextResponse]
|
442
450
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -471,12 +479,13 @@ module Google
|
|
471
479
|
# Customize the options with defaults
|
472
480
|
call_metadata = @config.rpcs.moderate_text.metadata.to_h
|
473
481
|
|
474
|
-
# Set x-goog-api-client
|
482
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
475
483
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
476
484
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
477
485
|
gapic_version: ::Google::Cloud::Language::V2::VERSION,
|
478
486
|
transports_version_send: [:rest]
|
479
487
|
|
488
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
480
489
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
481
490
|
|
482
491
|
options.apply_defaults timeout: @config.rpcs.moderate_text.timeout,
|
@@ -553,12 +562,13 @@ module Google
|
|
553
562
|
# Customize the options with defaults
|
554
563
|
call_metadata = @config.rpcs.annotate_text.metadata.to_h
|
555
564
|
|
556
|
-
# Set x-goog-api-client
|
565
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
557
566
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
558
567
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
559
568
|
gapic_version: ::Google::Cloud::Language::V2::VERSION,
|
560
569
|
transports_version_send: [:rest]
|
561
570
|
|
571
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
562
572
|
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
563
573
|
|
564
574
|
options.apply_defaults timeout: @config.rpcs.annotate_text.timeout,
|
@@ -9,7 +9,7 @@ require 'google/api/client_pb'
|
|
9
9
|
require 'google/api/field_behavior_pb'
|
10
10
|
|
11
11
|
|
12
|
-
descriptor_data = "\n/google/cloud/language/v2/language_service.proto\x12\x18google.cloud.language.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xcd\x01\n\x08\x44ocument\x12\x35\n\x04type\x18\x01 \x01(\x0e\x32\'.google.cloud.language.v2.Document.Type\x12\x11\n\x07\x63ontent\x18\x02 \x01(\tH\x00\x12\x19\n\x0fgcs_content_uri\x18\x03 \x01(\tH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPLAIN_TEXT\x10\x01\x12\x08\n\x04HTML\x10\x02\x42\x08\n\x06source\"t\n\x08Sentence\x12\x30\n\x04text\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.TextSpan\x12\x36\n\tsentiment\x18\x02 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\"\xed\x03\n\x06\x45ntity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x33\n\x04type\x18\x02 \x01(\x0e\x32%.google.cloud.language.v2.Entity.Type\x12@\n\x08metadata\x18\x03 \x03(\x0b\x32..google.cloud.language.v2.Entity.MetadataEntry\x12\x39\n\x08mentions\x18\x05 \x03(\x0b\x32\'.google.cloud.language.v2.EntityMention\x12\x36\n\tsentiment\x18\x06 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb9\x01\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06PERSON\x10\x01\x12\x0c\n\x08LOCATION\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\t\n\x05\x45VENT\x10\x04\x12\x0f\n\x0bWORK_OF_ART\x10\x05\x12\x11\n\rCONSUMER_GOOD\x10\x06\x12\t\n\x05OTHER\x10\x07\x12\x10\n\x0cPHONE_NUMBER\x10\t\x12\x0b\n\x07\x41\x44\x44RESS\x10\n\x12\x08\n\x04\x44\x41TE\x10\x0b\x12\n\n\x06NUMBER\x10\x0c\x12\t\n\x05PRICE\x10\r\"-\n\tSentiment\x12\x11\n\tmagnitude\x18\x01 \x01(\x02\x12\r\n\x05score\x18\x02 \x01(\x02\"\xfc\x01\n\rEntityMention\x12\x30\n\x04text\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.TextSpan\x12:\n\x04type\x18\x02 \x01(\x0e\x32,.google.cloud.language.v2.EntityMention.Type\x12\x36\n\tsentiment\x18\x03 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x12\x13\n\x0bprobability\x18\x04 \x01(\x02\"0\n\x04Type\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06PROPER\x10\x01\x12\n\n\x06\x43OMMON\x10\x02\"1\n\x08TextSpan\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x65gin_offset\x18\x02 \x01(\x05\"
|
12
|
+
descriptor_data = "\n/google/cloud/language/v2/language_service.proto\x12\x18google.cloud.language.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xcd\x01\n\x08\x44ocument\x12\x35\n\x04type\x18\x01 \x01(\x0e\x32\'.google.cloud.language.v2.Document.Type\x12\x11\n\x07\x63ontent\x18\x02 \x01(\tH\x00\x12\x19\n\x0fgcs_content_uri\x18\x03 \x01(\tH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPLAIN_TEXT\x10\x01\x12\x08\n\x04HTML\x10\x02\x42\x08\n\x06source\"t\n\x08Sentence\x12\x30\n\x04text\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.TextSpan\x12\x36\n\tsentiment\x18\x02 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\"\xed\x03\n\x06\x45ntity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x33\n\x04type\x18\x02 \x01(\x0e\x32%.google.cloud.language.v2.Entity.Type\x12@\n\x08metadata\x18\x03 \x03(\x0b\x32..google.cloud.language.v2.Entity.MetadataEntry\x12\x39\n\x08mentions\x18\x05 \x03(\x0b\x32\'.google.cloud.language.v2.EntityMention\x12\x36\n\tsentiment\x18\x06 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb9\x01\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06PERSON\x10\x01\x12\x0c\n\x08LOCATION\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\t\n\x05\x45VENT\x10\x04\x12\x0f\n\x0bWORK_OF_ART\x10\x05\x12\x11\n\rCONSUMER_GOOD\x10\x06\x12\t\n\x05OTHER\x10\x07\x12\x10\n\x0cPHONE_NUMBER\x10\t\x12\x0b\n\x07\x41\x44\x44RESS\x10\n\x12\x08\n\x04\x44\x41TE\x10\x0b\x12\n\n\x06NUMBER\x10\x0c\x12\t\n\x05PRICE\x10\r\"-\n\tSentiment\x12\x11\n\tmagnitude\x18\x01 \x01(\x02\x12\r\n\x05score\x18\x02 \x01(\x02\"\xfc\x01\n\rEntityMention\x12\x30\n\x04text\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.TextSpan\x12:\n\x04type\x18\x02 \x01(\x0e\x32,.google.cloud.language.v2.EntityMention.Type\x12\x36\n\tsentiment\x18\x03 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x12\x13\n\x0bprobability\x18\x04 \x01(\x02\"0\n\x04Type\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06PROPER\x10\x01\x12\n\n\x06\x43OMMON\x10\x02\"1\n\x08TextSpan\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x65gin_offset\x18\x02 \x01(\x05\"Q\n\x16\x43lassificationCategory\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x15\n\x08severity\x18\x03 \x01(\x02\x42\x03\xe0\x41\x01\"\x93\x01\n\x17\x41nalyzeSentimentRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.DocumentB\x03\xe0\x41\x02\x12=\n\rencoding_type\x18\x02 \x01(\x0e\x32&.google.cloud.language.v2.EncodingType\"\xc5\x01\n\x18\x41nalyzeSentimentResponse\x12?\n\x12\x64ocument_sentiment\x18\x01 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x35\n\tsentences\x18\x03 \x03(\x0b\x32\".google.cloud.language.v2.Sentence\x12\x1a\n\x12language_supported\x18\x04 \x01(\x08\"\x92\x01\n\x16\x41nalyzeEntitiesRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.DocumentB\x03\xe0\x41\x02\x12=\n\rencoding_type\x18\x02 \x01(\x0e\x32&.google.cloud.language.v2.EncodingType\"\x80\x01\n\x17\x41nalyzeEntitiesResponse\x12\x32\n\x08\x65ntities\x18\x01 \x03(\x0b\x32 .google.cloud.language.v2.Entity\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x1a\n\x12language_supported\x18\x03 \x01(\x08\"P\n\x13\x43lassifyTextRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.DocumentB\x03\xe0\x41\x02\"\x8f\x01\n\x14\x43lassifyTextResponse\x12\x44\n\ncategories\x18\x01 \x03(\x0b\x32\x30.google.cloud.language.v2.ClassificationCategory\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x1a\n\x12language_supported\x18\x03 \x01(\x08\"\x81\x02\n\x13ModerateTextRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.DocumentB\x03\xe0\x41\x02\x12V\n\rmodel_version\x18\x02 \x01(\x0e\x32:.google.cloud.language.v2.ModerateTextRequest.ModelVersionB\x03\xe0\x41\x01\"W\n\x0cModelVersion\x12\x1d\n\x19MODEL_VERSION_UNSPECIFIED\x10\x00\x12\x13\n\x0fMODEL_VERSION_1\x10\x01\x12\x13\n\x0fMODEL_VERSION_2\x10\x02\"\x9a\x01\n\x14ModerateTextResponse\x12O\n\x15moderation_categories\x18\x01 \x03(\x0b\x32\x30.google.cloud.language.v2.ClassificationCategory\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x1a\n\x12language_supported\x18\x03 \x01(\x08\"\xeb\x02\n\x13\x41nnotateTextRequest\x12\x39\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\".google.cloud.language.v2.DocumentB\x03\xe0\x41\x02\x12M\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32\x36.google.cloud.language.v2.AnnotateTextRequest.FeaturesB\x03\xe0\x41\x02\x12=\n\rencoding_type\x18\x03 \x01(\x0e\x32&.google.cloud.language.v2.EncodingType\x1a\x8a\x01\n\x08\x46\x65\x61tures\x12\x1d\n\x10\x65xtract_entities\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65xtract_document_sentiment\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rclassify_text\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rmoderate_text\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x8c\x03\n\x14\x41nnotateTextResponse\x12\x35\n\tsentences\x18\x01 \x03(\x0b\x32\".google.cloud.language.v2.Sentence\x12\x32\n\x08\x65ntities\x18\x02 \x03(\x0b\x32 .google.cloud.language.v2.Entity\x12?\n\x12\x64ocument_sentiment\x18\x03 \x01(\x0b\x32#.google.cloud.language.v2.Sentiment\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12\x44\n\ncategories\x18\x05 \x03(\x0b\x32\x30.google.cloud.language.v2.ClassificationCategory\x12O\n\x15moderation_categories\x18\x06 \x03(\x0b\x32\x30.google.cloud.language.v2.ClassificationCategory\x12\x1a\n\x12language_supported\x18\x07 \x01(\x08*8\n\x0c\x45ncodingType\x12\x08\n\x04NONE\x10\x00\x12\x08\n\x04UTF8\x10\x01\x12\t\n\x05UTF16\x10\x02\x12\t\n\x05UTF32\x10\x03\x32\xb0\x08\n\x0fLanguageService\x12\xc8\x01\n\x10\x41nalyzeSentiment\x12\x31.google.cloud.language.v2.AnalyzeSentimentRequest\x1a\x32.google.cloud.language.v2.AnalyzeSentimentResponse\"M\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x82\xd3\xe4\x93\x02#\"\x1e/v2/documents:analyzeSentiment:\x01*\x12\xc4\x01\n\x0f\x41nalyzeEntities\x12\x30.google.cloud.language.v2.AnalyzeEntitiesRequest\x1a\x31.google.cloud.language.v2.AnalyzeEntitiesResponse\"L\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x82\xd3\xe4\x93\x02\"\"\x1d/v2/documents:analyzeEntities:\x01*\x12\x9f\x01\n\x0c\x43lassifyText\x12-.google.cloud.language.v2.ClassifyTextRequest\x1a..google.cloud.language.v2.ClassifyTextResponse\"0\xda\x41\x08\x64ocument\x82\xd3\xe4\x93\x02\x1f\"\x1a/v2/documents:classifyText:\x01*\x12\x9f\x01\n\x0cModerateText\x12-.google.cloud.language.v2.ModerateTextRequest\x1a..google.cloud.language.v2.ModerateTextResponse\"0\xda\x41\x08\x64ocument\x82\xd3\xe4\x93\x02\x1f\"\x1a/v2/documents:moderateText:\x01*\x12\xca\x01\n\x0c\x41nnotateText\x12-.google.cloud.language.v2.AnnotateTextRequest\x1a..google.cloud.language.v2.AnnotateTextResponse\"[\xda\x41\x1f\x64ocument,features,encoding_type\xda\x41\x11\x64ocument,features\x82\xd3\xe4\x93\x02\x1f\"\x1a/v2/documents:annotateText:\x01*\x1az\xca\x41\x17language.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-language,https://www.googleapis.com/auth/cloud-platformBp\n\x1c\x63om.google.cloud.language.v2B\x14LanguageServiceProtoP\x01Z8cloud.google.com/go/language/apiv2/languagepb;languagepbb\x06proto3"
|
13
13
|
|
14
14
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
15
15
|
|
@@ -56,6 +56,7 @@ module Google
|
|
56
56
|
ClassifyTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.ClassifyTextRequest").msgclass
|
57
57
|
ClassifyTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.ClassifyTextResponse").msgclass
|
58
58
|
ModerateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.ModerateTextRequest").msgclass
|
59
|
+
ModerateTextRequest::ModelVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.ModerateTextRequest.ModelVersion").enummodule
|
59
60
|
ModerateTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.ModerateTextResponse").msgclass
|
60
61
|
AnnotateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.AnnotateTextRequest").msgclass
|
61
62
|
AnnotateTextRequest::Features = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v2.AnnotateTextRequest.Features").msgclass
|
@@ -118,6 +118,10 @@ module Google
|
|
118
118
|
# @return [::String]
|
119
119
|
# Optional link to proto reference documentation. Example:
|
120
120
|
# https://cloud.google.com/pubsub/lite/docs/reference/rpc
|
121
|
+
# @!attribute [rw] rest_reference_documentation_uri
|
122
|
+
# @return [::String]
|
123
|
+
# Optional link to REST reference documentation. Example:
|
124
|
+
# https://cloud.google.com/pubsub/lite/docs/reference/rest
|
121
125
|
class Publishing
|
122
126
|
include ::Google::Protobuf::MessageExts
|
123
127
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -286,6 +290,13 @@ module Google
|
|
286
290
|
# @return [::String]
|
287
291
|
# The fully qualified name of the method, for which the options below apply.
|
288
292
|
# This is used to find the method to apply the options.
|
293
|
+
#
|
294
|
+
# Example:
|
295
|
+
#
|
296
|
+
# publishing:
|
297
|
+
# method_settings:
|
298
|
+
# - selector: google.storage.control.v2.StorageControl.CreateFolder
|
299
|
+
# # method settings for CreateFolder...
|
289
300
|
# @!attribute [rw] long_running
|
290
301
|
# @return [::Google::Api::MethodSettings::LongRunning]
|
291
302
|
# Describes settings to use for long-running operations when generating
|
@@ -294,17 +305,14 @@ module Google
|
|
294
305
|
#
|
295
306
|
# Example of a YAML configuration::
|
296
307
|
#
|
297
|
-
#
|
298
|
-
#
|
308
|
+
# publishing:
|
309
|
+
# method_settings:
|
299
310
|
# - selector: google.cloud.speech.v2.Speech.BatchRecognize
|
300
311
|
# long_running:
|
301
|
-
# initial_poll_delay:
|
302
|
-
# seconds: 60 # 1 minute
|
312
|
+
# initial_poll_delay: 60s # 1 minute
|
303
313
|
# poll_delay_multiplier: 1.5
|
304
|
-
# max_poll_delay:
|
305
|
-
#
|
306
|
-
# total_poll_timeout:
|
307
|
-
# seconds: 54000 # 90 minutes
|
314
|
+
# max_poll_delay: 360s # 6 minutes
|
315
|
+
# total_poll_timeout: 54000s # 90 minutes
|
308
316
|
# @!attribute [rw] auto_populated_fields
|
309
317
|
# @return [::Array<::String>]
|
310
318
|
# List of top-level fields of the request message, that should be
|
@@ -313,8 +321,8 @@ module Google
|
|
313
321
|
#
|
314
322
|
# Example of a YAML configuration:
|
315
323
|
#
|
316
|
-
#
|
317
|
-
#
|
324
|
+
# publishing:
|
325
|
+
# method_settings:
|
318
326
|
# - selector: google.example.v1.ExampleService.CreateExample
|
319
327
|
# auto_populated_fields:
|
320
328
|
# - request_id
|
@@ -124,8 +124,13 @@ module Google
|
|
124
124
|
# @return [::String]
|
125
125
|
# The plural name used in the resource name and permission names, such as
|
126
126
|
# 'projects' for the resource name of 'projects/\\{project}' and the permission
|
127
|
-
# name of 'cloudresourcemanager.googleapis.com/projects.get'.
|
128
|
-
#
|
127
|
+
# name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
|
128
|
+
# to this is for Nested Collections that have stuttering names, as defined
|
129
|
+
# in [AIP-122](https://google.aip.dev/122#nested-collections), where the
|
130
|
+
# collection ID in the resource name pattern does not necessarily directly
|
131
|
+
# match the `plural` value.
|
132
|
+
#
|
133
|
+
# It is the same concept of the `plural` field in k8s CRD spec
|
129
134
|
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
|
130
135
|
#
|
131
136
|
# Note: The plural form is required even for singleton resources. See
|
@@ -90,8 +90,7 @@ module Google
|
|
90
90
|
# @return [::Google::Protobuf::Map{::String => ::String}]
|
91
91
|
# Metadata associated with the entity.
|
92
92
|
#
|
93
|
-
# For
|
94
|
-
# and Knowledge Graph MID (`mid`), if they are available. For the metadata
|
93
|
+
# For the metadata
|
95
94
|
# associated with other entity types, see the Type table below.
|
96
95
|
# @!attribute [rw] mentions
|
97
96
|
# @return [::Array<::Google::Cloud::Language::V2::EntityMention>]
|
@@ -116,8 +115,7 @@ module Google
|
|
116
115
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
117
116
|
end
|
118
117
|
|
119
|
-
# The type of the entity.
|
120
|
-
# Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
|
118
|
+
# The type of the entity. The table
|
121
119
|
# below lists the associated fields for entities that have different
|
122
120
|
# metadata.
|
123
121
|
module Type
|
@@ -167,7 +165,7 @@ module Google
|
|
167
165
|
# * `locality` - city or town
|
168
166
|
# * `street_name` - street/route name, if detected
|
169
167
|
# * `postal_code` - postal code, if detected
|
170
|
-
# * `country` - country, if detected
|
168
|
+
# * `country` - country, if detected
|
171
169
|
# * `broad_region` - administrative area, such as the state, if detected
|
172
170
|
# * `narrow_region` - smaller administrative area, such as county, if
|
173
171
|
# detected
|
@@ -272,6 +270,11 @@ module Google
|
|
272
270
|
# @return [::Float]
|
273
271
|
# The classifier's confidence of the category. Number represents how certain
|
274
272
|
# the classifier is that this category represents the given text.
|
273
|
+
# @!attribute [rw] severity
|
274
|
+
# @return [::Float]
|
275
|
+
# Optional. The classifier's severity of the category. This is only present
|
276
|
+
# when the ModerateTextRequest.ModelVersion is set to MODEL_VERSION_2, and
|
277
|
+
# the corresponding category has a severity score.
|
275
278
|
class ClassificationCategory
|
276
279
|
include ::Google::Protobuf::MessageExts
|
277
280
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -374,9 +377,28 @@ module Google
|
|
374
377
|
# @!attribute [rw] document
|
375
378
|
# @return [::Google::Cloud::Language::V2::Document]
|
376
379
|
# Required. Input document.
|
380
|
+
# @!attribute [rw] model_version
|
381
|
+
# @return [::Google::Cloud::Language::V2::ModerateTextRequest::ModelVersion]
|
382
|
+
# Optional. The model version to use for ModerateText.
|
377
383
|
class ModerateTextRequest
|
378
384
|
include ::Google::Protobuf::MessageExts
|
379
385
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
386
|
+
|
387
|
+
# The model version to use for ModerateText.
|
388
|
+
module ModelVersion
|
389
|
+
# The default model version.
|
390
|
+
MODEL_VERSION_UNSPECIFIED = 0
|
391
|
+
|
392
|
+
# Use the v1 model, this model is used by default when not provided.
|
393
|
+
# The v1 model only returns probability (confidence) score for each
|
394
|
+
# category.
|
395
|
+
MODEL_VERSION_1 = 1
|
396
|
+
|
397
|
+
# Use the v2 model.
|
398
|
+
# The v2 model only returns probability (confidence) score for each
|
399
|
+
# category, and returns severity score for a subset of the categories.
|
400
|
+
MODEL_VERSION_2 = 2
|
401
|
+
end
|
380
402
|
end
|
381
403
|
|
382
404
|
# The document moderation response message.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-language-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|