generated from Apodini/Template-Repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
google-translate-v2.yaml
513 lines (513 loc) · 17.6 KB
/
google-translate-v2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
openapi: 3.0.0
servers:
- url: https://translation.googleapis.com/language/translate
info:
contact:
name: Google
url: https://google.com
x-twitter: youtube
description: |-
The Google Cloud Translation API lets websites and programs integrate with
Google Translate programmatically.
license:
name: Creative Commons Attribution 3.0
url: http://creativecommons.org/licenses/by/3.0/
termsOfService: https://developers.google.com/terms/
title: Google Cloud Translation API
version: v2
x-apiClientRegistration:
url: https://console.developers.google.com
x-apisguru-categories:
- analytics
- media
x-logo:
url: https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png
x-origin:
- format: google
url: https://translation.googleapis.com/$discovery/rest?version=v2
version: v1
x-preferred: false
x-providerName: googleapis.com
x-serviceName: translate
externalDocs:
url: https://code.google.com/apis/language/translate/v2/getting_started.html
tags:
- name: detections
- name: languages
- name: translations
paths:
/v2:
get:
description: Translates input text, returning translated text.
operationId: language.translations.list
parameters:
- description: |-
The input text to translate. Repeat this parameter to perform translation
operations on multiple text inputs.
explode: true
in: query
name: q
required: true
schema:
items:
type: string
type: array
style: form
- description: |-
The language to use for translation of the input text, set to one of the
language codes listed in Language Support.
in: query
name: target
required: true
schema:
type: string
- description: The customization id for translate
explode: true
in: query
name: cid
schema:
items:
type: string
type: array
style: form
- description: |-
The format of the source text, in either HTML (default) or plain-text. A
value of "html" indicates HTML and a value of "text" indicates plain-text.
in: query
name: format
schema:
enum:
- html
- text
type: string
- description: |-
The `model` type requested for this translation. Valid values are
listed in public documentation.
in: query
name: model
schema:
type: string
- description: |-
The language of the source text, set to one of the language codes listed in
Language Support. If the source language is not specified, the API will
attempt to identify the source language automatically and return it within
the response.
in: query
name: source
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/TranslationsListResponse"
description: Successful response
security:
- Oauth2:
- https://www.googleapis.com/auth/cloud-translation
Oauth2c:
- https://www.googleapis.com/auth/cloud-translation
- Oauth2:
- https://www.googleapis.com/auth/cloud-platform
Oauth2c:
- https://www.googleapis.com/auth/cloud-platform
tags:
- translations
parameters:
- $ref: "#/components/parameters/_.xgafv"
- $ref: "#/components/parameters/access_token"
- $ref: "#/components/parameters/alt"
- $ref: "#/components/parameters/bearer_token"
- $ref: "#/components/parameters/callback"
- $ref: "#/components/parameters/fields"
- $ref: "#/components/parameters/key"
- $ref: "#/components/parameters/oauth_token"
- $ref: "#/components/parameters/pp"
- $ref: "#/components/parameters/prettyPrint"
- $ref: "#/components/parameters/quotaUser"
- $ref: "#/components/parameters/upload_protocol"
- $ref: "#/components/parameters/uploadType"
post:
description: Translates input text, returning translated text.
operationId: language.translations.translate
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/TranslateTextRequest"
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/TranslationsListResponse"
description: Successful response
security:
- Oauth2:
- https://www.googleapis.com/auth/cloud-translation
Oauth2c:
- https://www.googleapis.com/auth/cloud-translation
- Oauth2:
- https://www.googleapis.com/auth/cloud-platform
Oauth2c:
- https://www.googleapis.com/auth/cloud-platform
tags:
- translations
/v2/detect:
get:
description: Detects the language of text within a request.
operationId: language.detections.list
parameters:
- description: |-
The input text upon which to perform language detection. Repeat this
parameter to perform language detection on multiple text inputs.
explode: true
in: query
name: q
required: true
schema:
items:
type: string
type: array
style: form
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/DetectionsListResponse"
description: Successful response
security:
- Oauth2:
- https://www.googleapis.com/auth/cloud-translation
Oauth2c:
- https://www.googleapis.com/auth/cloud-translation
- Oauth2:
- https://www.googleapis.com/auth/cloud-platform
Oauth2c:
- https://www.googleapis.com/auth/cloud-platform
tags:
- detections
parameters:
- $ref: "#/components/parameters/_.xgafv"
- $ref: "#/components/parameters/access_token"
- $ref: "#/components/parameters/alt"
- $ref: "#/components/parameters/bearer_token"
- $ref: "#/components/parameters/callback"
- $ref: "#/components/parameters/fields"
- $ref: "#/components/parameters/key"
- $ref: "#/components/parameters/oauth_token"
- $ref: "#/components/parameters/pp"
- $ref: "#/components/parameters/prettyPrint"
- $ref: "#/components/parameters/quotaUser"
- $ref: "#/components/parameters/upload_protocol"
- $ref: "#/components/parameters/uploadType"
post:
description: Detects the language of text within a request.
operationId: language.detections.detect
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/DetectLanguageRequest"
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/DetectionsListResponse"
description: Successful response
security:
- Oauth2:
- https://www.googleapis.com/auth/cloud-translation
Oauth2c:
- https://www.googleapis.com/auth/cloud-translation
- Oauth2:
- https://www.googleapis.com/auth/cloud-platform
Oauth2c:
- https://www.googleapis.com/auth/cloud-platform
tags:
- detections
/v2/languages:
get:
description: Returns a list of supported languages for translation.
operationId: language.languages.list
parameters:
- description: The model type for which supported languages should be returned.
in: query
name: model
schema:
type: string
- description: |-
The language to use to return localized, human readable names of supported
languages.
in: query
name: target
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/LanguagesListResponse"
description: Successful response
security:
- Oauth2:
- https://www.googleapis.com/auth/cloud-translation
Oauth2c:
- https://www.googleapis.com/auth/cloud-translation
- Oauth2:
- https://www.googleapis.com/auth/cloud-platform
Oauth2c:
- https://www.googleapis.com/auth/cloud-platform
tags:
- languages
parameters:
- $ref: "#/components/parameters/_.xgafv"
- $ref: "#/components/parameters/access_token"
- $ref: "#/components/parameters/alt"
- $ref: "#/components/parameters/bearer_token"
- $ref: "#/components/parameters/callback"
- $ref: "#/components/parameters/fields"
- $ref: "#/components/parameters/key"
- $ref: "#/components/parameters/oauth_token"
- $ref: "#/components/parameters/pp"
- $ref: "#/components/parameters/prettyPrint"
- $ref: "#/components/parameters/quotaUser"
- $ref: "#/components/parameters/upload_protocol"
- $ref: "#/components/parameters/uploadType"
components:
parameters:
_.xgafv:
description: V1 error format.
in: query
name: $.xgafv
schema:
enum:
- "1"
- "2"
type: string
access_token:
description: OAuth access token.
in: query
name: access_token
schema:
type: string
alt:
description: Data format for response.
in: query
name: alt
schema:
enum:
- json
- media
- proto
type: string
bearer_token:
description: OAuth bearer token.
in: query
name: bearer_token
schema:
type: string
callback:
description: JSONP
in: query
name: callback
schema:
type: string
fields:
description: Selector specifying which fields to include in a partial response.
in: query
name: fields
schema:
type: string
key:
description: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
in: query
name: key
schema:
type: string
oauth_token:
description: OAuth 2.0 token for the current user.
in: query
name: oauth_token
schema:
type: string
pp:
description: Pretty-print response.
in: query
name: pp
schema:
type: boolean
prettyPrint:
description: Returns response with indentations and line breaks.
in: query
name: prettyPrint
schema:
type: boolean
quotaUser:
description: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
in: query
name: quotaUser
schema:
type: string
uploadType:
description: Legacy upload protocol for media (e.g. "media", "multipart").
in: query
name: uploadType
schema:
type: string
upload_protocol:
description: Upload protocol for media (e.g. "raw", "multipart").
in: query
name: upload_protocol
schema:
type: string
schemas:
DetectLanguageRequest:
description: The request message for language detection.
properties:
q:
description: |-
The input text upon which to perform language detection. Repeat this
parameter to perform language detection on multiple text inputs.
items:
type: string
type: array
type: object
DetectionsListResponse:
properties:
detections:
description: A detections contains detection results of several text
items:
$ref: "#/components/schemas/DetectionsResource"
type: array
type: object
DetectionsResource:
description: An array of languages which we detect for the given text The most likely language list first.
items:
properties:
confidence:
description: The confidence of the detection result of this language.
format: float
type: number
isReliable:
description: A boolean to indicate is the language detection result reliable.
type: boolean
language:
description: The language we detected.
type: string
type: object
type: array
GetSupportedLanguagesRequest:
description: The request message for discovering supported languages.
properties:
target:
description: |-
The language to use to return localized, human readable names of supported
languages.
type: string
type: object
LanguagesListResponse:
properties:
languages:
description: List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.
items:
$ref: "#/components/schemas/LanguagesResource"
type: array
type: object
LanguagesResource:
properties:
language:
description: |-
Supported language code, generally consisting of its ISO 639-1
identifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including
language + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH')
type: string
name:
description: Human readable name of the language localized to the target language.
type: string
type: object
TranslateTextRequest:
description: The main translation request message for the Cloud Translation API.
properties:
format:
description: |-
The format of the source text, in either HTML (default) or plain-text. A
value of "html" indicates HTML and a value of "text" indicates plain-text.
type: string
model:
description: |-
The `model` type requested for this translation. Valid values are
listed in public documentation.
type: string
q:
description: |-
The input text to translate. Repeat this parameter to perform translation
operations on multiple text inputs.
items:
type: string
type: array
source:
description: |-
The language of the source text, set to one of the language codes listed in
Language Support. If the source language is not specified, the API will
attempt to identify the source language automatically and return it within
the response.
type: string
target:
description: |-
The language to use for translation of the input text, set to one of the
language codes listed in Language Support.
type: string
type: object
TranslationsListResponse:
description: The main language translation response message.
properties:
translations:
description: Translations contains list of translation results of given text
items:
$ref: "#/components/schemas/TranslationsResource"
type: array
type: object
TranslationsResource:
properties:
detectedSourceLanguage:
description: |-
The source language of the initial request, detected automatically, if
no source language was passed within the initial request. If the
source language was passed, auto-detection of the language will not
occur and this field will be empty.
type: string
model:
description: |-
The `model` type used for this translation. Valid values are
listed in public documentation. Can be different from requested `model`.
Present only if specific model type was explicitly requested.
type: string
translatedText:
description: Text translated into the target language.
type: string
type: object
securitySchemes:
Oauth2:
description: Oauth 2.0 implicit authentication
flows:
implicit:
authorizationUrl: https://accounts.google.com/o/oauth2/auth
scopes:
https://www.googleapis.com/auth/cloud-platform: View and manage your data across Google Cloud Platform services
https://www.googleapis.com/auth/cloud-translation: Translate text from one language to another using Google Translate
type: oauth2
Oauth2c:
description: Oauth 2.0 authorizationCode authentication
flows:
authorizationCode:
authorizationUrl: https://accounts.google.com/o/oauth2/auth
scopes:
https://www.googleapis.com/auth/cloud-platform: View and manage your data across Google Cloud Platform services
https://www.googleapis.com/auth/cloud-translation: Translate text from one language to another using Google Translate
tokenUrl: https://accounts.google.com/o/oauth2/token
type: oauth2