google-api-client 0.30.6 → 0.30.7
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/CHANGELOG.md +19 -0
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +7 -0
- data/generated/google/apis/bigquery_v2/representations.rb +2 -0
- data/generated/google/apis/bigquery_v2/service.rb +1 -1
- data/generated/google/apis/cloudiot_v1.rb +1 -1
- data/generated/google/apis/cloudiot_v1/classes.rb +2 -2
- data/generated/google/apis/dialogflow_v2.rb +1 -1
- data/generated/google/apis/dialogflow_v2/classes.rb +91 -19
- data/generated/google/apis/dialogflow_v2/representations.rb +32 -13
- data/generated/google/apis/dialogflow_v2beta1.rb +1 -1
- data/generated/google/apis/dialogflow_v2beta1/classes.rb +91 -19
- data/generated/google/apis/dialogflow_v2beta1/representations.rb +33 -14
- data/generated/google/apis/docs_v1.rb +1 -1
- data/generated/google/apis/docs_v1/classes.rb +103 -0
- data/generated/google/apis/docs_v1/representations.rb +37 -0
- data/generated/google/apis/jobs_v2.rb +1 -1
- data/generated/google/apis/jobs_v2/classes.rb +147 -240
- data/generated/google/apis/jobs_v2/service.rb +24 -44
- data/generated/google/apis/jobs_v3.rb +1 -1
- data/generated/google/apis/jobs_v3/classes.rb +113 -179
- data/generated/google/apis/jobs_v3/service.rb +25 -50
- data/generated/google/apis/jobs_v3p1beta1.rb +1 -1
- data/generated/google/apis/jobs_v3p1beta1/classes.rb +119 -187
- data/generated/google/apis/jobs_v3p1beta1/service.rb +25 -50
- data/generated/google/apis/people_v1.rb +1 -1
- data/generated/google/apis/people_v1/classes.rb +105 -0
- data/generated/google/apis/people_v1/representations.rb +42 -0
- data/generated/google/apis/people_v1/service.rb +98 -0
- data/generated/google/apis/slides_v1.rb +1 -1
- data/generated/google/apis/translate_v3beta1.rb +37 -0
- data/generated/google/apis/translate_v3beta1/classes.rb +826 -0
- data/generated/google/apis/translate_v3beta1/representations.rb +404 -0
- data/generated/google/apis/translate_v3beta1/service.rb +706 -0
- data/generated/google/apis/videointelligence_v1.rb +1 -1
- data/generated/google/apis/videointelligence_v1/classes.rb +30 -0
- data/generated/google/apis/videointelligence_v1/representations.rb +10 -0
- data/generated/google/apis/videointelligence_v1beta2.rb +1 -1
- data/generated/google/apis/videointelligence_v1beta2/classes.rb +30 -0
- data/generated/google/apis/videointelligence_v1beta2/representations.rb +10 -0
- data/generated/google/apis/videointelligence_v1p1beta1.rb +1 -1
- data/generated/google/apis/videointelligence_v1p1beta1/classes.rb +30 -0
- data/generated/google/apis/videointelligence_v1p1beta1/representations.rb +10 -0
- data/generated/google/apis/videointelligence_v1p2beta1.rb +1 -1
- data/generated/google/apis/videointelligence_v1p2beta1/classes.rb +30 -0
- data/generated/google/apis/videointelligence_v1p2beta1/representations.rb +10 -0
- data/generated/google/apis/videointelligence_v1p3beta1.rb +1 -1
- data/generated/google/apis/videointelligence_v1p3beta1/classes.rb +30 -0
- data/generated/google/apis/videointelligence_v1p3beta1/representations.rb +10 -0
- data/lib/google/apis/version.rb +1 -1
- metadata +6 -2
@@ -0,0 +1,404 @@
|
|
1
|
+
# Copyright 2015 Google Inc.
|
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 TranslateV3beta1
|
24
|
+
|
25
|
+
class BatchTranslateTextRequest
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class CancelOperationRequest
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class DetectLanguageRequest
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class DetectLanguageResponse
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class DetectedLanguage
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class Empty
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class GcsDestination
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class GcsSource
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class Glossary
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class GlossaryInputConfig
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class InputConfig
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class LanguageCodePair
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class LanguageCodesSet
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
99
|
+
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
101
|
+
end
|
102
|
+
|
103
|
+
class ListGlossariesResponse
|
104
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
105
|
+
|
106
|
+
include Google::Apis::Core::JsonObjectSupport
|
107
|
+
end
|
108
|
+
|
109
|
+
class ListOperationsResponse
|
110
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
111
|
+
|
112
|
+
include Google::Apis::Core::JsonObjectSupport
|
113
|
+
end
|
114
|
+
|
115
|
+
class Operation
|
116
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
117
|
+
|
118
|
+
include Google::Apis::Core::JsonObjectSupport
|
119
|
+
end
|
120
|
+
|
121
|
+
class OutputConfig
|
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 SupportedLanguage
|
134
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
135
|
+
|
136
|
+
include Google::Apis::Core::JsonObjectSupport
|
137
|
+
end
|
138
|
+
|
139
|
+
class SupportedLanguages
|
140
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
141
|
+
|
142
|
+
include Google::Apis::Core::JsonObjectSupport
|
143
|
+
end
|
144
|
+
|
145
|
+
class TranslateTextGlossaryConfig
|
146
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
147
|
+
|
148
|
+
include Google::Apis::Core::JsonObjectSupport
|
149
|
+
end
|
150
|
+
|
151
|
+
class TranslateTextRequest
|
152
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
153
|
+
|
154
|
+
include Google::Apis::Core::JsonObjectSupport
|
155
|
+
end
|
156
|
+
|
157
|
+
class TranslateTextResponse
|
158
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
159
|
+
|
160
|
+
include Google::Apis::Core::JsonObjectSupport
|
161
|
+
end
|
162
|
+
|
163
|
+
class Translation
|
164
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
165
|
+
|
166
|
+
include Google::Apis::Core::JsonObjectSupport
|
167
|
+
end
|
168
|
+
|
169
|
+
class WaitOperationRequest
|
170
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
171
|
+
|
172
|
+
include Google::Apis::Core::JsonObjectSupport
|
173
|
+
end
|
174
|
+
|
175
|
+
class BatchTranslateTextRequest
|
176
|
+
# @private
|
177
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
178
|
+
hash :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
179
|
+
|
180
|
+
collection :input_configs, as: 'inputConfigs', class: Google::Apis::TranslateV3beta1::InputConfig, decorator: Google::Apis::TranslateV3beta1::InputConfig::Representation
|
181
|
+
|
182
|
+
hash :models, as: 'models'
|
183
|
+
property :output_config, as: 'outputConfig', class: Google::Apis::TranslateV3beta1::OutputConfig, decorator: Google::Apis::TranslateV3beta1::OutputConfig::Representation
|
184
|
+
|
185
|
+
property :source_language_code, as: 'sourceLanguageCode'
|
186
|
+
collection :target_language_codes, as: 'targetLanguageCodes'
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
class CancelOperationRequest
|
191
|
+
# @private
|
192
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
class DetectLanguageRequest
|
197
|
+
# @private
|
198
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
199
|
+
property :content, as: 'content'
|
200
|
+
property :mime_type, as: 'mimeType'
|
201
|
+
property :model, as: 'model'
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
class DetectLanguageResponse
|
206
|
+
# @private
|
207
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
208
|
+
collection :languages, as: 'languages', class: Google::Apis::TranslateV3beta1::DetectedLanguage, decorator: Google::Apis::TranslateV3beta1::DetectedLanguage::Representation
|
209
|
+
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
class DetectedLanguage
|
214
|
+
# @private
|
215
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
216
|
+
property :confidence, as: 'confidence'
|
217
|
+
property :language_code, as: 'languageCode'
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
class Empty
|
222
|
+
# @private
|
223
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
class GcsDestination
|
228
|
+
# @private
|
229
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
230
|
+
property :output_uri_prefix, as: 'outputUriPrefix'
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
class GcsSource
|
235
|
+
# @private
|
236
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
237
|
+
property :input_uri, as: 'inputUri'
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
class Glossary
|
242
|
+
# @private
|
243
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
244
|
+
property :end_time, as: 'endTime'
|
245
|
+
property :entry_count, as: 'entryCount'
|
246
|
+
property :input_config, as: 'inputConfig', class: Google::Apis::TranslateV3beta1::GlossaryInputConfig, decorator: Google::Apis::TranslateV3beta1::GlossaryInputConfig::Representation
|
247
|
+
|
248
|
+
property :language_codes_set, as: 'languageCodesSet', class: Google::Apis::TranslateV3beta1::LanguageCodesSet, decorator: Google::Apis::TranslateV3beta1::LanguageCodesSet::Representation
|
249
|
+
|
250
|
+
property :language_pair, as: 'languagePair', class: Google::Apis::TranslateV3beta1::LanguageCodePair, decorator: Google::Apis::TranslateV3beta1::LanguageCodePair::Representation
|
251
|
+
|
252
|
+
property :name, as: 'name'
|
253
|
+
property :submit_time, as: 'submitTime'
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
class GlossaryInputConfig
|
258
|
+
# @private
|
259
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
260
|
+
property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3beta1::GcsSource, decorator: Google::Apis::TranslateV3beta1::GcsSource::Representation
|
261
|
+
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
class InputConfig
|
266
|
+
# @private
|
267
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
268
|
+
property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3beta1::GcsSource, decorator: Google::Apis::TranslateV3beta1::GcsSource::Representation
|
269
|
+
|
270
|
+
property :mime_type, as: 'mimeType'
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
class LanguageCodePair
|
275
|
+
# @private
|
276
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
277
|
+
property :source_language_code, as: 'sourceLanguageCode'
|
278
|
+
property :target_language_code, as: 'targetLanguageCode'
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
class LanguageCodesSet
|
283
|
+
# @private
|
284
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
285
|
+
collection :language_codes, as: 'languageCodes'
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
class ListGlossariesResponse
|
290
|
+
# @private
|
291
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
292
|
+
collection :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3beta1::Glossary, decorator: Google::Apis::TranslateV3beta1::Glossary::Representation
|
293
|
+
|
294
|
+
property :next_page_token, as: 'nextPageToken'
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
class ListOperationsResponse
|
299
|
+
# @private
|
300
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
301
|
+
property :next_page_token, as: 'nextPageToken'
|
302
|
+
collection :operations, as: 'operations', class: Google::Apis::TranslateV3beta1::Operation, decorator: Google::Apis::TranslateV3beta1::Operation::Representation
|
303
|
+
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
class Operation
|
308
|
+
# @private
|
309
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
310
|
+
property :done, as: 'done'
|
311
|
+
property :error, as: 'error', class: Google::Apis::TranslateV3beta1::Status, decorator: Google::Apis::TranslateV3beta1::Status::Representation
|
312
|
+
|
313
|
+
hash :metadata, as: 'metadata'
|
314
|
+
property :name, as: 'name'
|
315
|
+
hash :response, as: 'response'
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
class OutputConfig
|
320
|
+
# @private
|
321
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
322
|
+
property :gcs_destination, as: 'gcsDestination', class: Google::Apis::TranslateV3beta1::GcsDestination, decorator: Google::Apis::TranslateV3beta1::GcsDestination::Representation
|
323
|
+
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
class Status
|
328
|
+
# @private
|
329
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
330
|
+
property :code, as: 'code'
|
331
|
+
collection :details, as: 'details'
|
332
|
+
property :message, as: 'message'
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
class SupportedLanguage
|
337
|
+
# @private
|
338
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
339
|
+
property :display_name, as: 'displayName'
|
340
|
+
property :language_code, as: 'languageCode'
|
341
|
+
property :support_source, as: 'supportSource'
|
342
|
+
property :support_target, as: 'supportTarget'
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
class SupportedLanguages
|
347
|
+
# @private
|
348
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
349
|
+
collection :languages, as: 'languages', class: Google::Apis::TranslateV3beta1::SupportedLanguage, decorator: Google::Apis::TranslateV3beta1::SupportedLanguage::Representation
|
350
|
+
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
class TranslateTextGlossaryConfig
|
355
|
+
# @private
|
356
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
357
|
+
property :glossary, as: 'glossary'
|
358
|
+
property :ignore_case, as: 'ignoreCase'
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
class TranslateTextRequest
|
363
|
+
# @private
|
364
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
365
|
+
collection :contents, as: 'contents'
|
366
|
+
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
367
|
+
|
368
|
+
property :mime_type, as: 'mimeType'
|
369
|
+
property :model, as: 'model'
|
370
|
+
property :source_language_code, as: 'sourceLanguageCode'
|
371
|
+
property :target_language_code, as: 'targetLanguageCode'
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
class TranslateTextResponse
|
376
|
+
# @private
|
377
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
378
|
+
collection :glossary_translations, as: 'glossaryTranslations', class: Google::Apis::TranslateV3beta1::Translation, decorator: Google::Apis::TranslateV3beta1::Translation::Representation
|
379
|
+
|
380
|
+
collection :translations, as: 'translations', class: Google::Apis::TranslateV3beta1::Translation, decorator: Google::Apis::TranslateV3beta1::Translation::Representation
|
381
|
+
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
class Translation
|
386
|
+
# @private
|
387
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
388
|
+
property :detected_language_code, as: 'detectedLanguageCode'
|
389
|
+
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
390
|
+
|
391
|
+
property :model, as: 'model'
|
392
|
+
property :translated_text, as: 'translatedText'
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
class WaitOperationRequest
|
397
|
+
# @private
|
398
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
399
|
+
property :timeout, as: 'timeout'
|
400
|
+
end
|
401
|
+
end
|
402
|
+
end
|
403
|
+
end
|
404
|
+
end
|
@@ -0,0 +1,706 @@
|
|
1
|
+
# Copyright 2015 Google Inc.
|
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 TranslateV3beta1
|
23
|
+
# Cloud Translation API
|
24
|
+
#
|
25
|
+
# Integrates text translation into your website or application.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/translate_v3beta1'
|
29
|
+
#
|
30
|
+
# Translate = Google::Apis::TranslateV3beta1 # Alias the module
|
31
|
+
# service = Translate::TranslateService.new
|
32
|
+
#
|
33
|
+
# @see https://cloud.google.com/translate/docs/quickstarts
|
34
|
+
class TranslateService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
def initialize
|
46
|
+
super('https://translation.googleapis.com/', '')
|
47
|
+
@batch_path = 'batch'
|
48
|
+
end
|
49
|
+
|
50
|
+
# Detects the language of text within a request.
|
51
|
+
# @param [String] parent
|
52
|
+
# Required. Target project or location to make a call.
|
53
|
+
# Format: `projects/`project-id`/locations/`location-id`` or
|
54
|
+
# `projects/`project-id``.
|
55
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
56
|
+
# `projects/`project-id``.
|
57
|
+
# Only models within the same region (has same location-id) can be used.
|
58
|
+
# Otherwise an INVALID_ARGUMENT (400) error is returned.
|
59
|
+
# @param [Google::Apis::TranslateV3beta1::DetectLanguageRequest] detect_language_request_object
|
60
|
+
# @param [String] fields
|
61
|
+
# Selector specifying which fields to include in a partial response.
|
62
|
+
# @param [String] quota_user
|
63
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
64
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
65
|
+
# @param [Google::Apis::RequestOptions] options
|
66
|
+
# Request-specific options
|
67
|
+
#
|
68
|
+
# @yield [result, err] Result & error if block supplied
|
69
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::DetectLanguageResponse] parsed result object
|
70
|
+
# @yieldparam err [StandardError] error object if request failed
|
71
|
+
#
|
72
|
+
# @return [Google::Apis::TranslateV3beta1::DetectLanguageResponse]
|
73
|
+
#
|
74
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
75
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
76
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
77
|
+
def detect_project_language(parent, detect_language_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
78
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:detectLanguage', options)
|
79
|
+
command.request_representation = Google::Apis::TranslateV3beta1::DetectLanguageRequest::Representation
|
80
|
+
command.request_object = detect_language_request_object
|
81
|
+
command.response_representation = Google::Apis::TranslateV3beta1::DetectLanguageResponse::Representation
|
82
|
+
command.response_class = Google::Apis::TranslateV3beta1::DetectLanguageResponse
|
83
|
+
command.params['parent'] = parent unless parent.nil?
|
84
|
+
command.query['fields'] = fields unless fields.nil?
|
85
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
86
|
+
execute_or_queue_command(command, &block)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns a list of supported languages for translation.
|
90
|
+
# @param [String] parent
|
91
|
+
# Required. Target project or location to make a call.
|
92
|
+
# Format: `projects/`project-id`` or
|
93
|
+
# `projects/`project-id`/locations/`location-id``.
|
94
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
95
|
+
# `projects/`project-id``.
|
96
|
+
# Non-global location is required for AutoML models.
|
97
|
+
# Only models within the same region (have same location-id) can be used,
|
98
|
+
# otherwise an INVALID_ARGUMENT (400) error is returned.
|
99
|
+
# @param [String] display_language_code
|
100
|
+
# Optional. The language to use to return localized, human readable names
|
101
|
+
# of supported languages. If missing, then display names are not returned
|
102
|
+
# in a response.
|
103
|
+
# @param [String] model
|
104
|
+
# Optional. Get supported languages of this model.
|
105
|
+
# The format depends on model type:
|
106
|
+
# - AutoML Translation models:
|
107
|
+
# `projects/`project-id`/locations/`location-id`/models/`model-id``
|
108
|
+
# - General (built-in) models:
|
109
|
+
# `projects/`project-id`/locations/`location-id`/models/general/nmt`,
|
110
|
+
# `projects/`project-id`/locations/`location-id`/models/general/base`
|
111
|
+
# Returns languages supported by the specified model.
|
112
|
+
# If missing, we get supported languages of Google general base (PBMT) model.
|
113
|
+
# @param [String] fields
|
114
|
+
# Selector specifying which fields to include in a partial response.
|
115
|
+
# @param [String] quota_user
|
116
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
117
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
118
|
+
# @param [Google::Apis::RequestOptions] options
|
119
|
+
# Request-specific options
|
120
|
+
#
|
121
|
+
# @yield [result, err] Result & error if block supplied
|
122
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::SupportedLanguages] parsed result object
|
123
|
+
# @yieldparam err [StandardError] error object if request failed
|
124
|
+
#
|
125
|
+
# @return [Google::Apis::TranslateV3beta1::SupportedLanguages]
|
126
|
+
#
|
127
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
128
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
129
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
130
|
+
def get_project_supported_languages(parent, display_language_code: nil, model: nil, fields: nil, quota_user: nil, options: nil, &block)
|
131
|
+
command = make_simple_command(:get, 'v3beta1/{+parent}/supportedLanguages', options)
|
132
|
+
command.response_representation = Google::Apis::TranslateV3beta1::SupportedLanguages::Representation
|
133
|
+
command.response_class = Google::Apis::TranslateV3beta1::SupportedLanguages
|
134
|
+
command.params['parent'] = parent unless parent.nil?
|
135
|
+
command.query['displayLanguageCode'] = display_language_code unless display_language_code.nil?
|
136
|
+
command.query['model'] = model unless model.nil?
|
137
|
+
command.query['fields'] = fields unless fields.nil?
|
138
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
139
|
+
execute_or_queue_command(command, &block)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Translates input text and returns translated text.
|
143
|
+
# @param [String] parent
|
144
|
+
# Required. Target project or location to make a call.
|
145
|
+
# Format: `projects/`project-id`` or
|
146
|
+
# `projects/`project-id`/locations/`location-id``.
|
147
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
148
|
+
# `projects/`project-id``.
|
149
|
+
# Non-global location is required for requests using AutoML models or
|
150
|
+
# custom glossaries.
|
151
|
+
# Models and glossaries must be within the same region (have same
|
152
|
+
# location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
|
153
|
+
# @param [Google::Apis::TranslateV3beta1::TranslateTextRequest] translate_text_request_object
|
154
|
+
# @param [String] fields
|
155
|
+
# Selector specifying which fields to include in a partial response.
|
156
|
+
# @param [String] quota_user
|
157
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
158
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
159
|
+
# @param [Google::Apis::RequestOptions] options
|
160
|
+
# Request-specific options
|
161
|
+
#
|
162
|
+
# @yield [result, err] Result & error if block supplied
|
163
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::TranslateTextResponse] parsed result object
|
164
|
+
# @yieldparam err [StandardError] error object if request failed
|
165
|
+
#
|
166
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextResponse]
|
167
|
+
#
|
168
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
169
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
170
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
171
|
+
def translate_project_text(parent, translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
172
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:translateText', options)
|
173
|
+
command.request_representation = Google::Apis::TranslateV3beta1::TranslateTextRequest::Representation
|
174
|
+
command.request_object = translate_text_request_object
|
175
|
+
command.response_representation = Google::Apis::TranslateV3beta1::TranslateTextResponse::Representation
|
176
|
+
command.response_class = Google::Apis::TranslateV3beta1::TranslateTextResponse
|
177
|
+
command.params['parent'] = parent unless parent.nil?
|
178
|
+
command.query['fields'] = fields unless fields.nil?
|
179
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
180
|
+
execute_or_queue_command(command, &block)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Translates a large volume of text in asynchronous batch mode.
|
184
|
+
# This function provides real-time output as the inputs are being processed.
|
185
|
+
# If caller cancels a request, the partial results (for an input file, it's
|
186
|
+
# all or nothing) may still be available on the specified output location.
|
187
|
+
# This call returns immediately and you can
|
188
|
+
# use google.longrunning.Operation.name to poll the status of the call.
|
189
|
+
# @param [String] parent
|
190
|
+
# Required. Location to make a regional call.
|
191
|
+
# Format: `projects/`project-id`/locations/`location-id``.
|
192
|
+
# The `global` location is not supported for batch translation.
|
193
|
+
# Only AutoML Translation models or glossaries within the same region (have
|
194
|
+
# the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
|
195
|
+
# error is returned.
|
196
|
+
# @param [Google::Apis::TranslateV3beta1::BatchTranslateTextRequest] batch_translate_text_request_object
|
197
|
+
# @param [String] fields
|
198
|
+
# Selector specifying which fields to include in a partial response.
|
199
|
+
# @param [String] quota_user
|
200
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
201
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
202
|
+
# @param [Google::Apis::RequestOptions] options
|
203
|
+
# Request-specific options
|
204
|
+
#
|
205
|
+
# @yield [result, err] Result & error if block supplied
|
206
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
207
|
+
# @yieldparam err [StandardError] error object if request failed
|
208
|
+
#
|
209
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
210
|
+
#
|
211
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
212
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
213
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
214
|
+
def batch_location_translate_text(parent, batch_translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
215
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:batchTranslateText', options)
|
216
|
+
command.request_representation = Google::Apis::TranslateV3beta1::BatchTranslateTextRequest::Representation
|
217
|
+
command.request_object = batch_translate_text_request_object
|
218
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
219
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
220
|
+
command.params['parent'] = parent unless parent.nil?
|
221
|
+
command.query['fields'] = fields unless fields.nil?
|
222
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
223
|
+
execute_or_queue_command(command, &block)
|
224
|
+
end
|
225
|
+
|
226
|
+
# Detects the language of text within a request.
|
227
|
+
# @param [String] parent
|
228
|
+
# Required. Target project or location to make a call.
|
229
|
+
# Format: `projects/`project-id`/locations/`location-id`` or
|
230
|
+
# `projects/`project-id``.
|
231
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
232
|
+
# `projects/`project-id``.
|
233
|
+
# Only models within the same region (has same location-id) can be used.
|
234
|
+
# Otherwise an INVALID_ARGUMENT (400) error is returned.
|
235
|
+
# @param [Google::Apis::TranslateV3beta1::DetectLanguageRequest] detect_language_request_object
|
236
|
+
# @param [String] fields
|
237
|
+
# Selector specifying which fields to include in a partial response.
|
238
|
+
# @param [String] quota_user
|
239
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
240
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
241
|
+
# @param [Google::Apis::RequestOptions] options
|
242
|
+
# Request-specific options
|
243
|
+
#
|
244
|
+
# @yield [result, err] Result & error if block supplied
|
245
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::DetectLanguageResponse] parsed result object
|
246
|
+
# @yieldparam err [StandardError] error object if request failed
|
247
|
+
#
|
248
|
+
# @return [Google::Apis::TranslateV3beta1::DetectLanguageResponse]
|
249
|
+
#
|
250
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
251
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
252
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
253
|
+
def detect_location_language(parent, detect_language_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
254
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:detectLanguage', options)
|
255
|
+
command.request_representation = Google::Apis::TranslateV3beta1::DetectLanguageRequest::Representation
|
256
|
+
command.request_object = detect_language_request_object
|
257
|
+
command.response_representation = Google::Apis::TranslateV3beta1::DetectLanguageResponse::Representation
|
258
|
+
command.response_class = Google::Apis::TranslateV3beta1::DetectLanguageResponse
|
259
|
+
command.params['parent'] = parent unless parent.nil?
|
260
|
+
command.query['fields'] = fields unless fields.nil?
|
261
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
262
|
+
execute_or_queue_command(command, &block)
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns a list of supported languages for translation.
|
266
|
+
# @param [String] parent
|
267
|
+
# Required. Target project or location to make a call.
|
268
|
+
# Format: `projects/`project-id`` or
|
269
|
+
# `projects/`project-id`/locations/`location-id``.
|
270
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
271
|
+
# `projects/`project-id``.
|
272
|
+
# Non-global location is required for AutoML models.
|
273
|
+
# Only models within the same region (have same location-id) can be used,
|
274
|
+
# otherwise an INVALID_ARGUMENT (400) error is returned.
|
275
|
+
# @param [String] display_language_code
|
276
|
+
# Optional. The language to use to return localized, human readable names
|
277
|
+
# of supported languages. If missing, then display names are not returned
|
278
|
+
# in a response.
|
279
|
+
# @param [String] model
|
280
|
+
# Optional. Get supported languages of this model.
|
281
|
+
# The format depends on model type:
|
282
|
+
# - AutoML Translation models:
|
283
|
+
# `projects/`project-id`/locations/`location-id`/models/`model-id``
|
284
|
+
# - General (built-in) models:
|
285
|
+
# `projects/`project-id`/locations/`location-id`/models/general/nmt`,
|
286
|
+
# `projects/`project-id`/locations/`location-id`/models/general/base`
|
287
|
+
# Returns languages supported by the specified model.
|
288
|
+
# If missing, we get supported languages of Google general base (PBMT) model.
|
289
|
+
# @param [String] fields
|
290
|
+
# Selector specifying which fields to include in a partial response.
|
291
|
+
# @param [String] quota_user
|
292
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
293
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
294
|
+
# @param [Google::Apis::RequestOptions] options
|
295
|
+
# Request-specific options
|
296
|
+
#
|
297
|
+
# @yield [result, err] Result & error if block supplied
|
298
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::SupportedLanguages] parsed result object
|
299
|
+
# @yieldparam err [StandardError] error object if request failed
|
300
|
+
#
|
301
|
+
# @return [Google::Apis::TranslateV3beta1::SupportedLanguages]
|
302
|
+
#
|
303
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
304
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
305
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
306
|
+
def get_project_location_supported_languages(parent, display_language_code: nil, model: nil, fields: nil, quota_user: nil, options: nil, &block)
|
307
|
+
command = make_simple_command(:get, 'v3beta1/{+parent}/supportedLanguages', options)
|
308
|
+
command.response_representation = Google::Apis::TranslateV3beta1::SupportedLanguages::Representation
|
309
|
+
command.response_class = Google::Apis::TranslateV3beta1::SupportedLanguages
|
310
|
+
command.params['parent'] = parent unless parent.nil?
|
311
|
+
command.query['displayLanguageCode'] = display_language_code unless display_language_code.nil?
|
312
|
+
command.query['model'] = model unless model.nil?
|
313
|
+
command.query['fields'] = fields unless fields.nil?
|
314
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
315
|
+
execute_or_queue_command(command, &block)
|
316
|
+
end
|
317
|
+
|
318
|
+
# Translates input text and returns translated text.
|
319
|
+
# @param [String] parent
|
320
|
+
# Required. Target project or location to make a call.
|
321
|
+
# Format: `projects/`project-id`` or
|
322
|
+
# `projects/`project-id`/locations/`location-id``.
|
323
|
+
# For global calls, use `projects/`project-id`/locations/global` or
|
324
|
+
# `projects/`project-id``.
|
325
|
+
# Non-global location is required for requests using AutoML models or
|
326
|
+
# custom glossaries.
|
327
|
+
# Models and glossaries must be within the same region (have same
|
328
|
+
# location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
|
329
|
+
# @param [Google::Apis::TranslateV3beta1::TranslateTextRequest] translate_text_request_object
|
330
|
+
# @param [String] fields
|
331
|
+
# Selector specifying which fields to include in a partial response.
|
332
|
+
# @param [String] quota_user
|
333
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
334
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
335
|
+
# @param [Google::Apis::RequestOptions] options
|
336
|
+
# Request-specific options
|
337
|
+
#
|
338
|
+
# @yield [result, err] Result & error if block supplied
|
339
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::TranslateTextResponse] parsed result object
|
340
|
+
# @yieldparam err [StandardError] error object if request failed
|
341
|
+
#
|
342
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextResponse]
|
343
|
+
#
|
344
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
345
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
346
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
347
|
+
def translate_location_text(parent, translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
348
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:translateText', options)
|
349
|
+
command.request_representation = Google::Apis::TranslateV3beta1::TranslateTextRequest::Representation
|
350
|
+
command.request_object = translate_text_request_object
|
351
|
+
command.response_representation = Google::Apis::TranslateV3beta1::TranslateTextResponse::Representation
|
352
|
+
command.response_class = Google::Apis::TranslateV3beta1::TranslateTextResponse
|
353
|
+
command.params['parent'] = parent unless parent.nil?
|
354
|
+
command.query['fields'] = fields unless fields.nil?
|
355
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
356
|
+
execute_or_queue_command(command, &block)
|
357
|
+
end
|
358
|
+
|
359
|
+
# Creates a glossary and returns the long-running operation. Returns
|
360
|
+
# NOT_FOUND, if the project doesn't exist.
|
361
|
+
# @param [String] parent
|
362
|
+
# Required. The project name.
|
363
|
+
# @param [Google::Apis::TranslateV3beta1::Glossary] glossary_object
|
364
|
+
# @param [String] fields
|
365
|
+
# Selector specifying which fields to include in a partial response.
|
366
|
+
# @param [String] quota_user
|
367
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
368
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
369
|
+
# @param [Google::Apis::RequestOptions] options
|
370
|
+
# Request-specific options
|
371
|
+
#
|
372
|
+
# @yield [result, err] Result & error if block supplied
|
373
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
374
|
+
# @yieldparam err [StandardError] error object if request failed
|
375
|
+
#
|
376
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
377
|
+
#
|
378
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
379
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
380
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
381
|
+
def create_project_location_glossary(parent, glossary_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
382
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}/glossaries', options)
|
383
|
+
command.request_representation = Google::Apis::TranslateV3beta1::Glossary::Representation
|
384
|
+
command.request_object = glossary_object
|
385
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
386
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
387
|
+
command.params['parent'] = parent unless parent.nil?
|
388
|
+
command.query['fields'] = fields unless fields.nil?
|
389
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
390
|
+
execute_or_queue_command(command, &block)
|
391
|
+
end
|
392
|
+
|
393
|
+
# Deletes a glossary, or cancels glossary construction
|
394
|
+
# if the glossary isn't created yet.
|
395
|
+
# Returns NOT_FOUND, if the glossary doesn't exist.
|
396
|
+
# @param [String] name
|
397
|
+
# Required. The name of the glossary to delete.
|
398
|
+
# @param [String] fields
|
399
|
+
# Selector specifying which fields to include in a partial response.
|
400
|
+
# @param [String] quota_user
|
401
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
402
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
403
|
+
# @param [Google::Apis::RequestOptions] options
|
404
|
+
# Request-specific options
|
405
|
+
#
|
406
|
+
# @yield [result, err] Result & error if block supplied
|
407
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
408
|
+
# @yieldparam err [StandardError] error object if request failed
|
409
|
+
#
|
410
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
411
|
+
#
|
412
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
413
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
414
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
415
|
+
def delete_project_location_glossary(name, fields: nil, quota_user: nil, options: nil, &block)
|
416
|
+
command = make_simple_command(:delete, 'v3beta1/{+name}', options)
|
417
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
418
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
419
|
+
command.params['name'] = name unless name.nil?
|
420
|
+
command.query['fields'] = fields unless fields.nil?
|
421
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
422
|
+
execute_or_queue_command(command, &block)
|
423
|
+
end
|
424
|
+
|
425
|
+
# Gets a glossary. Returns NOT_FOUND, if the glossary doesn't
|
426
|
+
# exist.
|
427
|
+
# @param [String] name
|
428
|
+
# Required. The name of the glossary to retrieve.
|
429
|
+
# @param [String] fields
|
430
|
+
# Selector specifying which fields to include in a partial response.
|
431
|
+
# @param [String] quota_user
|
432
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
433
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
434
|
+
# @param [Google::Apis::RequestOptions] options
|
435
|
+
# Request-specific options
|
436
|
+
#
|
437
|
+
# @yield [result, err] Result & error if block supplied
|
438
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Glossary] parsed result object
|
439
|
+
# @yieldparam err [StandardError] error object if request failed
|
440
|
+
#
|
441
|
+
# @return [Google::Apis::TranslateV3beta1::Glossary]
|
442
|
+
#
|
443
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
444
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
445
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
446
|
+
def get_project_location_glossary(name, fields: nil, quota_user: nil, options: nil, &block)
|
447
|
+
command = make_simple_command(:get, 'v3beta1/{+name}', options)
|
448
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Glossary::Representation
|
449
|
+
command.response_class = Google::Apis::TranslateV3beta1::Glossary
|
450
|
+
command.params['name'] = name unless name.nil?
|
451
|
+
command.query['fields'] = fields unless fields.nil?
|
452
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
453
|
+
execute_or_queue_command(command, &block)
|
454
|
+
end
|
455
|
+
|
456
|
+
# Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't
|
457
|
+
# exist.
|
458
|
+
# @param [String] parent
|
459
|
+
# Required. The name of the project from which to list all of the glossaries.
|
460
|
+
# @param [String] filter
|
461
|
+
# Optional. Filter specifying constraints of a list operation.
|
462
|
+
# Filtering is not supported yet, and the parameter currently has no effect.
|
463
|
+
# If missing, no filtering is performed.
|
464
|
+
# @param [Fixnum] page_size
|
465
|
+
# Optional. Requested page size. The server may return fewer glossaries than
|
466
|
+
# requested. If unspecified, the server picks an appropriate default.
|
467
|
+
# @param [String] page_token
|
468
|
+
# Optional. A token identifying a page of results the server should return.
|
469
|
+
# Typically, this is the value of [ListGlossariesResponse.next_page_token]
|
470
|
+
# returned from the previous call to `ListGlossaries` method.
|
471
|
+
# The first page is returned if `page_token`is empty or missing.
|
472
|
+
# @param [String] fields
|
473
|
+
# Selector specifying which fields to include in a partial response.
|
474
|
+
# @param [String] quota_user
|
475
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
476
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
477
|
+
# @param [Google::Apis::RequestOptions] options
|
478
|
+
# Request-specific options
|
479
|
+
#
|
480
|
+
# @yield [result, err] Result & error if block supplied
|
481
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::ListGlossariesResponse] parsed result object
|
482
|
+
# @yieldparam err [StandardError] error object if request failed
|
483
|
+
#
|
484
|
+
# @return [Google::Apis::TranslateV3beta1::ListGlossariesResponse]
|
485
|
+
#
|
486
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
487
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
488
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
489
|
+
def list_project_location_glossaries(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
490
|
+
command = make_simple_command(:get, 'v3beta1/{+parent}/glossaries', options)
|
491
|
+
command.response_representation = Google::Apis::TranslateV3beta1::ListGlossariesResponse::Representation
|
492
|
+
command.response_class = Google::Apis::TranslateV3beta1::ListGlossariesResponse
|
493
|
+
command.params['parent'] = parent unless parent.nil?
|
494
|
+
command.query['filter'] = filter unless filter.nil?
|
495
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
496
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
497
|
+
command.query['fields'] = fields unless fields.nil?
|
498
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
499
|
+
execute_or_queue_command(command, &block)
|
500
|
+
end
|
501
|
+
|
502
|
+
# Starts asynchronous cancellation on a long-running operation. The server
|
503
|
+
# makes a best effort to cancel the operation, but success is not
|
504
|
+
# guaranteed. If the server doesn't support this method, it returns
|
505
|
+
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
506
|
+
# Operations.GetOperation or
|
507
|
+
# other methods to check whether the cancellation succeeded or whether the
|
508
|
+
# operation completed despite cancellation. On successful cancellation,
|
509
|
+
# the operation is not deleted; instead, it becomes an operation with
|
510
|
+
# an Operation.error value with a google.rpc.Status.code of 1,
|
511
|
+
# corresponding to `Code.CANCELLED`.
|
512
|
+
# @param [String] name
|
513
|
+
# The name of the operation resource to be cancelled.
|
514
|
+
# @param [Google::Apis::TranslateV3beta1::CancelOperationRequest] cancel_operation_request_object
|
515
|
+
# @param [String] fields
|
516
|
+
# Selector specifying which fields to include in a partial response.
|
517
|
+
# @param [String] quota_user
|
518
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
519
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
520
|
+
# @param [Google::Apis::RequestOptions] options
|
521
|
+
# Request-specific options
|
522
|
+
#
|
523
|
+
# @yield [result, err] Result & error if block supplied
|
524
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Empty] parsed result object
|
525
|
+
# @yieldparam err [StandardError] error object if request failed
|
526
|
+
#
|
527
|
+
# @return [Google::Apis::TranslateV3beta1::Empty]
|
528
|
+
#
|
529
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
530
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
531
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
532
|
+
def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
533
|
+
command = make_simple_command(:post, 'v3beta1/{+name}:cancel', options)
|
534
|
+
command.request_representation = Google::Apis::TranslateV3beta1::CancelOperationRequest::Representation
|
535
|
+
command.request_object = cancel_operation_request_object
|
536
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Empty::Representation
|
537
|
+
command.response_class = Google::Apis::TranslateV3beta1::Empty
|
538
|
+
command.params['name'] = name unless name.nil?
|
539
|
+
command.query['fields'] = fields unless fields.nil?
|
540
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
541
|
+
execute_or_queue_command(command, &block)
|
542
|
+
end
|
543
|
+
|
544
|
+
# Deletes a long-running operation. This method indicates that the client is
|
545
|
+
# no longer interested in the operation result. It does not cancel the
|
546
|
+
# operation. If the server doesn't support this method, it returns
|
547
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
548
|
+
# @param [String] name
|
549
|
+
# The name of the operation resource to be deleted.
|
550
|
+
# @param [String] fields
|
551
|
+
# Selector specifying which fields to include in a partial response.
|
552
|
+
# @param [String] quota_user
|
553
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
554
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
555
|
+
# @param [Google::Apis::RequestOptions] options
|
556
|
+
# Request-specific options
|
557
|
+
#
|
558
|
+
# @yield [result, err] Result & error if block supplied
|
559
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Empty] parsed result object
|
560
|
+
# @yieldparam err [StandardError] error object if request failed
|
561
|
+
#
|
562
|
+
# @return [Google::Apis::TranslateV3beta1::Empty]
|
563
|
+
#
|
564
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
565
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
566
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
567
|
+
def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
|
568
|
+
command = make_simple_command(:delete, 'v3beta1/{+name}', options)
|
569
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Empty::Representation
|
570
|
+
command.response_class = Google::Apis::TranslateV3beta1::Empty
|
571
|
+
command.params['name'] = name unless name.nil?
|
572
|
+
command.query['fields'] = fields unless fields.nil?
|
573
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
574
|
+
execute_or_queue_command(command, &block)
|
575
|
+
end
|
576
|
+
|
577
|
+
# Gets the latest state of a long-running operation. Clients can use this
|
578
|
+
# method to poll the operation result at intervals as recommended by the API
|
579
|
+
# service.
|
580
|
+
# @param [String] name
|
581
|
+
# The name of the operation resource.
|
582
|
+
# @param [String] fields
|
583
|
+
# Selector specifying which fields to include in a partial response.
|
584
|
+
# @param [String] quota_user
|
585
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
586
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
587
|
+
# @param [Google::Apis::RequestOptions] options
|
588
|
+
# Request-specific options
|
589
|
+
#
|
590
|
+
# @yield [result, err] Result & error if block supplied
|
591
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
592
|
+
# @yieldparam err [StandardError] error object if request failed
|
593
|
+
#
|
594
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
595
|
+
#
|
596
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
597
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
598
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
599
|
+
def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
|
600
|
+
command = make_simple_command(:get, 'v3beta1/{+name}', options)
|
601
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
602
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
603
|
+
command.params['name'] = name unless name.nil?
|
604
|
+
command.query['fields'] = fields unless fields.nil?
|
605
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
606
|
+
execute_or_queue_command(command, &block)
|
607
|
+
end
|
608
|
+
|
609
|
+
# Lists operations that match the specified filter in the request. If the
|
610
|
+
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
611
|
+
# NOTE: the `name` binding allows API services to override the binding
|
612
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
613
|
+
# override the binding, API services can add a binding such as
|
614
|
+
# `"/v1/`name=users/*`/operations"` to their service configuration.
|
615
|
+
# For backwards compatibility, the default name includes the operations
|
616
|
+
# collection id, however overriding users must ensure the name binding
|
617
|
+
# is the parent resource, without the operations collection id.
|
618
|
+
# @param [String] name
|
619
|
+
# The name of the operation's parent resource.
|
620
|
+
# @param [String] filter
|
621
|
+
# The standard list filter.
|
622
|
+
# @param [Fixnum] page_size
|
623
|
+
# The standard list page size.
|
624
|
+
# @param [String] page_token
|
625
|
+
# The standard list page token.
|
626
|
+
# @param [String] fields
|
627
|
+
# Selector specifying which fields to include in a partial response.
|
628
|
+
# @param [String] quota_user
|
629
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
630
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
631
|
+
# @param [Google::Apis::RequestOptions] options
|
632
|
+
# Request-specific options
|
633
|
+
#
|
634
|
+
# @yield [result, err] Result & error if block supplied
|
635
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::ListOperationsResponse] parsed result object
|
636
|
+
# @yieldparam err [StandardError] error object if request failed
|
637
|
+
#
|
638
|
+
# @return [Google::Apis::TranslateV3beta1::ListOperationsResponse]
|
639
|
+
#
|
640
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
641
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
642
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
643
|
+
def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
644
|
+
command = make_simple_command(:get, 'v3beta1/{+name}/operations', options)
|
645
|
+
command.response_representation = Google::Apis::TranslateV3beta1::ListOperationsResponse::Representation
|
646
|
+
command.response_class = Google::Apis::TranslateV3beta1::ListOperationsResponse
|
647
|
+
command.params['name'] = name unless name.nil?
|
648
|
+
command.query['filter'] = filter unless filter.nil?
|
649
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
650
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
651
|
+
command.query['fields'] = fields unless fields.nil?
|
652
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
653
|
+
execute_or_queue_command(command, &block)
|
654
|
+
end
|
655
|
+
|
656
|
+
# Waits for the specified long-running operation until it is done or reaches
|
657
|
+
# at most a specified timeout, returning the latest state. If the operation
|
658
|
+
# is already done, the latest state is immediately returned. If the timeout
|
659
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
660
|
+
# timeout is used. If the server does not support this method, it returns
|
661
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
662
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
663
|
+
# state before the specified timeout (including immediately), meaning even an
|
664
|
+
# immediate response is no guarantee that the operation is done.
|
665
|
+
# @param [String] name
|
666
|
+
# The name of the operation resource to wait on.
|
667
|
+
# @param [Google::Apis::TranslateV3beta1::WaitOperationRequest] wait_operation_request_object
|
668
|
+
# @param [String] fields
|
669
|
+
# Selector specifying which fields to include in a partial response.
|
670
|
+
# @param [String] quota_user
|
671
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
672
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
673
|
+
# @param [Google::Apis::RequestOptions] options
|
674
|
+
# Request-specific options
|
675
|
+
#
|
676
|
+
# @yield [result, err] Result & error if block supplied
|
677
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
678
|
+
# @yieldparam err [StandardError] error object if request failed
|
679
|
+
#
|
680
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
681
|
+
#
|
682
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
683
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
684
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
685
|
+
def wait_operation(name, wait_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
686
|
+
command = make_simple_command(:post, 'v3beta1/{+name}:wait', options)
|
687
|
+
command.request_representation = Google::Apis::TranslateV3beta1::WaitOperationRequest::Representation
|
688
|
+
command.request_object = wait_operation_request_object
|
689
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
690
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
691
|
+
command.params['name'] = name unless name.nil?
|
692
|
+
command.query['fields'] = fields unless fields.nil?
|
693
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
694
|
+
execute_or_queue_command(command, &block)
|
695
|
+
end
|
696
|
+
|
697
|
+
protected
|
698
|
+
|
699
|
+
def apply_command_defaults(command)
|
700
|
+
command.query['key'] = key unless key.nil?
|
701
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
702
|
+
end
|
703
|
+
end
|
704
|
+
end
|
705
|
+
end
|
706
|
+
end
|