google-apis-language_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,333 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module LanguageV2
24
+
25
+ class AnalyzeEntitiesRequest
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AnalyzeEntitiesResponse
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class AnalyzeSentimentRequest
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class AnalyzeSentimentResponse
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class AnnotateTextRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class AnnotateTextResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class ClassificationCategory
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class ClassifyTextRequest
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ClassifyTextResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class Document
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class Entity
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class EntityMention
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Features
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class ModerateTextRequest
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class ModerateTextResponse
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class Sentence
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class Sentiment
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class Status
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class TextSpan
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class AnalyzeEntitiesRequest
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :document, as: 'document', class: Google::Apis::LanguageV2::Document, decorator: Google::Apis::LanguageV2::Document::Representation
143
+
144
+ property :encoding_type, as: 'encodingType'
145
+ end
146
+ end
147
+
148
+ class AnalyzeEntitiesResponse
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ collection :entities, as: 'entities', class: Google::Apis::LanguageV2::Entity, decorator: Google::Apis::LanguageV2::Entity::Representation
152
+
153
+ property :language_code, as: 'languageCode'
154
+ property :language_supported, as: 'languageSupported'
155
+ end
156
+ end
157
+
158
+ class AnalyzeSentimentRequest
159
+ # @private
160
+ class Representation < Google::Apis::Core::JsonRepresentation
161
+ property :document, as: 'document', class: Google::Apis::LanguageV2::Document, decorator: Google::Apis::LanguageV2::Document::Representation
162
+
163
+ property :encoding_type, as: 'encodingType'
164
+ end
165
+ end
166
+
167
+ class AnalyzeSentimentResponse
168
+ # @private
169
+ class Representation < Google::Apis::Core::JsonRepresentation
170
+ property :document_sentiment, as: 'documentSentiment', class: Google::Apis::LanguageV2::Sentiment, decorator: Google::Apis::LanguageV2::Sentiment::Representation
171
+
172
+ property :language_code, as: 'languageCode'
173
+ property :language_supported, as: 'languageSupported'
174
+ collection :sentences, as: 'sentences', class: Google::Apis::LanguageV2::Sentence, decorator: Google::Apis::LanguageV2::Sentence::Representation
175
+
176
+ end
177
+ end
178
+
179
+ class AnnotateTextRequest
180
+ # @private
181
+ class Representation < Google::Apis::Core::JsonRepresentation
182
+ property :document, as: 'document', class: Google::Apis::LanguageV2::Document, decorator: Google::Apis::LanguageV2::Document::Representation
183
+
184
+ property :encoding_type, as: 'encodingType'
185
+ property :features, as: 'features', class: Google::Apis::LanguageV2::Features, decorator: Google::Apis::LanguageV2::Features::Representation
186
+
187
+ end
188
+ end
189
+
190
+ class AnnotateTextResponse
191
+ # @private
192
+ class Representation < Google::Apis::Core::JsonRepresentation
193
+ collection :categories, as: 'categories', class: Google::Apis::LanguageV2::ClassificationCategory, decorator: Google::Apis::LanguageV2::ClassificationCategory::Representation
194
+
195
+ property :document_sentiment, as: 'documentSentiment', class: Google::Apis::LanguageV2::Sentiment, decorator: Google::Apis::LanguageV2::Sentiment::Representation
196
+
197
+ collection :entities, as: 'entities', class: Google::Apis::LanguageV2::Entity, decorator: Google::Apis::LanguageV2::Entity::Representation
198
+
199
+ property :language_code, as: 'languageCode'
200
+ property :language_supported, as: 'languageSupported'
201
+ collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV2::ClassificationCategory, decorator: Google::Apis::LanguageV2::ClassificationCategory::Representation
202
+
203
+ collection :sentences, as: 'sentences', class: Google::Apis::LanguageV2::Sentence, decorator: Google::Apis::LanguageV2::Sentence::Representation
204
+
205
+ end
206
+ end
207
+
208
+ class ClassificationCategory
209
+ # @private
210
+ class Representation < Google::Apis::Core::JsonRepresentation
211
+ property :confidence, as: 'confidence'
212
+ property :name, as: 'name'
213
+ end
214
+ end
215
+
216
+ class ClassifyTextRequest
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ property :document, as: 'document', class: Google::Apis::LanguageV2::Document, decorator: Google::Apis::LanguageV2::Document::Representation
220
+
221
+ end
222
+ end
223
+
224
+ class ClassifyTextResponse
225
+ # @private
226
+ class Representation < Google::Apis::Core::JsonRepresentation
227
+ collection :categories, as: 'categories', class: Google::Apis::LanguageV2::ClassificationCategory, decorator: Google::Apis::LanguageV2::ClassificationCategory::Representation
228
+
229
+ property :language_code, as: 'languageCode'
230
+ property :language_supported, as: 'languageSupported'
231
+ end
232
+ end
233
+
234
+ class Document
235
+ # @private
236
+ class Representation < Google::Apis::Core::JsonRepresentation
237
+ property :content, as: 'content'
238
+ property :gcs_content_uri, as: 'gcsContentUri'
239
+ property :language_code, as: 'languageCode'
240
+ property :type, as: 'type'
241
+ end
242
+ end
243
+
244
+ class Entity
245
+ # @private
246
+ class Representation < Google::Apis::Core::JsonRepresentation
247
+ collection :mentions, as: 'mentions', class: Google::Apis::LanguageV2::EntityMention, decorator: Google::Apis::LanguageV2::EntityMention::Representation
248
+
249
+ hash :metadata, as: 'metadata'
250
+ property :name, as: 'name'
251
+ property :sentiment, as: 'sentiment', class: Google::Apis::LanguageV2::Sentiment, decorator: Google::Apis::LanguageV2::Sentiment::Representation
252
+
253
+ property :type, as: 'type'
254
+ end
255
+ end
256
+
257
+ class EntityMention
258
+ # @private
259
+ class Representation < Google::Apis::Core::JsonRepresentation
260
+ property :probability, as: 'probability'
261
+ property :sentiment, as: 'sentiment', class: Google::Apis::LanguageV2::Sentiment, decorator: Google::Apis::LanguageV2::Sentiment::Representation
262
+
263
+ property :text, as: 'text', class: Google::Apis::LanguageV2::TextSpan, decorator: Google::Apis::LanguageV2::TextSpan::Representation
264
+
265
+ property :type, as: 'type'
266
+ end
267
+ end
268
+
269
+ class Features
270
+ # @private
271
+ class Representation < Google::Apis::Core::JsonRepresentation
272
+ property :classify_text, as: 'classifyText'
273
+ property :extract_document_sentiment, as: 'extractDocumentSentiment'
274
+ property :extract_entities, as: 'extractEntities'
275
+ property :moderate_text, as: 'moderateText'
276
+ end
277
+ end
278
+
279
+ class ModerateTextRequest
280
+ # @private
281
+ class Representation < Google::Apis::Core::JsonRepresentation
282
+ property :document, as: 'document', class: Google::Apis::LanguageV2::Document, decorator: Google::Apis::LanguageV2::Document::Representation
283
+
284
+ end
285
+ end
286
+
287
+ class ModerateTextResponse
288
+ # @private
289
+ class Representation < Google::Apis::Core::JsonRepresentation
290
+ property :language_code, as: 'languageCode'
291
+ property :language_supported, as: 'languageSupported'
292
+ collection :moderation_categories, as: 'moderationCategories', class: Google::Apis::LanguageV2::ClassificationCategory, decorator: Google::Apis::LanguageV2::ClassificationCategory::Representation
293
+
294
+ end
295
+ end
296
+
297
+ class Sentence
298
+ # @private
299
+ class Representation < Google::Apis::Core::JsonRepresentation
300
+ property :sentiment, as: 'sentiment', class: Google::Apis::LanguageV2::Sentiment, decorator: Google::Apis::LanguageV2::Sentiment::Representation
301
+
302
+ property :text, as: 'text', class: Google::Apis::LanguageV2::TextSpan, decorator: Google::Apis::LanguageV2::TextSpan::Representation
303
+
304
+ end
305
+ end
306
+
307
+ class Sentiment
308
+ # @private
309
+ class Representation < Google::Apis::Core::JsonRepresentation
310
+ property :magnitude, as: 'magnitude'
311
+ property :score, as: 'score'
312
+ end
313
+ end
314
+
315
+ class Status
316
+ # @private
317
+ class Representation < Google::Apis::Core::JsonRepresentation
318
+ property :code, as: 'code'
319
+ collection :details, as: 'details'
320
+ property :message, as: 'message'
321
+ end
322
+ end
323
+
324
+ class TextSpan
325
+ # @private
326
+ class Representation < Google::Apis::Core::JsonRepresentation
327
+ property :begin_offset, as: 'beginOffset'
328
+ property :content, as: 'content'
329
+ end
330
+ end
331
+ end
332
+ end
333
+ end
@@ -0,0 +1,215 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module LanguageV2
23
+ # Cloud Natural Language API
24
+ #
25
+ # Provides natural language understanding technologies, such as sentiment
26
+ # analysis, entity recognition, entity sentiment analysis, and other text
27
+ # annotations, to developers.
28
+ #
29
+ # @example
30
+ # require 'google/apis/language_v2'
31
+ #
32
+ # Language = Google::Apis::LanguageV2 # Alias the module
33
+ # service = Language::CloudNaturalLanguageService.new
34
+ #
35
+ # @see https://cloud.google.com/natural-language/
36
+ class CloudNaturalLanguageService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://language.googleapis.com/', '',
49
+ client_name: 'google-apis-language_v2',
50
+ client_version: Google::Apis::LanguageV2::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Finds named entities (currently proper names and common nouns) in the text
55
+ # along with entity types, probability, mentions for each entity, and other
56
+ # properties.
57
+ # @param [Google::Apis::LanguageV2::AnalyzeEntitiesRequest] analyze_entities_request_object
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::LanguageV2::AnalyzeEntitiesResponse] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::LanguageV2::AnalyzeEntitiesResponse]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def analyze_document_entities(analyze_entities_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:post, 'v2/documents:analyzeEntities', options)
77
+ command.request_representation = Google::Apis::LanguageV2::AnalyzeEntitiesRequest::Representation
78
+ command.request_object = analyze_entities_request_object
79
+ command.response_representation = Google::Apis::LanguageV2::AnalyzeEntitiesResponse::Representation
80
+ command.response_class = Google::Apis::LanguageV2::AnalyzeEntitiesResponse
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Analyzes the sentiment of the provided text.
87
+ # @param [Google::Apis::LanguageV2::AnalyzeSentimentRequest] analyze_sentiment_request_object
88
+ # @param [String] fields
89
+ # Selector specifying which fields to include in a partial response.
90
+ # @param [String] quota_user
91
+ # Available to use for quota purposes for server-side applications. Can be any
92
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
93
+ # @param [Google::Apis::RequestOptions] options
94
+ # Request-specific options
95
+ #
96
+ # @yield [result, err] Result & error if block supplied
97
+ # @yieldparam result [Google::Apis::LanguageV2::AnalyzeSentimentResponse] parsed result object
98
+ # @yieldparam err [StandardError] error object if request failed
99
+ #
100
+ # @return [Google::Apis::LanguageV2::AnalyzeSentimentResponse]
101
+ #
102
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
103
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
104
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
105
+ def analyze_document_sentiment(analyze_sentiment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
106
+ command = make_simple_command(:post, 'v2/documents:analyzeSentiment', options)
107
+ command.request_representation = Google::Apis::LanguageV2::AnalyzeSentimentRequest::Representation
108
+ command.request_object = analyze_sentiment_request_object
109
+ command.response_representation = Google::Apis::LanguageV2::AnalyzeSentimentResponse::Representation
110
+ command.response_class = Google::Apis::LanguageV2::AnalyzeSentimentResponse
111
+ command.query['fields'] = fields unless fields.nil?
112
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
113
+ execute_or_queue_command(command, &block)
114
+ end
115
+
116
+ # A convenience method that provides all features in one call.
117
+ # @param [Google::Apis::LanguageV2::AnnotateTextRequest] annotate_text_request_object
118
+ # @param [String] fields
119
+ # Selector specifying which fields to include in a partial response.
120
+ # @param [String] quota_user
121
+ # Available to use for quota purposes for server-side applications. Can be any
122
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
123
+ # @param [Google::Apis::RequestOptions] options
124
+ # Request-specific options
125
+ #
126
+ # @yield [result, err] Result & error if block supplied
127
+ # @yieldparam result [Google::Apis::LanguageV2::AnnotateTextResponse] parsed result object
128
+ # @yieldparam err [StandardError] error object if request failed
129
+ #
130
+ # @return [Google::Apis::LanguageV2::AnnotateTextResponse]
131
+ #
132
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
133
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
134
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
135
+ def annotate_document_text(annotate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
136
+ command = make_simple_command(:post, 'v2/documents:annotateText', options)
137
+ command.request_representation = Google::Apis::LanguageV2::AnnotateTextRequest::Representation
138
+ command.request_object = annotate_text_request_object
139
+ command.response_representation = Google::Apis::LanguageV2::AnnotateTextResponse::Representation
140
+ command.response_class = Google::Apis::LanguageV2::AnnotateTextResponse
141
+ command.query['fields'] = fields unless fields.nil?
142
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
143
+ execute_or_queue_command(command, &block)
144
+ end
145
+
146
+ # Classifies a document into categories.
147
+ # @param [Google::Apis::LanguageV2::ClassifyTextRequest] classify_text_request_object
148
+ # @param [String] fields
149
+ # Selector specifying which fields to include in a partial response.
150
+ # @param [String] quota_user
151
+ # Available to use for quota purposes for server-side applications. Can be any
152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
153
+ # @param [Google::Apis::RequestOptions] options
154
+ # Request-specific options
155
+ #
156
+ # @yield [result, err] Result & error if block supplied
157
+ # @yieldparam result [Google::Apis::LanguageV2::ClassifyTextResponse] parsed result object
158
+ # @yieldparam err [StandardError] error object if request failed
159
+ #
160
+ # @return [Google::Apis::LanguageV2::ClassifyTextResponse]
161
+ #
162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
165
+ def classify_document_text(classify_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
166
+ command = make_simple_command(:post, 'v2/documents:classifyText', options)
167
+ command.request_representation = Google::Apis::LanguageV2::ClassifyTextRequest::Representation
168
+ command.request_object = classify_text_request_object
169
+ command.response_representation = Google::Apis::LanguageV2::ClassifyTextResponse::Representation
170
+ command.response_class = Google::Apis::LanguageV2::ClassifyTextResponse
171
+ command.query['fields'] = fields unless fields.nil?
172
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
173
+ execute_or_queue_command(command, &block)
174
+ end
175
+
176
+ # Moderates a document for harmful and sensitive categories.
177
+ # @param [Google::Apis::LanguageV2::ModerateTextRequest] moderate_text_request_object
178
+ # @param [String] fields
179
+ # Selector specifying which fields to include in a partial response.
180
+ # @param [String] quota_user
181
+ # Available to use for quota purposes for server-side applications. Can be any
182
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
183
+ # @param [Google::Apis::RequestOptions] options
184
+ # Request-specific options
185
+ #
186
+ # @yield [result, err] Result & error if block supplied
187
+ # @yieldparam result [Google::Apis::LanguageV2::ModerateTextResponse] parsed result object
188
+ # @yieldparam err [StandardError] error object if request failed
189
+ #
190
+ # @return [Google::Apis::LanguageV2::ModerateTextResponse]
191
+ #
192
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
193
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
194
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
195
+ def moderate_document_text(moderate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
196
+ command = make_simple_command(:post, 'v2/documents:moderateText', options)
197
+ command.request_representation = Google::Apis::LanguageV2::ModerateTextRequest::Representation
198
+ command.request_object = moderate_text_request_object
199
+ command.response_representation = Google::Apis::LanguageV2::ModerateTextResponse::Representation
200
+ command.response_class = Google::Apis::LanguageV2::ModerateTextResponse
201
+ command.query['fields'] = fields unless fields.nil?
202
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
203
+ execute_or_queue_command(command, &block)
204
+ end
205
+
206
+ protected
207
+
208
+ def apply_command_defaults(command)
209
+ command.query['key'] = key unless key.nil?
210
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,41 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/language_v2/service.rb'
16
+ require 'google/apis/language_v2/classes.rb'
17
+ require 'google/apis/language_v2/representations.rb'
18
+ require 'google/apis/language_v2/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Cloud Natural Language API
23
+ #
24
+ # Provides natural language understanding technologies, such as sentiment
25
+ # analysis, entity recognition, entity sentiment analysis, and other text
26
+ # annotations, to developers.
27
+ #
28
+ # @see https://cloud.google.com/natural-language/
29
+ module LanguageV2
30
+ # Version of the Cloud Natural Language API this client connects to.
31
+ # This is NOT the gem version.
32
+ VERSION = 'V2'
33
+
34
+ # Apply machine learning models to reveal the structure and meaning of text
35
+ AUTH_CLOUD_LANGUAGE = 'https://www.googleapis.com/auth/cloud-language'
36
+
37
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
38
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/language_v2"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-language_v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.11.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.a
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.11.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.a
33
+ description: This is the simple REST client for Cloud Natural Language API V2. Simple
34
+ REST clients are Ruby client libraries that provide access to Google services via
35
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
36
+ based on the discovery documents published by the service, and they handle most
37
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
38
+ use this client to access the Cloud Natural Language API, but note that some services
39
+ may provide a separate modern client that is easier to use.
40
+ email: googleapis-packages@google.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".yardopts"
46
+ - CHANGELOG.md
47
+ - LICENSE.md
48
+ - OVERVIEW.md
49
+ - lib/google-apis-language_v2.rb
50
+ - lib/google/apis/language_v2.rb
51
+ - lib/google/apis/language_v2/classes.rb
52
+ - lib/google/apis/language_v2/gem_version.rb
53
+ - lib/google/apis/language_v2/representations.rb
54
+ - lib/google/apis/language_v2/service.rb
55
+ homepage: https://github.com/google/google-api-ruby-client
56
+ licenses:
57
+ - Apache-2.0
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-language_v2/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-language_v2/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-language_v2
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '2.5'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.4.19
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Simple REST client for Cloud Natural Language API V2
82
+ test_files: []