google-cloud-language-v1 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57b3621633efdcf5ed36ae27fa2c760b8d9eef4a80cf5673d987eef5bae262f3
4
- data.tar.gz: b5a70cc8b6a46cf0d2b4755217fa3132245a4c8316c68f580b39bba423f963ec
3
+ metadata.gz: bd8756a09f78601b9b50da2da7b46aad5f876a8d115e20f3944e35ae066c8469
4
+ data.tar.gz: 1af2459d215cc64f0bde68a4e9d6cf3b8900219f3b338814d2ab73520e4803c7
5
5
  SHA512:
6
- metadata.gz: c5cca96d308085f9653821e4293a4e64f8fa502bc5530321a8b801eabb034612e20926faeb5e0d81f5b62fd19546699577898b50e8270048063b9a3ff6091ce5
7
- data.tar.gz: 1cb0ae3259d58e2eb469a0f25a7887eeef778656a970d8699ad7fd4b5167ff9fce8f72712c0768b0032d7919aa8da3feb1e4541060420dc931997e342dd7bd90
6
+ metadata.gz: 30ff07f6bcf676a97d68fcd9487ad97f6aa826d48314e181669c01ee59c2e66f3a4eb02d6d88e4e66456e1c32dc6012c2f7df7bfef83f796d9204e5c0a1e8df1
7
+ data.tar.gz: 1a49ecc77f4c2377793883d2518fb6f2e265c7c80778b7c39177741358f3b187468e7fc44975e8020579fd9af096aa659490728f7253239a95b64d8067528dd4
@@ -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 == Client.configure.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
 
@@ -817,7 +818,9 @@ module Google
817
818
  class Configuration
818
819
  extend ::Gapic::Config
819
820
 
820
- config_attr :endpoint, "language.googleapis.com", ::String
821
+ DEFAULT_ENDPOINT = "language.googleapis.com"
822
+
823
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
821
824
  config_attr :credentials, nil do |value|
822
825
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
823
826
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -852,6 +855,14 @@ module Google
852
855
  end
853
856
  end
854
857
 
858
+ ##
859
+ # Configuration for the channel pool
860
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
861
+ #
862
+ def channel_pool
863
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
864
+ end
865
+
855
866
  ##
856
867
  # Configuration RPC class for the LanguageService API.
857
868
  #
@@ -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 == Client.configure.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
@@ -193,6 +193,22 @@ module Google
193
193
  # @return [::Google::Cloud::Language::V1::AnalyzeSentimentResponse]
194
194
  #
195
195
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
196
+ #
197
+ # @example Basic example
198
+ # require "google/cloud/language/v1"
199
+ #
200
+ # # Create a client object. The client can be reused for multiple calls.
201
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
202
+ #
203
+ # # Create a request. To set request fields, pass in keyword arguments.
204
+ # request = Google::Cloud::Language::V1::AnalyzeSentimentRequest.new
205
+ #
206
+ # # Call the analyze_sentiment method.
207
+ # result = client.analyze_sentiment request
208
+ #
209
+ # # The returned object is of type Google::Cloud::Language::V1::AnalyzeSentimentResponse.
210
+ # p result
211
+ #
196
212
  def analyze_sentiment request, options = nil
197
213
  raise ::ArgumentError, "request must be provided" if request.nil?
198
214
 
@@ -259,6 +275,22 @@ module Google
259
275
  # @return [::Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
260
276
  #
261
277
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
278
+ #
279
+ # @example Basic example
280
+ # require "google/cloud/language/v1"
281
+ #
282
+ # # Create a client object. The client can be reused for multiple calls.
283
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
284
+ #
285
+ # # Create a request. To set request fields, pass in keyword arguments.
286
+ # request = Google::Cloud::Language::V1::AnalyzeEntitiesRequest.new
287
+ #
288
+ # # Call the analyze_entities method.
289
+ # result = client.analyze_entities request
290
+ #
291
+ # # The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitiesResponse.
292
+ # p result
293
+ #
262
294
  def analyze_entities request, options = nil
263
295
  raise ::ArgumentError, "request must be provided" if request.nil?
264
296
 
@@ -326,6 +358,22 @@ module Google
326
358
  # @return [::Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse]
327
359
  #
328
360
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
361
+ #
362
+ # @example Basic example
363
+ # require "google/cloud/language/v1"
364
+ #
365
+ # # Create a client object. The client can be reused for multiple calls.
366
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
367
+ #
368
+ # # Create a request. To set request fields, pass in keyword arguments.
369
+ # request = Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest.new
370
+ #
371
+ # # Call the analyze_entity_sentiment method.
372
+ # result = client.analyze_entity_sentiment request
373
+ #
374
+ # # The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse.
375
+ # p result
376
+ #
329
377
  def analyze_entity_sentiment request, options = nil
330
378
  raise ::ArgumentError, "request must be provided" if request.nil?
331
379
 
@@ -392,6 +440,22 @@ module Google
392
440
  # @return [::Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
393
441
  #
394
442
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
443
+ #
444
+ # @example Basic example
445
+ # require "google/cloud/language/v1"
446
+ #
447
+ # # Create a client object. The client can be reused for multiple calls.
448
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
449
+ #
450
+ # # Create a request. To set request fields, pass in keyword arguments.
451
+ # request = Google::Cloud::Language::V1::AnalyzeSyntaxRequest.new
452
+ #
453
+ # # Call the analyze_syntax method.
454
+ # result = client.analyze_syntax request
455
+ #
456
+ # # The returned object is of type Google::Cloud::Language::V1::AnalyzeSyntaxResponse.
457
+ # p result
458
+ #
395
459
  def analyze_syntax request, options = nil
396
460
  raise ::ArgumentError, "request must be provided" if request.nil?
397
461
 
@@ -457,6 +521,22 @@ module Google
457
521
  # @return [::Google::Cloud::Language::V1::ClassifyTextResponse]
458
522
  #
459
523
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
524
+ #
525
+ # @example Basic example
526
+ # require "google/cloud/language/v1"
527
+ #
528
+ # # Create a client object. The client can be reused for multiple calls.
529
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
530
+ #
531
+ # # Create a request. To set request fields, pass in keyword arguments.
532
+ # request = Google::Cloud::Language::V1::ClassifyTextRequest.new
533
+ #
534
+ # # Call the classify_text method.
535
+ # result = client.classify_text request
536
+ #
537
+ # # The returned object is of type Google::Cloud::Language::V1::ClassifyTextResponse.
538
+ # p result
539
+ #
460
540
  def classify_text request, options = nil
461
541
  raise ::ArgumentError, "request must be provided" if request.nil?
462
542
 
@@ -519,6 +599,22 @@ module Google
519
599
  # @return [::Google::Cloud::Language::V1::ModerateTextResponse]
520
600
  #
521
601
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
602
+ #
603
+ # @example Basic example
604
+ # require "google/cloud/language/v1"
605
+ #
606
+ # # Create a client object. The client can be reused for multiple calls.
607
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
608
+ #
609
+ # # Create a request. To set request fields, pass in keyword arguments.
610
+ # request = Google::Cloud::Language::V1::ModerateTextRequest.new
611
+ #
612
+ # # Call the moderate_text method.
613
+ # result = client.moderate_text request
614
+ #
615
+ # # The returned object is of type Google::Cloud::Language::V1::ModerateTextResponse.
616
+ # p result
617
+ #
522
618
  def moderate_text request, options = nil
523
619
  raise ::ArgumentError, "request must be provided" if request.nil?
524
620
 
@@ -586,6 +682,22 @@ module Google
586
682
  # @return [::Google::Cloud::Language::V1::AnnotateTextResponse]
587
683
  #
588
684
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/cloud/language/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::Language::V1::LanguageService::Rest::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::Language::V1::AnnotateTextRequest.new
694
+ #
695
+ # # Call the annotate_text method.
696
+ # result = client.annotate_text request
697
+ #
698
+ # # The returned object is of type Google::Cloud::Language::V1::AnnotateTextResponse.
699
+ # p result
700
+ #
589
701
  def annotate_text request, options = nil
590
702
  raise ::ArgumentError, "request must be provided" if request.nil?
591
703
 
@@ -694,7 +806,9 @@ module Google
694
806
  class Configuration
695
807
  extend ::Gapic::Config
696
808
 
697
- config_attr :endpoint, "language.googleapis.com", ::String
809
+ DEFAULT_ENDPOINT = "language.googleapis.com"
810
+
811
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
698
812
  config_attr :credentials, nil do |value|
699
813
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
700
814
  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("=", 2) }
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("=", 2) }
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("=", 2) }
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("=", 2) }
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("=", 2) }
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("=", 2) }
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("=", 2) }
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
291
  else
292
292
  {}
293
293
  end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Language
23
23
  module V1
24
- VERSION = "0.8.0"
24
+ VERSION = "0.9.0"
25
25
  end
26
26
  end
27
27
  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-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.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-05-31 00:00:00.000000000 Z
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.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.19.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.2
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,