Skip to content

Commit 3950c50

Browse files
feat(translate): update the api
#### translate:v3 The following keys were added: - resources.projects.methods.romanizeText (Total Keys: 12) - resources.projects.resources.locations.methods.romanizeText (Total Keys: 12) - schemas.Romanization (Total Keys: 4) - schemas.RomanizeTextRequest (Total Keys: 5) - schemas.RomanizeTextResponse (Total Keys: 4) - schemas.TranslateTextRequest.properties.transliterationConfig.$ref (Total Keys: 1) - schemas.TransliterationConfig (Total Keys: 3)
1 parent ac29b4d commit 3950c50

File tree

5 files changed

+208
-8
lines changed

5 files changed

+208
-8
lines changed

docs/dyn/translate_v3.projects.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ <h2>Instance Methods</h2>
8888
<p class="toc_element">
8989
<code><a href="#getSupportedLanguages">getSupportedLanguages(parent, displayLanguageCode=None, model=None, x__xgafv=None)</a></code></p>
9090
<p class="firstline">Returns a list of supported languages for translation.</p>
91+
<p class="toc_element">
92+
<code><a href="#romanizeText">romanizeText(parent, body=None, x__xgafv=None)</a></code></p>
93+
<p class="firstline">Romanize input text written in non-Latin scripts to Latin text.</p>
9194
<p class="toc_element">
9295
<code><a href="#translateText">translateText(parent, body=None, x__xgafv=None)</a></code></p>
9396
<p class="firstline">Translates input text and returns translated text.</p>
@@ -161,6 +164,40 @@ <h3>Method Details</h3>
161164
}</pre>
162165
</div>
163166

167+
<div class="method">
168+
<code class="details" id="romanizeText">romanizeText(parent, body=None, x__xgafv=None)</code>
169+
<pre>Romanize input text written in non-Latin scripts to Latin text.
170+
171+
Args:
172+
parent: string, Required. Project or location to make a call. Must refer to a caller&#x27;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}`. (required)
173+
body: object, The request body.
174+
The object takes the form of:
175+
176+
{ # The request message for synchronous romanization.
177+
&quot;contents&quot;: [ # Required. The content of the input in string format.
178+
&quot;A String&quot;,
179+
],
180+
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;hi&quot; or &quot;zh&quot;. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language for each content in the response.
181+
}
182+
183+
x__xgafv: string, V1 error format.
184+
Allowed values
185+
1 - v1 error format
186+
2 - v2 error format
187+
188+
Returns:
189+
An object of the form:
190+
191+
{ # The response message for synchronous romanization.
192+
&quot;romanizations&quot;: [ # Text romanization responses. This field has the same length as `contents`.
193+
{ # A single romanization response.
194+
&quot;detectedLanguageCode&quot;: &quot;A String&quot;, # The ISO-639 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.
195+
&quot;romanizedText&quot;: &quot;A String&quot;, # Romanized text. If an error occurs during romanization, this field might be excluded from the response.
196+
},
197+
],
198+
}</pre>
199+
</div>
200+
164201
<div class="method">
165202
<code class="details" id="translateText">translateText(parent, body=None, x__xgafv=None)</code>
166203
<pre>Translates input text and returns translated text.
@@ -185,6 +222,9 @@ <h3>Method Details</h3>
185222
&quot;model&quot;: &quot;A String&quot;, # 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
186223
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;en-US&quot; or &quot;sr-Latn&quot;. Supported language codes are listed in Language Support. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language within the response.
187224
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
225+
&quot;transliterationConfig&quot;: { # Confugures transliteration feature on top of translation. # Optional. Transliteration to be applied.
226+
&quot;enableTransliteration&quot;: True or False, # If true, source text in romanized form can be translated to the target language.
227+
},
188228
}
189229

190230
x__xgafv: string, V1 error format.

docs/dyn/translate_v3.projects.locations.html

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ <h2>Instance Methods</h2>
118118
<p class="toc_element">
119119
<code><a href="#list_next">list_next()</a></code></p>
120120
<p class="firstline">Retrieves the next page of results.</p>
121+
<p class="toc_element">
122+
<code><a href="#romanizeText">romanizeText(parent, body=None, x__xgafv=None)</a></code></p>
123+
<p class="firstline">Romanize input text written in non-Latin scripts to Latin text.</p>
121124
<p class="toc_element">
122125
<code><a href="#translateDocument">translateDocument(parent, body=None, x__xgafv=None)</a></code></p>
123126
<p class="firstline">Translates documents in synchronous mode.</p>
@@ -321,7 +324,7 @@ <h3>Method Details</h3>
321324
Returns:
322325
An object of the form:
323326

324-
{ # A resource that represents Google Cloud Platform location.
327+
{ # A resource that represents a Google Cloud location.
325328
&quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;.
326329
&quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;}
327330
&quot;a_key&quot;: &quot;A String&quot;,
@@ -381,7 +384,7 @@ <h3>Method Details</h3>
381384

382385
{ # The response message for Locations.ListLocations.
383386
&quot;locations&quot;: [ # A list of locations that matches the specified filter in the request.
384-
{ # A resource that represents Google Cloud Platform location.
387+
{ # A resource that represents a Google Cloud location.
385388
&quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;.
386389
&quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;}
387390
&quot;a_key&quot;: &quot;A String&quot;,
@@ -411,6 +414,40 @@ <h3>Method Details</h3>
411414
</pre>
412415
</div>
413416

417+
<div class="method">
418+
<code class="details" id="romanizeText">romanizeText(parent, body=None, x__xgafv=None)</code>
419+
<pre>Romanize input text written in non-Latin scripts to Latin text.
420+
421+
Args:
422+
parent: string, Required. Project or location to make a call. Must refer to a caller&#x27;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}`. (required)
423+
body: object, The request body.
424+
The object takes the form of:
425+
426+
{ # The request message for synchronous romanization.
427+
&quot;contents&quot;: [ # Required. The content of the input in string format.
428+
&quot;A String&quot;,
429+
],
430+
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;hi&quot; or &quot;zh&quot;. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language for each content in the response.
431+
}
432+
433+
x__xgafv: string, V1 error format.
434+
Allowed values
435+
1 - v1 error format
436+
2 - v2 error format
437+
438+
Returns:
439+
An object of the form:
440+
441+
{ # The response message for synchronous romanization.
442+
&quot;romanizations&quot;: [ # Text romanization responses. This field has the same length as `contents`.
443+
{ # A single romanization response.
444+
&quot;detectedLanguageCode&quot;: &quot;A String&quot;, # The ISO-639 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.
445+
&quot;romanizedText&quot;: &quot;A String&quot;, # Romanized text. If an error occurs during romanization, this field might be excluded from the response.
446+
},
447+
],
448+
}</pre>
449+
</div>
450+
414451
<div class="method">
415452
<code class="details" id="translateDocument">translateDocument(parent, body=None, x__xgafv=None)</code>
416453
<pre>Translates documents in synchronous mode.
@@ -505,6 +542,9 @@ <h3>Method Details</h3>
505542
&quot;model&quot;: &quot;A String&quot;, # 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
506543
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Optional. The ISO-639 language code of the input text if known, for example, &quot;en-US&quot; or &quot;sr-Latn&quot;. Supported language codes are listed in Language Support. If the source language isn&#x27;t specified, the API attempts to identify the source language automatically and returns the source language within the response.
507544
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
545+
&quot;transliterationConfig&quot;: { # Confugures transliteration feature on top of translation. # Optional. Transliteration to be applied.
546+
&quot;enableTransliteration&quot;: True or False, # If true, source text in romanized form can be translated to the target language.
547+
},
508548
}
509549

510550
x__xgafv: string, V1 error format.

docs/dyn/translate_v3beta1.projects.locations.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ <h3>Method Details</h3>
311311
Returns:
312312
An object of the form:
313313

314-
{ # A resource that represents Google Cloud Platform location.
314+
{ # A resource that represents a Google Cloud location.
315315
&quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;.
316316
&quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;}
317317
&quot;a_key&quot;: &quot;A String&quot;,
@@ -371,7 +371,7 @@ <h3>Method Details</h3>
371371

372372
{ # The response message for Locations.ListLocations.
373373
&quot;locations&quot;: [ # A list of locations that matches the specified filter in the request.
374-
{ # A resource that represents Google Cloud Platform location.
374+
{ # A resource that represents a Google Cloud location.
375375
&quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;.
376376
&quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;}
377377
&quot;a_key&quot;: &quot;A String&quot;,

googleapiclient/discovery_cache/documents/translate.v3.json

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,35 @@
175175
"https://www.googleapis.com/auth/cloud-translation"
176176
]
177177
},
178+
"romanizeText": {
179+
"description": "Romanize input text written in non-Latin scripts to Latin text.",
180+
"flatPath": "v3/projects/{projectsId}:romanizeText",
181+
"httpMethod": "POST",
182+
"id": "translate.projects.romanizeText",
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}/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}`.",
189+
"location": "path",
190+
"pattern": "^projects/[^/]+$",
191+
"required": true,
192+
"type": "string"
193+
}
194+
},
195+
"path": "v3/{+parent}:romanizeText",
196+
"request": {
197+
"$ref": "RomanizeTextRequest"
198+
},
199+
"response": {
200+
"$ref": "RomanizeTextResponse"
201+
},
202+
"scopes": [
203+
"https://www.googleapis.com/auth/cloud-platform",
204+
"https://www.googleapis.com/auth/cloud-translation"
205+
]
206+
},
178207
"translateText": {
179208
"description": "Translates input text and returns translated text.",
180209
"flatPath": "v3/projects/{projectsId}:translateText",
@@ -397,6 +426,35 @@
397426
"https://www.googleapis.com/auth/cloud-translation"
398427
]
399428
},
429+
"romanizeText": {
430+
"description": "Romanize input text written in non-Latin scripts to Latin text.",
431+
"flatPath": "v3/projects/{projectsId}/locations/{locationsId}:romanizeText",
432+
"httpMethod": "POST",
433+
"id": "translate.projects.locations.romanizeText",
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}/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}`.",
440+
"location": "path",
441+
"pattern": "^projects/[^/]+/locations/[^/]+$",
442+
"required": true,
443+
"type": "string"
444+
}
445+
},
446+
"path": "v3/{+parent}:romanizeText",
447+
"request": {
448+
"$ref": "RomanizeTextRequest"
449+
},
450+
"response": {
451+
"$ref": "RomanizeTextResponse"
452+
},
453+
"scopes": [
454+
"https://www.googleapis.com/auth/cloud-platform",
455+
"https://www.googleapis.com/auth/cloud-translation"
456+
]
457+
},
400458
"translateDocument": {
401459
"description": "Translates documents in synchronous mode.",
402460
"flatPath": "v3/projects/{projectsId}/locations/{locationsId}:translateDocument",
@@ -1286,7 +1344,7 @@
12861344
}
12871345
}
12881346
},
1289-
"revision": "20230414",
1347+
"revision": "20230519",
12901348
"rootUrl": "https://translation.googleapis.com/",
12911349
"schemas": {
12921350
"BatchDocumentInputConfig": {
@@ -2029,7 +2087,7 @@
20292087
"type": "object"
20302088
},
20312089
"Location": {
2032-
"description": "A resource that represents Google Cloud Platform location.",
2090+
"description": "A resource that represents a Google Cloud location.",
20332091
"id": "Location",
20342092
"properties": {
20352093
"displayName": {
@@ -2167,6 +2225,53 @@
21672225
},
21682226
"type": "object"
21692227
},
2228+
"Romanization": {
2229+
"description": "A single romanization response.",
2230+
"id": "Romanization",
2231+
"properties": {
2232+
"detectedLanguageCode": {
2233+
"description": "The ISO-639 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.",
2234+
"type": "string"
2235+
},
2236+
"romanizedText": {
2237+
"description": "Romanized text. If an error occurs during romanization, this field might be excluded from the response.",
2238+
"type": "string"
2239+
}
2240+
},
2241+
"type": "object"
2242+
},
2243+
"RomanizeTextRequest": {
2244+
"description": "The request message for synchronous romanization.",
2245+
"id": "RomanizeTextRequest",
2246+
"properties": {
2247+
"contents": {
2248+
"description": "Required. The content of the input in string format.",
2249+
"items": {
2250+
"type": "string"
2251+
},
2252+
"type": "array"
2253+
},
2254+
"sourceLanguageCode": {
2255+
"description": "Optional. The ISO-639 language code of the input text if known, for example, \"hi\" or \"zh\". If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language for each content in the response.",
2256+
"type": "string"
2257+
}
2258+
},
2259+
"type": "object"
2260+
},
2261+
"RomanizeTextResponse": {
2262+
"description": "The response message for synchronous romanization.",
2263+
"id": "RomanizeTextResponse",
2264+
"properties": {
2265+
"romanizations": {
2266+
"description": "Text romanization responses. This field has the same length as `contents`.",
2267+
"items": {
2268+
"$ref": "Romanization"
2269+
},
2270+
"type": "array"
2271+
}
2272+
},
2273+
"type": "object"
2274+
},
21702275
"Status": {
21712276
"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).",
21722277
"id": "Status",
@@ -2360,6 +2465,10 @@
23602465
"targetLanguageCode": {
23612466
"description": "Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.",
23622467
"type": "string"
2468+
},
2469+
"transliterationConfig": {
2470+
"$ref": "TransliterationConfig",
2471+
"description": "Optional. Transliteration to be applied."
23632472
}
23642473
},
23652474
"type": "object"
@@ -2407,6 +2516,17 @@
24072516
},
24082517
"type": "object"
24092518
},
2519+
"TransliterationConfig": {
2520+
"description": "Confugures transliteration feature on top of translation.",
2521+
"id": "TransliterationConfig",
2522+
"properties": {
2523+
"enableTransliteration": {
2524+
"description": "If true, source text in romanized form can be translated to the target language.",
2525+
"type": "boolean"
2526+
}
2527+
},
2528+
"type": "object"
2529+
},
24102530
"WaitOperationRequest": {
24112531
"description": "The request message for Operations.WaitOperation.",
24122532
"id": "WaitOperationRequest",

googleapiclient/discovery_cache/documents/translate.v3beta1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@
744744
}
745745
}
746746
},
747-
"revision": "20230414",
747+
"revision": "20230519",
748748
"rootUrl": "https://translation.googleapis.com/",
749749
"schemas": {
750750
"BatchDocumentInputConfig": {
@@ -1176,7 +1176,7 @@
11761176
"type": "object"
11771177
},
11781178
"Location": {
1179-
"description": "A resource that represents Google Cloud Platform location.",
1179+
"description": "A resource that represents a Google Cloud location.",
11801180
"id": "Location",
11811181
"properties": {
11821182
"displayName": {

0 commit comments

Comments
 (0)