1{ 2 "auth": { 3 "oauth2": { 4 "scopes": { 5 "https://www.googleapis.com/auth/cloud-platform": { 6 "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account." 7 }, 8 "https://www.googleapis.com/auth/cloud-translation": { 9 "description": "Translate text from one language to another using Google Translate" 10 } 11 } 12 } 13 }, 14 "basePath": "", 15 "baseUrl": "https://translation.googleapis.com/", 16 "batchPath": "batch", 17 "canonicalName": "Translate", 18 "description": "Integrates text translation into your website or application.", 19 "discoveryVersion": "v1", 20 "documentationLink": "https://cloud.google.com/translate/docs/quickstarts", 21 "fullyEncodeReservedExpansion": true, 22 "icons": { 23 "x16": "http://www.google.com/images/icons/product/search-16.gif", 24 "x32": "http://www.google.com/images/icons/product/search-32.gif" 25 }, 26 "id": "translate:v3beta1", 27 "kind": "discovery#restDescription", 28 "mtlsRootUrl": "https://translation.mtls.googleapis.com/", 29 "name": "translate", 30 "ownerDomain": "google.com", 31 "ownerName": "Google", 32 "parameters": { 33 "$.xgafv": { 34 "description": "V1 error format.", 35 "enum": [ 36 "1", 37 "2" 38 ], 39 "enumDescriptions": [ 40 "v1 error format", 41 "v2 error format" 42 ], 43 "location": "query", 44 "type": "string" 45 }, 46 "access_token": { 47 "description": "OAuth access token.", 48 "location": "query", 49 "type": "string" 50 }, 51 "alt": { 52 "default": "json", 53 "description": "Data format for response.", 54 "enum": [ 55 "json", 56 "media", 57 "proto" 58 ], 59 "enumDescriptions": [ 60 "Responses with Content-Type of application/json", 61 "Media download with context-dependent Content-Type", 62 "Responses with Content-Type of application/x-protobuf" 63 ], 64 "location": "query", 65 "type": "string" 66 }, 67 "callback": { 68 "description": "JSONP", 69 "location": "query", 70 "type": "string" 71 }, 72 "fields": { 73 "description": "Selector specifying which fields to include in a partial response.", 74 "location": "query", 75 "type": "string" 76 }, 77 "key": { 78 "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.", 79 "location": "query", 80 "type": "string" 81 }, 82 "oauth_token": { 83 "description": "OAuth 2.0 token for the current user.", 84 "location": "query", 85 "type": "string" 86 }, 87 "prettyPrint": { 88 "default": "true", 89 "description": "Returns response with indentations and line breaks.", 90 "location": "query", 91 "type": "boolean" 92 }, 93 "quotaUser": { 94 "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.", 95 "location": "query", 96 "type": "string" 97 }, 98 "uploadType": { 99 "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", 100 "location": "query", 101 "type": "string" 102 }, 103 "upload_protocol": { 104 "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", 105 "location": "query", 106 "type": "string" 107 } 108 }, 109 "protocol": "rest", 110 "resources": { 111 "projects": { 112 "methods": { 113 "detectLanguage": { 114 "description": "Detects the language of text within a request.", 115 "flatPath": "v3beta1/projects/{projectsId}:detectLanguage", 116 "httpMethod": "POST", 117 "id": "translate.projects.detectLanguage", 118 "parameterOrder": [ 119 "parent" 120 ], 121 "parameters": { 122 "parent": { 123 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.", 124 "location": "path", 125 "pattern": "^projects/[^/]+$", 126 "required": true, 127 "type": "string" 128 } 129 }, 130 "path": "v3beta1/{+parent}:detectLanguage", 131 "request": { 132 "$ref": "DetectLanguageRequest" 133 }, 134 "response": { 135 "$ref": "DetectLanguageResponse" 136 }, 137 "scopes": [ 138 "https://www.googleapis.com/auth/cloud-platform", 139 "https://www.googleapis.com/auth/cloud-translation" 140 ] 141 }, 142 "getSupportedLanguages": { 143 "description": "Returns a list of supported languages for translation.", 144 "flatPath": "v3beta1/projects/{projectsId}/supportedLanguages", 145 "httpMethod": "GET", 146 "id": "translate.projects.getSupportedLanguages", 147 "parameterOrder": [ 148 "parent" 149 ], 150 "parameters": { 151 "displayLanguageCode": { 152 "description": "Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.", 153 "location": "query", 154 "type": "string" 155 }, 156 "model": { 157 "description": "Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.", 158 "location": "query", 159 "type": "string" 160 }, 161 "parent": { 162 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.", 163 "location": "path", 164 "pattern": "^projects/[^/]+$", 165 "required": true, 166 "type": "string" 167 } 168 }, 169 "path": "v3beta1/{+parent}/supportedLanguages", 170 "response": { 171 "$ref": "SupportedLanguages" 172 }, 173 "scopes": [ 174 "https://www.googleapis.com/auth/cloud-platform", 175 "https://www.googleapis.com/auth/cloud-translation" 176 ] 177 }, 178 "translateText": { 179 "description": "Translates input text and returns translated text.", 180 "flatPath": "v3beta1/projects/{projectsId}:translateText", 181 "httpMethod": "POST", 182 "id": "translate.projects.translateText", 183 "parameterOrder": [ 184 "parent" 185 ], 186 "parameters": { 187 "parent": { 188 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.", 189 "location": "path", 190 "pattern": "^projects/[^/]+$", 191 "required": true, 192 "type": "string" 193 } 194 }, 195 "path": "v3beta1/{+parent}:translateText", 196 "request": { 197 "$ref": "TranslateTextRequest" 198 }, 199 "response": { 200 "$ref": "TranslateTextResponse" 201 }, 202 "scopes": [ 203 "https://www.googleapis.com/auth/cloud-platform", 204 "https://www.googleapis.com/auth/cloud-translation" 205 ] 206 } 207 }, 208 "resources": { 209 "locations": { 210 "methods": { 211 "batchTranslateDocument": { 212 "description": "Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", 213 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}:batchTranslateDocument", 214 "httpMethod": "POST", 215 "id": "translate.projects.locations.batchTranslateDocument", 216 "parameterOrder": [ 217 "parent" 218 ], 219 "parameters": { 220 "parent": { 221 "description": "Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.", 222 "location": "path", 223 "pattern": "^projects/[^/]+/locations/[^/]+$", 224 "required": true, 225 "type": "string" 226 } 227 }, 228 "path": "v3beta1/{+parent}:batchTranslateDocument", 229 "request": { 230 "$ref": "BatchTranslateDocumentRequest" 231 }, 232 "response": { 233 "$ref": "Operation" 234 }, 235 "scopes": [ 236 "https://www.googleapis.com/auth/cloud-platform" 237 ] 238 }, 239 "batchTranslateText": { 240 "description": "Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.", 241 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}:batchTranslateText", 242 "httpMethod": "POST", 243 "id": "translate.projects.locations.batchTranslateText", 244 "parameterOrder": [ 245 "parent" 246 ], 247 "parameters": { 248 "parent": { 249 "description": "Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.", 250 "location": "path", 251 "pattern": "^projects/[^/]+/locations/[^/]+$", 252 "required": true, 253 "type": "string" 254 } 255 }, 256 "path": "v3beta1/{+parent}:batchTranslateText", 257 "request": { 258 "$ref": "BatchTranslateTextRequest" 259 }, 260 "response": { 261 "$ref": "Operation" 262 }, 263 "scopes": [ 264 "https://www.googleapis.com/auth/cloud-platform" 265 ] 266 }, 267 "detectLanguage": { 268 "description": "Detects the language of text within a request.", 269 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}:detectLanguage", 270 "httpMethod": "POST", 271 "id": "translate.projects.locations.detectLanguage", 272 "parameterOrder": [ 273 "parent" 274 ], 275 "parameters": { 276 "parent": { 277 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.", 278 "location": "path", 279 "pattern": "^projects/[^/]+/locations/[^/]+$", 280 "required": true, 281 "type": "string" 282 } 283 }, 284 "path": "v3beta1/{+parent}:detectLanguage", 285 "request": { 286 "$ref": "DetectLanguageRequest" 287 }, 288 "response": { 289 "$ref": "DetectLanguageResponse" 290 }, 291 "scopes": [ 292 "https://www.googleapis.com/auth/cloud-platform", 293 "https://www.googleapis.com/auth/cloud-translation" 294 ] 295 }, 296 "get": { 297 "description": "Gets information about a location.", 298 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}", 299 "httpMethod": "GET", 300 "id": "translate.projects.locations.get", 301 "parameterOrder": [ 302 "name" 303 ], 304 "parameters": { 305 "name": { 306 "description": "Resource name for the location.", 307 "location": "path", 308 "pattern": "^projects/[^/]+/locations/[^/]+$", 309 "required": true, 310 "type": "string" 311 } 312 }, 313 "path": "v3beta1/{+name}", 314 "response": { 315 "$ref": "Location" 316 }, 317 "scopes": [ 318 "https://www.googleapis.com/auth/cloud-platform", 319 "https://www.googleapis.com/auth/cloud-translation" 320 ] 321 }, 322 "getSupportedLanguages": { 323 "description": "Returns a list of supported languages for translation.", 324 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/supportedLanguages", 325 "httpMethod": "GET", 326 "id": "translate.projects.locations.getSupportedLanguages", 327 "parameterOrder": [ 328 "parent" 329 ], 330 "parameters": { 331 "displayLanguageCode": { 332 "description": "Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.", 333 "location": "query", 334 "type": "string" 335 }, 336 "model": { 337 "description": "Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.", 338 "location": "query", 339 "type": "string" 340 }, 341 "parent": { 342 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.", 343 "location": "path", 344 "pattern": "^projects/[^/]+/locations/[^/]+$", 345 "required": true, 346 "type": "string" 347 } 348 }, 349 "path": "v3beta1/{+parent}/supportedLanguages", 350 "response": { 351 "$ref": "SupportedLanguages" 352 }, 353 "scopes": [ 354 "https://www.googleapis.com/auth/cloud-platform", 355 "https://www.googleapis.com/auth/cloud-translation" 356 ] 357 }, 358 "list": { 359 "description": "Lists information about the supported locations for this service.", 360 "flatPath": "v3beta1/projects/{projectsId}/locations", 361 "httpMethod": "GET", 362 "id": "translate.projects.locations.list", 363 "parameterOrder": [ 364 "name" 365 ], 366 "parameters": { 367 "filter": { 368 "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in [AIP-160](https://google.aip.dev/160).", 369 "location": "query", 370 "type": "string" 371 }, 372 "name": { 373 "description": "The resource that owns the locations collection, if applicable.", 374 "location": "path", 375 "pattern": "^projects/[^/]+$", 376 "required": true, 377 "type": "string" 378 }, 379 "pageSize": { 380 "description": "The maximum number of results to return. If not set, the service selects a default.", 381 "format": "int32", 382 "location": "query", 383 "type": "integer" 384 }, 385 "pageToken": { 386 "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", 387 "location": "query", 388 "type": "string" 389 } 390 }, 391 "path": "v3beta1/{+name}/locations", 392 "response": { 393 "$ref": "ListLocationsResponse" 394 }, 395 "scopes": [ 396 "https://www.googleapis.com/auth/cloud-platform", 397 "https://www.googleapis.com/auth/cloud-translation" 398 ] 399 }, 400 "translateDocument": { 401 "description": "Translates documents in synchronous mode.", 402 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}:translateDocument", 403 "httpMethod": "POST", 404 "id": "translate.projects.locations.translateDocument", 405 "parameterOrder": [ 406 "parent" 407 ], 408 "parameters": { 409 "parent": { 410 "description": "Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.", 411 "location": "path", 412 "pattern": "^projects/[^/]+/locations/[^/]+$", 413 "required": true, 414 "type": "string" 415 } 416 }, 417 "path": "v3beta1/{+parent}:translateDocument", 418 "request": { 419 "$ref": "TranslateDocumentRequest" 420 }, 421 "response": { 422 "$ref": "TranslateDocumentResponse" 423 }, 424 "scopes": [ 425 "https://www.googleapis.com/auth/cloud-platform", 426 "https://www.googleapis.com/auth/cloud-translation" 427 ] 428 }, 429 "translateText": { 430 "description": "Translates input text and returns translated text.", 431 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}:translateText", 432 "httpMethod": "POST", 433 "id": "translate.projects.locations.translateText", 434 "parameterOrder": [ 435 "parent" 436 ], 437 "parameters": { 438 "parent": { 439 "description": "Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.", 440 "location": "path", 441 "pattern": "^projects/[^/]+/locations/[^/]+$", 442 "required": true, 443 "type": "string" 444 } 445 }, 446 "path": "v3beta1/{+parent}:translateText", 447 "request": { 448 "$ref": "TranslateTextRequest" 449 }, 450 "response": { 451 "$ref": "TranslateTextResponse" 452 }, 453 "scopes": [ 454 "https://www.googleapis.com/auth/cloud-platform", 455 "https://www.googleapis.com/auth/cloud-translation" 456 ] 457 } 458 }, 459 "resources": { 460 "glossaries": { 461 "methods": { 462 "create": { 463 "description": "Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.", 464 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/glossaries", 465 "httpMethod": "POST", 466 "id": "translate.projects.locations.glossaries.create", 467 "parameterOrder": [ 468 "parent" 469 ], 470 "parameters": { 471 "parent": { 472 "description": "Required. The project name.", 473 "location": "path", 474 "pattern": "^projects/[^/]+/locations/[^/]+$", 475 "required": true, 476 "type": "string" 477 } 478 }, 479 "path": "v3beta1/{+parent}/glossaries", 480 "request": { 481 "$ref": "Glossary" 482 }, 483 "response": { 484 "$ref": "Operation" 485 }, 486 "scopes": [ 487 "https://www.googleapis.com/auth/cloud-platform" 488 ] 489 }, 490 "delete": { 491 "description": "Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.", 492 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", 493 "httpMethod": "DELETE", 494 "id": "translate.projects.locations.glossaries.delete", 495 "parameterOrder": [ 496 "name" 497 ], 498 "parameters": { 499 "name": { 500 "description": "Required. The name of the glossary to delete.", 501 "location": "path", 502 "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", 503 "required": true, 504 "type": "string" 505 } 506 }, 507 "path": "v3beta1/{+name}", 508 "response": { 509 "$ref": "Operation" 510 }, 511 "scopes": [ 512 "https://www.googleapis.com/auth/cloud-platform", 513 "https://www.googleapis.com/auth/cloud-translation" 514 ] 515 }, 516 "get": { 517 "description": "Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.", 518 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/glossaries/{glossariesId}", 519 "httpMethod": "GET", 520 "id": "translate.projects.locations.glossaries.get", 521 "parameterOrder": [ 522 "name" 523 ], 524 "parameters": { 525 "name": { 526 "description": "Required. The name of the glossary to retrieve.", 527 "location": "path", 528 "pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+$", 529 "required": true, 530 "type": "string" 531 } 532 }, 533 "path": "v3beta1/{+name}", 534 "response": { 535 "$ref": "Glossary" 536 }, 537 "scopes": [ 538 "https://www.googleapis.com/auth/cloud-platform", 539 "https://www.googleapis.com/auth/cloud-translation" 540 ] 541 }, 542 "list": { 543 "description": "Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.", 544 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/glossaries", 545 "httpMethod": "GET", 546 "id": "translate.projects.locations.glossaries.list", 547 "parameterOrder": [ 548 "parent" 549 ], 550 "parameters": { 551 "filter": { 552 "description": "Optional. Filter specifying constraints of a list operation. Specify the constraint by the format of \"key=value\", where key must be \"src\" or \"tgt\", and the value must be a valid language code. For multiple restrictions, concatenate them by \"AND\" (uppercase only), such as: \"src=en-US AND tgt=zh-CN\". Notice that the exact match is used here, which means using 'en-US' and 'en' can lead to different results, which depends on the language code you used when you create the glossary. For the unidirectional glossaries, the \"src\" and \"tgt\" add restrictions on the source and target language code separately. For the equivalent term set glossaries, the \"src\" and/or \"tgt\" add restrictions on the term set. For example: \"src=en-US AND tgt=zh-CN\" will only pick the unidirectional glossaries which exactly match the source language code as \"en-US\" and the target language code \"zh-CN\", but all equivalent term set glossaries which contain \"en-US\" and \"zh-CN\" in their language set will be picked. If missing, no filtering is performed.", 553 "location": "query", 554 "type": "string" 555 }, 556 "pageSize": { 557 "description": "Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.", 558 "format": "int32", 559 "location": "query", 560 "type": "integer" 561 }, 562 "pageToken": { 563 "description": "Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossariesResponse.next_page_token] returned from the previous call to `ListGlossaries` method. The first page is returned if `page_token`is empty or missing.", 564 "location": "query", 565 "type": "string" 566 }, 567 "parent": { 568 "description": "Required. The name of the project from which to list all of the glossaries.", 569 "location": "path", 570 "pattern": "^projects/[^/]+/locations/[^/]+$", 571 "required": true, 572 "type": "string" 573 } 574 }, 575 "path": "v3beta1/{+parent}/glossaries", 576 "response": { 577 "$ref": "ListGlossariesResponse" 578 }, 579 "scopes": [ 580 "https://www.googleapis.com/auth/cloud-platform", 581 "https://www.googleapis.com/auth/cloud-translation" 582 ] 583 } 584 } 585 }, 586 "operations": { 587 "methods": { 588 "cancel": { 589 "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 590 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 591 "httpMethod": "POST", 592 "id": "translate.projects.locations.operations.cancel", 593 "parameterOrder": [ 594 "name" 595 ], 596 "parameters": { 597 "name": { 598 "description": "The name of the operation resource to be cancelled.", 599 "location": "path", 600 "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 601 "required": true, 602 "type": "string" 603 } 604 }, 605 "path": "v3beta1/{+name}:cancel", 606 "request": { 607 "$ref": "CancelOperationRequest" 608 }, 609 "response": { 610 "$ref": "Empty" 611 }, 612 "scopes": [ 613 "https://www.googleapis.com/auth/cloud-platform", 614 "https://www.googleapis.com/auth/cloud-translation" 615 ] 616 }, 617 "delete": { 618 "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", 619 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 620 "httpMethod": "DELETE", 621 "id": "translate.projects.locations.operations.delete", 622 "parameterOrder": [ 623 "name" 624 ], 625 "parameters": { 626 "name": { 627 "description": "The name of the operation resource to be deleted.", 628 "location": "path", 629 "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 630 "required": true, 631 "type": "string" 632 } 633 }, 634 "path": "v3beta1/{+name}", 635 "response": { 636 "$ref": "Empty" 637 }, 638 "scopes": [ 639 "https://www.googleapis.com/auth/cloud-platform", 640 "https://www.googleapis.com/auth/cloud-translation" 641 ] 642 }, 643 "get": { 644 "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 645 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 646 "httpMethod": "GET", 647 "id": "translate.projects.locations.operations.get", 648 "parameterOrder": [ 649 "name" 650 ], 651 "parameters": { 652 "name": { 653 "description": "The name of the operation resource.", 654 "location": "path", 655 "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 656 "required": true, 657 "type": "string" 658 } 659 }, 660 "path": "v3beta1/{+name}", 661 "response": { 662 "$ref": "Operation" 663 }, 664 "scopes": [ 665 "https://www.googleapis.com/auth/cloud-platform", 666 "https://www.googleapis.com/auth/cloud-translation" 667 ] 668 }, 669 "list": { 670 "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 671 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/operations", 672 "httpMethod": "GET", 673 "id": "translate.projects.locations.operations.list", 674 "parameterOrder": [ 675 "name" 676 ], 677 "parameters": { 678 "filter": { 679 "description": "The standard list filter.", 680 "location": "query", 681 "type": "string" 682 }, 683 "name": { 684 "description": "The name of the operation's parent resource.", 685 "location": "path", 686 "pattern": "^projects/[^/]+/locations/[^/]+$", 687 "required": true, 688 "type": "string" 689 }, 690 "pageSize": { 691 "description": "The standard list page size.", 692 "format": "int32", 693 "location": "query", 694 "type": "integer" 695 }, 696 "pageToken": { 697 "description": "The standard list page token.", 698 "location": "query", 699 "type": "string" 700 } 701 }, 702 "path": "v3beta1/{+name}/operations", 703 "response": { 704 "$ref": "ListOperationsResponse" 705 }, 706 "scopes": [ 707 "https://www.googleapis.com/auth/cloud-platform", 708 "https://www.googleapis.com/auth/cloud-translation" 709 ] 710 }, 711 "wait": { 712 "description": "Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.", 713 "flatPath": "v3beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:wait", 714 "httpMethod": "POST", 715 "id": "translate.projects.locations.operations.wait", 716 "parameterOrder": [ 717 "name" 718 ], 719 "parameters": { 720 "name": { 721 "description": "The name of the operation resource to wait on.", 722 "location": "path", 723 "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 724 "required": true, 725 "type": "string" 726 } 727 }, 728 "path": "v3beta1/{+name}:wait", 729 "request": { 730 "$ref": "WaitOperationRequest" 731 }, 732 "response": { 733 "$ref": "Operation" 734 }, 735 "scopes": [ 736 "https://www.googleapis.com/auth/cloud-platform", 737 "https://www.googleapis.com/auth/cloud-translation" 738 ] 739 } 740 } 741 } 742 } 743 } 744 } 745 } 746 }, 747 "revision": "20211220", 748 "rootUrl": "https://translation.googleapis.com/", 749 "schemas": { 750 "BatchDocumentInputConfig": { 751 "description": "Input configuration for BatchTranslateDocument request.", 752 "id": "BatchDocumentInputConfig", 753 "properties": { 754 "gcsSource": { 755 "$ref": "GcsSource", 756 "description": "Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.docx`) or a wildcard (for example, `gs://translation-test/*`). File mime type is determined based on extension. Supported mime type includes: - `pdf`, application/pdf - `docx`, application/vnd.openxmlformats-officedocument.wordprocessingml.document - `pptx`, application/vnd.openxmlformats-officedocument.presentationml.presentation - `xlsx`, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. The max file size to support for `.pdf` is 1GB and the max page limit is 1000 pages. The max file size to support for all input documents is 1GB." 757 } 758 }, 759 "type": "object" 760 }, 761 "BatchDocumentOutputConfig": { 762 "description": "Output configuration for BatchTranslateDocument request.", 763 "id": "BatchDocumentOutputConfig", 764 "properties": { 765 "gcsDestination": { 766 "$ref": "GcsDestination", 767 "description": "Google Cloud Storage destination for output content. For every single input document (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateDocumentRequest). While the input documents are being processed, we write/update an index file `index.csv` under `gcs_destination.output_uri_prefix` (for example, gs://translation_output/index.csv) The index file is generated/updated as new files are being translated. The format is: input_document,target_language_code,translation_output,error_output, glossary_translation_output,glossary_error_output `input_document` is one file we matched using gcs_source.input_uri. `target_language_code` is provided in the request. `translation_output` contains the translations. (details provided below) `error_output` contains the error message during processing of the file. Both translations_file and errors_file could be empty strings if we have no content to output. `glossary_translation_output` and `glossary_error_output` are the translated output/error when we apply glossaries. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) The naming format of translation output files follows (for target language code [trg]): `translation_output`: gs://translation_output/a_b_c_[trg]_translation.[extension] `glossary_translation_output`: gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The output document will maintain the same file format as the input document. The naming format of error output files follows (for target language code [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt `glossary_error_output`: gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error output is a txt file containing error details." 768 } 769 }, 770 "type": "object" 771 }, 772 "BatchTranslateDocumentRequest": { 773 "description": "The BatchTranslateDocument request.", 774 "id": "BatchTranslateDocumentRequest", 775 "properties": { 776 "formatConversions": { 777 "additionalProperties": { 778 "type": "string" 779 }, 780 "description": "Optional.", 781 "type": "object" 782 }, 783 "glossaries": { 784 "additionalProperties": { 785 "$ref": "TranslateTextGlossaryConfig" 786 }, 787 "description": "Optional. Glossaries to be applied. It's keyed by target language code.", 788 "type": "object" 789 }, 790 "inputConfigs": { 791 "description": "Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.", 792 "items": { 793 "$ref": "BatchDocumentInputConfig" 794 }, 795 "type": "array" 796 }, 797 "models": { 798 "additionalProperties": { 799 "type": "string" 800 }, 801 "description": "Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.", 802 "type": "object" 803 }, 804 "outputConfig": { 805 "$ref": "BatchDocumentOutputConfig", 806 "description": "Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs." 807 }, 808 "sourceLanguageCode": { 809 "description": "Required. The BCP-47 language code of the input document if known, for example, \"en-US\" or \"sr-Latn\". Supported language codes are listed in Language Support (https://cloud.google.com/translate/docs/languages).", 810 "type": "string" 811 }, 812 "targetLanguageCodes": { 813 "description": "Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here.", 814 "items": { 815 "type": "string" 816 }, 817 "type": "array" 818 } 819 }, 820 "type": "object" 821 }, 822 "BatchTranslateTextRequest": { 823 "description": "The batch translation request.", 824 "id": "BatchTranslateTextRequest", 825 "properties": { 826 "glossaries": { 827 "additionalProperties": { 828 "$ref": "TranslateTextGlossaryConfig" 829 }, 830 "description": "Optional. Glossaries to be applied for translation. It's keyed by target language code.", 831 "type": "object" 832 }, 833 "inputConfigs": { 834 "description": "Required. Input configurations. The total number of files matched should be <= 100. The total content size should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.", 835 "items": { 836 "$ref": "InputConfig" 837 }, 838 "type": "array" 839 }, 840 "labels": { 841 "additionalProperties": { 842 "type": "string" 843 }, 844 "description": "Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.", 845 "type": "object" 846 }, 847 "models": { 848 "additionalProperties": { 849 "type": "string" 850 }, 851 "description": "Optional. The models to use for translation. Map's key is target language code. Map's value is model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used.", 852 "type": "object" 853 }, 854 "outputConfig": { 855 "$ref": "OutputConfig", 856 "description": "Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs." 857 }, 858 "sourceLanguageCode": { 859 "description": "Required. Source language code.", 860 "type": "string" 861 }, 862 "targetLanguageCodes": { 863 "description": "Required. Specify up to 10 language codes here.", 864 "items": { 865 "type": "string" 866 }, 867 "type": "array" 868 } 869 }, 870 "type": "object" 871 }, 872 "CancelOperationRequest": { 873 "description": "The request message for Operations.CancelOperation.", 874 "id": "CancelOperationRequest", 875 "properties": {}, 876 "type": "object" 877 }, 878 "DetectLanguageRequest": { 879 "description": "The request message for language detection.", 880 "id": "DetectLanguageRequest", 881 "properties": { 882 "content": { 883 "description": "The content of the input stored as a string.", 884 "type": "string" 885 }, 886 "labels": { 887 "additionalProperties": { 888 "type": "string" 889 }, 890 "description": "Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.", 891 "type": "object" 892 }, 893 "mimeType": { 894 "description": "Optional. The format of the source text, for example, \"text/html\", \"text/plain\". If left blank, the MIME type defaults to \"text/html\".", 895 "type": "string" 896 }, 897 "model": { 898 "description": "Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used.", 899 "type": "string" 900 } 901 }, 902 "type": "object" 903 }, 904 "DetectLanguageResponse": { 905 "description": "The response message for language detection.", 906 "id": "DetectLanguageResponse", 907 "properties": { 908 "languages": { 909 "description": "A list of detected languages sorted by detection confidence in descending order. The most probable language first.", 910 "items": { 911 "$ref": "DetectedLanguage" 912 }, 913 "type": "array" 914 } 915 }, 916 "type": "object" 917 }, 918 "DetectedLanguage": { 919 "description": "The response message for language detection.", 920 "id": "DetectedLanguage", 921 "properties": { 922 "confidence": { 923 "description": "The confidence of the detection result for this language.", 924 "format": "float", 925 "type": "number" 926 }, 927 "languageCode": { 928 "description": "The BCP-47 language code of source content in the request, detected automatically.", 929 "type": "string" 930 } 931 }, 932 "type": "object" 933 }, 934 "DocumentInputConfig": { 935 "description": "A document translation request input config.", 936 "id": "DocumentInputConfig", 937 "properties": { 938 "content": { 939 "description": "Document's content represented as a stream of bytes.", 940 "format": "byte", 941 "type": "string" 942 }, 943 "gcsSource": { 944 "$ref": "GcsSource", 945 "description": "Google Cloud Storage location. This must be a single file. For example: gs://example_bucket/example_file.pdf" 946 }, 947 "mimeType": { 948 "description": "Specifies the input document's mime_type. If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content the mime_type must be provided. Currently supported mime types are: - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 949 "type": "string" 950 } 951 }, 952 "type": "object" 953 }, 954 "DocumentOutputConfig": { 955 "description": "A document translation request output config.", 956 "id": "DocumentOutputConfig", 957 "properties": { 958 "gcsDestination": { 959 "$ref": "GcsDestination", 960 "description": "Optional. Google Cloud Storage destination for the translation output, e.g., `gs://my_bucket/my_directory/`. The destination directory provided does not have to be empty, but the bucket must exist. If a file with the same name as the output file already exists in the destination an error will be returned. For a DocumentInputConfig.contents provided document, the output file will have the name \"output_[trg]_translations.[ext]\", where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with URI: \"gs://a/b/c.[extension]\" stored in a gcs_destination bucket with name \"my_bucket\" will have an output URI: \"gs://my_bucket/a_b_c_[trg]_translations.[ext]\", where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If the document was directly provided through the request, then the output document will have the format: \"gs://my_bucket/translated_document_[trg]_translations.[ext], where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will be equal to the default output URI but have `glossary_translations` instead of `translations`. For the previous example, its glossary URI would be: \"gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]\". Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket." 961 }, 962 "mimeType": { 963 "description": "Optional. Specifies the translated document's mime_type. If not specified, the translated file's mime type will be the same as the input file's mime type. Currently only support the output mime type to be the same as input mime type. - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 964 "type": "string" 965 } 966 }, 967 "type": "object" 968 }, 969 "DocumentTranslation": { 970 "description": "A translated document message.", 971 "id": "DocumentTranslation", 972 "properties": { 973 "byteStreamOutputs": { 974 "description": "The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.", 975 "items": { 976 "format": "byte", 977 "type": "string" 978 }, 979 "type": "array" 980 }, 981 "detectedLanguageCode": { 982 "description": "The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.", 983 "type": "string" 984 }, 985 "mimeType": { 986 "description": "The translated document's mime type.", 987 "type": "string" 988 } 989 }, 990 "type": "object" 991 }, 992 "Empty": { 993 "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.", 994 "id": "Empty", 995 "properties": {}, 996 "type": "object" 997 }, 998 "GcsDestination": { 999 "description": "The Google Cloud Storage location for the output content.", 1000 "id": "GcsDestination", 1001 "properties": { 1002 "outputUriPrefix": { 1003 "description": "Required. There must be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with \"/\" and start with \"gs://\", otherwise an INVALID_ARGUMENT (400) error is returned.", 1004 "type": "string" 1005 } 1006 }, 1007 "type": "object" 1008 }, 1009 "GcsSource": { 1010 "description": "The Google Cloud Storage location for the input content.", 1011 "id": "GcsSource", 1012 "properties": { 1013 "inputUri": { 1014 "description": "Required. Source data URI. For example, `gs://my_bucket/my_object`.", 1015 "type": "string" 1016 } 1017 }, 1018 "type": "object" 1019 }, 1020 "Glossary": { 1021 "description": "Represents a glossary built from user provided data.", 1022 "id": "Glossary", 1023 "properties": { 1024 "endTime": { 1025 "description": "Output only. When the glossary creation was finished.", 1026 "format": "google-datetime", 1027 "readOnly": true, 1028 "type": "string" 1029 }, 1030 "entryCount": { 1031 "description": "Output only. The number of entries defined in the glossary.", 1032 "format": "int32", 1033 "readOnly": true, 1034 "type": "integer" 1035 }, 1036 "inputConfig": { 1037 "$ref": "GlossaryInputConfig", 1038 "description": "Required. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints." 1039 }, 1040 "languageCodesSet": { 1041 "$ref": "LanguageCodesSet", 1042 "description": "Used with equivalent term set glossaries." 1043 }, 1044 "languagePair": { 1045 "$ref": "LanguageCodePair", 1046 "description": "Used with unidirectional glossaries." 1047 }, 1048 "name": { 1049 "description": "Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.", 1050 "type": "string" 1051 }, 1052 "submitTime": { 1053 "description": "Output only. When CreateGlossary was called.", 1054 "format": "google-datetime", 1055 "readOnly": true, 1056 "type": "string" 1057 } 1058 }, 1059 "type": "object" 1060 }, 1061 "GlossaryInputConfig": { 1062 "description": "Input configuration for glossaries.", 1063 "id": "GlossaryInputConfig", 1064 "properties": { 1065 "gcsSource": { 1066 "$ref": "GcsSource", 1067 "description": "Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. The first column is source text. The second column is target text. The file must not contain headers. That is, the first row is data, not column names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms in multiple languages. The format is defined for Google Translation Toolkit and documented in [Use a glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en)." 1068 } 1069 }, 1070 "type": "object" 1071 }, 1072 "InputConfig": { 1073 "description": "Input configuration for BatchTranslateText request.", 1074 "id": "InputConfig", 1075 "properties": { 1076 "gcsSource": { 1077 "$ref": "GcsSource", 1078 "description": "Required. Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.tsv`) or a wildcard (for example, `gs://translation-test/*`). If a file extension is `.tsv`, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant. You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\\t' your_input_file.tsv The other supported file extensions are `.txt` or `.html`, which is treated as a single large chunk of text." 1079 }, 1080 "mimeType": { 1081 "description": "Optional. Can be \"text/plain\" or \"text/html\". For `.tsv`, \"text/html\" is used if mime_type is missing. For `.html`, this field must be \"text/html\" or empty. For `.txt`, this field must be \"text/plain\" or empty.", 1082 "type": "string" 1083 } 1084 }, 1085 "type": "object" 1086 }, 1087 "LanguageCodePair": { 1088 "description": "Used with unidirectional glossaries.", 1089 "id": "LanguageCodePair", 1090 "properties": { 1091 "sourceLanguageCode": { 1092 "description": "Required. The BCP-47 language code of the input text, for example, \"en-US\". Expected to be an exact match for GlossaryTerm.language_code.", 1093 "type": "string" 1094 }, 1095 "targetLanguageCode": { 1096 "description": "Required. The BCP-47 language code for translation output, for example, \"zh-CN\". Expected to be an exact match for GlossaryTerm.language_code.", 1097 "type": "string" 1098 } 1099 }, 1100 "type": "object" 1101 }, 1102 "LanguageCodesSet": { 1103 "description": "Used with equivalent term set glossaries.", 1104 "id": "LanguageCodesSet", 1105 "properties": { 1106 "languageCodes": { 1107 "description": "The BCP-47 language code(s) for terms defined in the glossary. All entries are unique. The list contains at least two entries. Expected to be an exact match for GlossaryTerm.language_code.", 1108 "items": { 1109 "type": "string" 1110 }, 1111 "type": "array" 1112 } 1113 }, 1114 "type": "object" 1115 }, 1116 "ListGlossariesResponse": { 1117 "description": "Response message for ListGlossaries.", 1118 "id": "ListGlossariesResponse", 1119 "properties": { 1120 "glossaries": { 1121 "description": "The list of glossaries for a project.", 1122 "items": { 1123 "$ref": "Glossary" 1124 }, 1125 "type": "array" 1126 }, 1127 "nextPageToken": { 1128 "description": "A token to retrieve a page of results. Pass this value in the [ListGlossariesRequest.page_token] field in the subsequent call to `ListGlossaries` method to retrieve the next page of results.", 1129 "type": "string" 1130 } 1131 }, 1132 "type": "object" 1133 }, 1134 "ListLocationsResponse": { 1135 "description": "The response message for Locations.ListLocations.", 1136 "id": "ListLocationsResponse", 1137 "properties": { 1138 "locations": { 1139 "description": "A list of locations that matches the specified filter in the request.", 1140 "items": { 1141 "$ref": "Location" 1142 }, 1143 "type": "array" 1144 }, 1145 "nextPageToken": { 1146 "description": "The standard List next-page token.", 1147 "type": "string" 1148 } 1149 }, 1150 "type": "object" 1151 }, 1152 "ListOperationsResponse": { 1153 "description": "The response message for Operations.ListOperations.", 1154 "id": "ListOperationsResponse", 1155 "properties": { 1156 "nextPageToken": { 1157 "description": "The standard List next-page token.", 1158 "type": "string" 1159 }, 1160 "operations": { 1161 "description": "A list of operations that matches the specified filter in the request.", 1162 "items": { 1163 "$ref": "Operation" 1164 }, 1165 "type": "array" 1166 } 1167 }, 1168 "type": "object" 1169 }, 1170 "Location": { 1171 "description": "A resource that represents Google Cloud Platform location.", 1172 "id": "Location", 1173 "properties": { 1174 "displayName": { 1175 "description": "The friendly name for this location, typically a nearby city name. For example, \"Tokyo\".", 1176 "type": "string" 1177 }, 1178 "labels": { 1179 "additionalProperties": { 1180 "type": "string" 1181 }, 1182 "description": "Cross-service attributes for the location. For example {\"cloud.googleapis.com/region\": \"us-east1\"}", 1183 "type": "object" 1184 }, 1185 "locationId": { 1186 "description": "The canonical id for this location. For example: `\"us-east1\"`.", 1187 "type": "string" 1188 }, 1189 "metadata": { 1190 "additionalProperties": { 1191 "description": "Properties of the object. Contains field @type with type URL.", 1192 "type": "any" 1193 }, 1194 "description": "Service-specific metadata. For example the available capacity at the given location.", 1195 "type": "object" 1196 }, 1197 "name": { 1198 "description": "Resource name for the location, which may vary between implementations. For example: `\"projects/example-project/locations/us-east1\"`", 1199 "type": "string" 1200 } 1201 }, 1202 "type": "object" 1203 }, 1204 "Operation": { 1205 "description": "This resource represents a long-running operation that is the result of a network API call.", 1206 "id": "Operation", 1207 "properties": { 1208 "done": { 1209 "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.", 1210 "type": "boolean" 1211 }, 1212 "error": { 1213 "$ref": "Status", 1214 "description": "The error result of the operation in case of failure or cancellation." 1215 }, 1216 "metadata": { 1217 "additionalProperties": { 1218 "description": "Properties of the object. Contains field @type with type URL.", 1219 "type": "any" 1220 }, 1221 "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", 1222 "type": "object" 1223 }, 1224 "name": { 1225 "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.", 1226 "type": "string" 1227 }, 1228 "response": { 1229 "additionalProperties": { 1230 "description": "Properties of the object. Contains field @type with type URL.", 1231 "type": "any" 1232 }, 1233 "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", 1234 "type": "object" 1235 } 1236 }, 1237 "type": "object" 1238 }, 1239 "OutputConfig": { 1240 "description": "Output configuration for BatchTranslateText request.", 1241 "id": "OutputConfig", 1242 "properties": { 1243 "gcsDestination": { 1244 "$ref": "GcsDestination", 1245 "description": "Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\\n' instead of '\\r\\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) The format of translations_file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_translations.[extension] If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] The format of errors file (for target language code 'trg') is: gs://translation_test/a_b_c_'trg'_errors.[extension] If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]" 1246 } 1247 }, 1248 "type": "object" 1249 }, 1250 "Status": { 1251 "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", 1252 "id": "Status", 1253 "properties": { 1254 "code": { 1255 "description": "The status code, which should be an enum value of google.rpc.Code.", 1256 "format": "int32", 1257 "type": "integer" 1258 }, 1259 "details": { 1260 "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", 1261 "items": { 1262 "additionalProperties": { 1263 "description": "Properties of the object. Contains field @type with type URL.", 1264 "type": "any" 1265 }, 1266 "type": "object" 1267 }, 1268 "type": "array" 1269 }, 1270 "message": { 1271 "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.", 1272 "type": "string" 1273 } 1274 }, 1275 "type": "object" 1276 }, 1277 "SupportedLanguage": { 1278 "description": "A single supported language response corresponds to information related to one supported language.", 1279 "id": "SupportedLanguage", 1280 "properties": { 1281 "displayName": { 1282 "description": "Human readable name of the language localized in the display language specified in the request.", 1283 "type": "string" 1284 }, 1285 "languageCode": { 1286 "description": "Supported language code, generally consisting of its ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, 'zh-TW' and 'zh-CN')", 1287 "type": "string" 1288 }, 1289 "supportSource": { 1290 "description": "Can be used as source language.", 1291 "type": "boolean" 1292 }, 1293 "supportTarget": { 1294 "description": "Can be used as target language.", 1295 "type": "boolean" 1296 } 1297 }, 1298 "type": "object" 1299 }, 1300 "SupportedLanguages": { 1301 "description": "The response message for discovering supported languages.", 1302 "id": "SupportedLanguages", 1303 "properties": { 1304 "languages": { 1305 "description": "A list of supported language responses. This list contains an entry for each language the Translation API supports.", 1306 "items": { 1307 "$ref": "SupportedLanguage" 1308 }, 1309 "type": "array" 1310 } 1311 }, 1312 "type": "object" 1313 }, 1314 "TranslateDocumentRequest": { 1315 "description": "A document translation request.", 1316 "id": "TranslateDocumentRequest", 1317 "properties": { 1318 "documentInputConfig": { 1319 "$ref": "DocumentInputConfig", 1320 "description": "Required. Input configurations." 1321 }, 1322 "documentOutputConfig": { 1323 "$ref": "DocumentOutputConfig", 1324 "description": "Optional. Output configurations. Defines if the output file should be stored within Cloud Storage as well as the desired output format. If not provided the translated file will only be returned through a byte-stream and its output mime type will be the same as the input file's mime type." 1325 }, 1326 "glossaryConfig": { 1327 "$ref": "TranslateTextGlossaryConfig", 1328 "description": "Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned." 1329 }, 1330 "labels": { 1331 "additionalProperties": { 1332 "type": "string" 1333 }, 1334 "description": "Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/advanced/labels for more information.", 1335 "type": "object" 1336 }, 1337 "model": { 1338 "description": "Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If not provided, the default Google model (NMT) will be used for translation.", 1339 "type": "string" 1340 }, 1341 "sourceLanguageCode": { 1342 "description": "Optional. The BCP-47 language code of the input document if known, for example, \"en-US\" or \"sr-Latn\". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request contains a glossary or a custom model.", 1343 "type": "string" 1344 }, 1345 "targetLanguageCode": { 1346 "description": "Required. The BCP-47 language code to use for translation of the input document, set to one of the language codes listed in Language Support.", 1347 "type": "string" 1348 } 1349 }, 1350 "type": "object" 1351 }, 1352 "TranslateDocumentResponse": { 1353 "description": "A translated document response message.", 1354 "id": "TranslateDocumentResponse", 1355 "properties": { 1356 "documentTranslation": { 1357 "$ref": "DocumentTranslation", 1358 "description": "Translated document." 1359 }, 1360 "glossaryConfig": { 1361 "$ref": "TranslateTextGlossaryConfig", 1362 "description": "The `glossary_config` used for this translation." 1363 }, 1364 "glossaryDocumentTranslation": { 1365 "$ref": "DocumentTranslation", 1366 "description": "The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply." 1367 }, 1368 "model": { 1369 "description": "Only present when 'model' is present in the request. 'model' is normalized to have a project number. For example: If the 'model' field in TranslateDocumentRequest is: `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.", 1370 "type": "string" 1371 } 1372 }, 1373 "type": "object" 1374 }, 1375 "TranslateTextGlossaryConfig": { 1376 "description": "Configures which glossary should be used for a specific target language, and defines options for applying that glossary.", 1377 "id": "TranslateTextGlossaryConfig", 1378 "properties": { 1379 "glossary": { 1380 "description": "Required. Specifies the glossary used for this translation. Use this format: projects/*/locations/*/glossaries/*", 1381 "type": "string" 1382 }, 1383 "ignoreCase": { 1384 "description": "Optional. Indicates match is case-insensitive. Default value is false if missing.", 1385 "type": "boolean" 1386 } 1387 }, 1388 "type": "object" 1389 }, 1390 "TranslateTextRequest": { 1391 "description": "The request message for synchronous translation.", 1392 "id": "TranslateTextRequest", 1393 "properties": { 1394 "contents": { 1395 "description": "Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.", 1396 "items": { 1397 "type": "string" 1398 }, 1399 "type": "array" 1400 }, 1401 "glossaryConfig": { 1402 "$ref": "TranslateTextGlossaryConfig", 1403 "description": "Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned." 1404 }, 1405 "labels": { 1406 "additionalProperties": { 1407 "type": "string" 1408 }, 1409 "description": "Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.", 1410 "type": "object" 1411 }, 1412 "mimeType": { 1413 "description": "Optional. The format of the source text, for example, \"text/html\", \"text/plain\". If left blank, the MIME type defaults to \"text/html\".", 1414 "type": "string" 1415 }, 1416 "model": { 1417 "description": "Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, For global (non-regionalized) requests, use `location-id` `global`. For example, `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used", 1418 "type": "string" 1419 }, 1420 "sourceLanguageCode": { 1421 "description": "Optional. The BCP-47 language code of the input text if known, for example, \"en-US\" or \"sr-Latn\". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.", 1422 "type": "string" 1423 }, 1424 "targetLanguageCode": { 1425 "description": "Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.", 1426 "type": "string" 1427 } 1428 }, 1429 "type": "object" 1430 }, 1431 "TranslateTextResponse": { 1432 "id": "TranslateTextResponse", 1433 "properties": { 1434 "glossaryTranslations": { 1435 "description": "Text translation responses if a glossary is provided in the request. This can be the same as `translations` if no terms apply. This field has the same length as `contents`.", 1436 "items": { 1437 "$ref": "Translation" 1438 }, 1439 "type": "array" 1440 }, 1441 "translations": { 1442 "description": "Text translation responses with no glossary applied. This field has the same length as `contents`.", 1443 "items": { 1444 "$ref": "Translation" 1445 }, 1446 "type": "array" 1447 } 1448 }, 1449 "type": "object" 1450 }, 1451 "Translation": { 1452 "description": "A single translation response.", 1453 "id": "Translation", 1454 "properties": { 1455 "detectedLanguageCode": { 1456 "description": "The BCP-47 language code of source text in 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 does not occur and this field is empty.", 1457 "type": "string" 1458 }, 1459 "glossaryConfig": { 1460 "$ref": "TranslateTextGlossaryConfig", 1461 "description": "The `glossary_config` used for this translation." 1462 }, 1463 "model": { 1464 "description": "Only present when `model` is present in the request. `model` here is normalized to have project number. For example: If the `model` requested in TranslationTextRequest is `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.", 1465 "type": "string" 1466 }, 1467 "translatedText": { 1468 "description": "Text translated into the target language. If an error occurs during translation, this field might be excluded from the response.", 1469 "type": "string" 1470 } 1471 }, 1472 "type": "object" 1473 }, 1474 "WaitOperationRequest": { 1475 "description": "The request message for Operations.WaitOperation.", 1476 "id": "WaitOperationRequest", 1477 "properties": { 1478 "timeout": { 1479 "description": "The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used.", 1480 "format": "google-duration", 1481 "type": "string" 1482 } 1483 }, 1484 "type": "object" 1485 } 1486 }, 1487 "servicePath": "", 1488 "title": "Cloud Translation API", 1489 "version": "v3beta1", 1490 "version_module": true 1491}