google-cloud-language-v1beta2 0.8.0 → 0.9.0
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/lib/google/cloud/language/v1beta2/language_service/client.rb +14 -3
- data/lib/google/cloud/language/v1beta2/language_service/rest/client.rb +116 -2
- data/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb +7 -7
- data/lib/google/cloud/language/v1beta2/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +14 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77d0663f91e989a0fa7f03d07540e25aebeb2fab38b5ff887330440f0ae8f179
|
4
|
+
data.tar.gz: 82c50557ca3fb0ba48511917ef39cb77b427baaf7de4f1ab6c6bfe8085454d4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec2dc1f415e25251a623ac0e5bc7cc1cf666e65eafd0f16cd9bc0ae67e8ce94a555d3fb7be0067acf039fc70bdce9f7b4592623a05e85ed3557dbe4e9ddaddca
|
7
|
+
data.tar.gz: 9fa250f231545bc65b601bc10848caf5b6a4aa8f007de6113c68c08ed68bc27d64cd9b310ccab6b86a416c510b9e9447b420290efbd9031bb7e729663bbdff06
|
@@ -152,7 +152,7 @@ module Google
|
|
152
152
|
credentials = @config.credentials
|
153
153
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
154
154
|
# but only if the default endpoint does not have a region prefix.
|
155
|
-
enable_self_signed_jwt = @config.endpoint ==
|
155
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
156
156
|
!@config.endpoint.split(".").first.include?("-")
|
157
157
|
credentials ||= Credentials.default scope: @config.scope,
|
158
158
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -167,7 +167,8 @@ module Google
|
|
167
167
|
credentials: credentials,
|
168
168
|
endpoint: @config.endpoint,
|
169
169
|
channel_args: @config.channel_args,
|
170
|
-
interceptors: @config.interceptors
|
170
|
+
interceptors: @config.interceptors,
|
171
|
+
channel_pool_config: @config.channel_pool
|
171
172
|
)
|
172
173
|
end
|
173
174
|
|
@@ -818,7 +819,9 @@ module Google
|
|
818
819
|
class Configuration
|
819
820
|
extend ::Gapic::Config
|
820
821
|
|
821
|
-
|
822
|
+
DEFAULT_ENDPOINT = "language.googleapis.com"
|
823
|
+
|
824
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
822
825
|
config_attr :credentials, nil do |value|
|
823
826
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
824
827
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -853,6 +856,14 @@ module Google
|
|
853
856
|
end
|
854
857
|
end
|
855
858
|
|
859
|
+
##
|
860
|
+
# Configuration for the channel pool
|
861
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
862
|
+
#
|
863
|
+
def channel_pool
|
864
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
865
|
+
end
|
866
|
+
|
856
867
|
##
|
857
868
|
# Configuration RPC class for the LanguageService API.
|
858
869
|
#
|
@@ -148,7 +148,7 @@ module Google
|
|
148
148
|
credentials = @config.credentials
|
149
149
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
150
150
|
# but only if the default endpoint does not have a region prefix.
|
151
|
-
enable_self_signed_jwt = @config.endpoint ==
|
151
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
152
152
|
!@config.endpoint.split(".").first.include?("-")
|
153
153
|
credentials ||= Credentials.default scope: @config.scope,
|
154
154
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -194,6 +194,22 @@ module Google
|
|
194
194
|
# @return [::Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse]
|
195
195
|
#
|
196
196
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
197
|
+
#
|
198
|
+
# @example Basic example
|
199
|
+
# require "google/cloud/language/v1beta2"
|
200
|
+
#
|
201
|
+
# # Create a client object. The client can be reused for multiple calls.
|
202
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
203
|
+
#
|
204
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
205
|
+
# request = Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest.new
|
206
|
+
#
|
207
|
+
# # Call the analyze_sentiment method.
|
208
|
+
# result = client.analyze_sentiment request
|
209
|
+
#
|
210
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse.
|
211
|
+
# p result
|
212
|
+
#
|
197
213
|
def analyze_sentiment request, options = nil
|
198
214
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
199
215
|
|
@@ -260,6 +276,22 @@ module Google
|
|
260
276
|
# @return [::Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse]
|
261
277
|
#
|
262
278
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
279
|
+
#
|
280
|
+
# @example Basic example
|
281
|
+
# require "google/cloud/language/v1beta2"
|
282
|
+
#
|
283
|
+
# # Create a client object. The client can be reused for multiple calls.
|
284
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
285
|
+
#
|
286
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
287
|
+
# request = Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest.new
|
288
|
+
#
|
289
|
+
# # Call the analyze_entities method.
|
290
|
+
# result = client.analyze_entities request
|
291
|
+
#
|
292
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse.
|
293
|
+
# p result
|
294
|
+
#
|
263
295
|
def analyze_entities request, options = nil
|
264
296
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
265
297
|
|
@@ -327,6 +359,22 @@ module Google
|
|
327
359
|
# @return [::Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse]
|
328
360
|
#
|
329
361
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
362
|
+
#
|
363
|
+
# @example Basic example
|
364
|
+
# require "google/cloud/language/v1beta2"
|
365
|
+
#
|
366
|
+
# # Create a client object. The client can be reused for multiple calls.
|
367
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
368
|
+
#
|
369
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
370
|
+
# request = Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest.new
|
371
|
+
#
|
372
|
+
# # Call the analyze_entity_sentiment method.
|
373
|
+
# result = client.analyze_entity_sentiment request
|
374
|
+
#
|
375
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse.
|
376
|
+
# p result
|
377
|
+
#
|
330
378
|
def analyze_entity_sentiment request, options = nil
|
331
379
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
332
380
|
|
@@ -393,6 +441,22 @@ module Google
|
|
393
441
|
# @return [::Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse]
|
394
442
|
#
|
395
443
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
444
|
+
#
|
445
|
+
# @example Basic example
|
446
|
+
# require "google/cloud/language/v1beta2"
|
447
|
+
#
|
448
|
+
# # Create a client object. The client can be reused for multiple calls.
|
449
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
450
|
+
#
|
451
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
452
|
+
# request = Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest.new
|
453
|
+
#
|
454
|
+
# # Call the analyze_syntax method.
|
455
|
+
# result = client.analyze_syntax request
|
456
|
+
#
|
457
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse.
|
458
|
+
# p result
|
459
|
+
#
|
396
460
|
def analyze_syntax request, options = nil
|
397
461
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
398
462
|
|
@@ -458,6 +522,22 @@ module Google
|
|
458
522
|
# @return [::Google::Cloud::Language::V1beta2::ClassifyTextResponse]
|
459
523
|
#
|
460
524
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
525
|
+
#
|
526
|
+
# @example Basic example
|
527
|
+
# require "google/cloud/language/v1beta2"
|
528
|
+
#
|
529
|
+
# # Create a client object. The client can be reused for multiple calls.
|
530
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
531
|
+
#
|
532
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
533
|
+
# request = Google::Cloud::Language::V1beta2::ClassifyTextRequest.new
|
534
|
+
#
|
535
|
+
# # Call the classify_text method.
|
536
|
+
# result = client.classify_text request
|
537
|
+
#
|
538
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::ClassifyTextResponse.
|
539
|
+
# p result
|
540
|
+
#
|
461
541
|
def classify_text request, options = nil
|
462
542
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
463
543
|
|
@@ -520,6 +600,22 @@ module Google
|
|
520
600
|
# @return [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
521
601
|
#
|
522
602
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
603
|
+
#
|
604
|
+
# @example Basic example
|
605
|
+
# require "google/cloud/language/v1beta2"
|
606
|
+
#
|
607
|
+
# # Create a client object. The client can be reused for multiple calls.
|
608
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
609
|
+
#
|
610
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
611
|
+
# request = Google::Cloud::Language::V1beta2::ModerateTextRequest.new
|
612
|
+
#
|
613
|
+
# # Call the moderate_text method.
|
614
|
+
# result = client.moderate_text request
|
615
|
+
#
|
616
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::ModerateTextResponse.
|
617
|
+
# p result
|
618
|
+
#
|
523
619
|
def moderate_text request, options = nil
|
524
620
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
525
621
|
|
@@ -587,6 +683,22 @@ module Google
|
|
587
683
|
# @return [::Google::Cloud::Language::V1beta2::AnnotateTextResponse]
|
588
684
|
#
|
589
685
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
686
|
+
#
|
687
|
+
# @example Basic example
|
688
|
+
# require "google/cloud/language/v1beta2"
|
689
|
+
#
|
690
|
+
# # Create a client object. The client can be reused for multiple calls.
|
691
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Rest::Client.new
|
692
|
+
#
|
693
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
694
|
+
# request = Google::Cloud::Language::V1beta2::AnnotateTextRequest.new
|
695
|
+
#
|
696
|
+
# # Call the annotate_text method.
|
697
|
+
# result = client.annotate_text request
|
698
|
+
#
|
699
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::AnnotateTextResponse.
|
700
|
+
# p result
|
701
|
+
#
|
590
702
|
def annotate_text request, options = nil
|
591
703
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
592
704
|
|
@@ -695,7 +807,9 @@ module Google
|
|
695
807
|
class Configuration
|
696
808
|
extend ::Gapic::Config
|
697
809
|
|
698
|
-
|
810
|
+
DEFAULT_ENDPOINT = "language.googleapis.com"
|
811
|
+
|
812
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
699
813
|
config_attr :credentials, nil do |value|
|
700
814
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
701
815
|
allowed.any? { |klass| klass === value }
|
@@ -59,7 +59,7 @@ module Google
|
|
59
59
|
|
60
60
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_sentiment_request request_pb
|
61
61
|
query_string_params = if query_string_params.any?
|
62
|
-
query_string_params.to_h { |p| p.split
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
63
63
|
else
|
64
64
|
{}
|
65
65
|
end
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
|
98
98
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_entities_request request_pb
|
99
99
|
query_string_params = if query_string_params.any?
|
100
|
-
query_string_params.to_h { |p| p.split
|
100
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
101
101
|
else
|
102
102
|
{}
|
103
103
|
end
|
@@ -135,7 +135,7 @@ module Google
|
|
135
135
|
|
136
136
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_entity_sentiment_request request_pb
|
137
137
|
query_string_params = if query_string_params.any?
|
138
|
-
query_string_params.to_h { |p| p.split
|
138
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
139
139
|
else
|
140
140
|
{}
|
141
141
|
end
|
@@ -173,7 +173,7 @@ module Google
|
|
173
173
|
|
174
174
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_syntax_request request_pb
|
175
175
|
query_string_params = if query_string_params.any?
|
176
|
-
query_string_params.to_h { |p| p.split
|
176
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
177
177
|
else
|
178
178
|
{}
|
179
179
|
end
|
@@ -211,7 +211,7 @@ module Google
|
|
211
211
|
|
212
212
|
verb, uri, query_string_params, body = ServiceStub.transcode_classify_text_request request_pb
|
213
213
|
query_string_params = if query_string_params.any?
|
214
|
-
query_string_params.to_h { |p| p.split
|
214
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
215
215
|
else
|
216
216
|
{}
|
217
217
|
end
|
@@ -249,7 +249,7 @@ module Google
|
|
249
249
|
|
250
250
|
verb, uri, query_string_params, body = ServiceStub.transcode_moderate_text_request request_pb
|
251
251
|
query_string_params = if query_string_params.any?
|
252
|
-
query_string_params.to_h { |p| p.split
|
252
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
253
253
|
else
|
254
254
|
{}
|
255
255
|
end
|
@@ -287,7 +287,7 @@ module Google
|
|
287
287
|
|
288
288
|
verb, uri, query_string_params, body = ServiceStub.transcode_annotate_text_request request_pb
|
289
289
|
query_string_params = if query_string_params.any?
|
290
|
-
query_string_params.to_h { |p| p.split
|
290
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
291
291
|
else
|
292
292
|
{}
|
293
293
|
end
|
@@ -66,6 +66,20 @@ module Google
|
|
66
66
|
# a non-empty value will be returned. The user will not be aware of what
|
67
67
|
# non-empty value to expect.
|
68
68
|
NON_EMPTY_DEFAULT = 7
|
69
|
+
|
70
|
+
# Denotes that the field in a resource (a message annotated with
|
71
|
+
# google.api.resource) is used in the resource name to uniquely identify the
|
72
|
+
# resource. For AIP-compliant APIs, this should only be applied to the
|
73
|
+
# `name` field on the resource.
|
74
|
+
#
|
75
|
+
# This behavior should not be applied to references to other resources within
|
76
|
+
# the message.
|
77
|
+
#
|
78
|
+
# The identifier field of resources often have different field behavior
|
79
|
+
# depending on the request it is embedded in (e.g. for Create methods name
|
80
|
+
# is optional and unused, while for Update methods it is required). Instead
|
81
|
+
# of method-specific annotations, only `IDENTIFIER` is required.
|
82
|
+
IDENTIFIER = 8
|
69
83
|
end
|
70
84
|
end
|
71
85
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-language-v1beta2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.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: 2023-
|
11
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.20.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.20.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
rubygems_version: 3.4.
|
211
|
+
rubygems_version: 3.4.19
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: Provides natural language understanding technologies, such as sentiment analysis,
|