Skip to content

Commit

Permalink
feat(translate): update the api
Browse files Browse the repository at this point in the history
#### 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)
  • Loading branch information
yoshi-automation committed May 24, 2023
1 parent ac29b4d commit 3950c50
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 8 deletions.
40 changes: 40 additions & 0 deletions docs/dyn/translate_v3.projects.html
Expand Up @@ -88,6 +88,9 @@ <h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#getSupportedLanguages">getSupportedLanguages(parent, displayLanguageCode=None, model=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns a list of supported languages for translation.</p>
<p class="toc_element">
<code><a href="#romanizeText">romanizeText(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Romanize input text written in non-Latin scripts to Latin text.</p>
<p class="toc_element">
<code><a href="#translateText">translateText(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Translates input text and returns translated text.</p>
Expand Down Expand Up @@ -161,6 +164,40 @@ <h3>Method Details</h3>
}</pre>
</div>

<div class="method">
<code class="details" id="romanizeText">romanizeText(parent, body=None, x__xgafv=None)</code>
<pre>Romanize input text written in non-Latin scripts to Latin text.

Args:
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)
body: object, The request body.
The object takes the form of:

{ # The request message for synchronous romanization.
&quot;contents&quot;: [ # Required. The content of the input in string format.
&quot;A String&quot;,
],
&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.
}

x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format

Returns:
An object of the form:

{ # The response message for synchronous romanization.
&quot;romanizations&quot;: [ # Text romanization responses. This field has the same length as `contents`.
{ # A single romanization response.
&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.
&quot;romanizedText&quot;: &quot;A String&quot;, # Romanized text. If an error occurs during romanization, this field might be excluded from the response.
},
],
}</pre>
</div>

<div class="method">
<code class="details" id="translateText">translateText(parent, body=None, x__xgafv=None)</code>
<pre>Translates input text and returns translated text.
Expand All @@ -185,6 +222,9 @@ <h3>Method Details</h3>
&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
&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.
&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.
&quot;transliterationConfig&quot;: { # Confugures transliteration feature on top of translation. # Optional. Transliteration to be applied.
&quot;enableTransliteration&quot;: True or False, # If true, source text in romanized form can be translated to the target language.
},
}

x__xgafv: string, V1 error format.
Expand Down
44 changes: 42 additions & 2 deletions docs/dyn/translate_v3.projects.locations.html
Expand Up @@ -118,6 +118,9 @@ <h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
<code><a href="#romanizeText">romanizeText(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Romanize input text written in non-Latin scripts to Latin text.</p>
<p class="toc_element">
<code><a href="#translateDocument">translateDocument(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Translates documents in synchronous mode.</p>
Expand Down Expand Up @@ -321,7 +324,7 @@ <h3>Method Details</h3>
Returns:
An object of the form:

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

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

<div class="method">
<code class="details" id="romanizeText">romanizeText(parent, body=None, x__xgafv=None)</code>
<pre>Romanize input text written in non-Latin scripts to Latin text.

Args:
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)
body: object, The request body.
The object takes the form of:

{ # The request message for synchronous romanization.
&quot;contents&quot;: [ # Required. The content of the input in string format.
&quot;A String&quot;,
],
&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.
}

x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format

Returns:
An object of the form:

{ # The response message for synchronous romanization.
&quot;romanizations&quot;: [ # Text romanization responses. This field has the same length as `contents`.
{ # A single romanization response.
&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.
&quot;romanizedText&quot;: &quot;A String&quot;, # Romanized text. If an error occurs during romanization, this field might be excluded from the response.
},
],
}</pre>
</div>

<div class="method">
<code class="details" id="translateDocument">translateDocument(parent, body=None, x__xgafv=None)</code>
<pre>Translates documents in synchronous mode.
Expand Down Expand Up @@ -505,6 +542,9 @@ <h3>Method Details</h3>
&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
&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.
&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.
&quot;transliterationConfig&quot;: { # Confugures transliteration feature on top of translation. # Optional. Transliteration to be applied.
&quot;enableTransliteration&quot;: True or False, # If true, source text in romanized form can be translated to the target language.
},
}

x__xgafv: string, V1 error format.
Expand Down
4 changes: 2 additions & 2 deletions docs/dyn/translate_v3beta1.projects.locations.html
Expand Up @@ -311,7 +311,7 @@ <h3>Method Details</h3>
Returns:
An object of the form:

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

{ # The response message for Locations.ListLocations.
&quot;locations&quot;: [ # A list of locations that matches the specified filter in the request.
{ # A resource that represents Google Cloud Platform location.
{ # A resource that represents a Google Cloud location.
&quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;.
&quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;}
&quot;a_key&quot;: &quot;A String&quot;,
Expand Down
124 changes: 122 additions & 2 deletions googleapiclient/discovery_cache/documents/translate.v3.json
Expand Up @@ -175,6 +175,35 @@
"https://www.googleapis.com/auth/cloud-translation"
]
},
"romanizeText": {
"description": "Romanize input text written in non-Latin scripts to Latin text.",
"flatPath": "v3/projects/{projectsId}:romanizeText",
"httpMethod": "POST",
"id": "translate.projects.romanizeText",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"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}`.",
"location": "path",
"pattern": "^projects/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v3/{+parent}:romanizeText",
"request": {
"$ref": "RomanizeTextRequest"
},
"response": {
"$ref": "RomanizeTextResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-translation"
]
},
"translateText": {
"description": "Translates input text and returns translated text.",
"flatPath": "v3/projects/{projectsId}:translateText",
Expand Down Expand Up @@ -397,6 +426,35 @@
"https://www.googleapis.com/auth/cloud-translation"
]
},
"romanizeText": {
"description": "Romanize input text written in non-Latin scripts to Latin text.",
"flatPath": "v3/projects/{projectsId}/locations/{locationsId}:romanizeText",
"httpMethod": "POST",
"id": "translate.projects.locations.romanizeText",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"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}`.",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v3/{+parent}:romanizeText",
"request": {
"$ref": "RomanizeTextRequest"
},
"response": {
"$ref": "RomanizeTextResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-translation"
]
},
"translateDocument": {
"description": "Translates documents in synchronous mode.",
"flatPath": "v3/projects/{projectsId}/locations/{locationsId}:translateDocument",
Expand Down Expand Up @@ -1286,7 +1344,7 @@
}
}
},
"revision": "20230414",
"revision": "20230519",
"rootUrl": "https://translation.googleapis.com/",
"schemas": {
"BatchDocumentInputConfig": {
Expand Down Expand Up @@ -2029,7 +2087,7 @@
"type": "object"
},
"Location": {
"description": "A resource that represents Google Cloud Platform location.",
"description": "A resource that represents a Google Cloud location.",
"id": "Location",
"properties": {
"displayName": {
Expand Down Expand Up @@ -2167,6 +2225,53 @@
},
"type": "object"
},
"Romanization": {
"description": "A single romanization response.",
"id": "Romanization",
"properties": {
"detectedLanguageCode": {
"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.",
"type": "string"
},
"romanizedText": {
"description": "Romanized text. If an error occurs during romanization, this field might be excluded from the response.",
"type": "string"
}
},
"type": "object"
},
"RomanizeTextRequest": {
"description": "The request message for synchronous romanization.",
"id": "RomanizeTextRequest",
"properties": {
"contents": {
"description": "Required. The content of the input in string format.",
"items": {
"type": "string"
},
"type": "array"
},
"sourceLanguageCode": {
"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.",
"type": "string"
}
},
"type": "object"
},
"RomanizeTextResponse": {
"description": "The response message for synchronous romanization.",
"id": "RomanizeTextResponse",
"properties": {
"romanizations": {
"description": "Text romanization responses. This field has the same length as `contents`.",
"items": {
"$ref": "Romanization"
},
"type": "array"
}
},
"type": "object"
},
"Status": {
"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).",
"id": "Status",
Expand Down Expand Up @@ -2360,6 +2465,10 @@
"targetLanguageCode": {
"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.",
"type": "string"
},
"transliterationConfig": {
"$ref": "TransliterationConfig",
"description": "Optional. Transliteration to be applied."
}
},
"type": "object"
Expand Down Expand Up @@ -2407,6 +2516,17 @@
},
"type": "object"
},
"TransliterationConfig": {
"description": "Confugures transliteration feature on top of translation.",
"id": "TransliterationConfig",
"properties": {
"enableTransliteration": {
"description": "If true, source text in romanized form can be translated to the target language.",
"type": "boolean"
}
},
"type": "object"
},
"WaitOperationRequest": {
"description": "The request message for Operations.WaitOperation.",
"id": "WaitOperationRequest",
Expand Down
Expand Up @@ -744,7 +744,7 @@
}
}
},
"revision": "20230414",
"revision": "20230519",
"rootUrl": "https://translation.googleapis.com/",
"schemas": {
"BatchDocumentInputConfig": {
Expand Down Expand Up @@ -1176,7 +1176,7 @@
"type": "object"
},
"Location": {
"description": "A resource that represents Google Cloud Platform location.",
"description": "A resource that represents a Google Cloud location.",
"id": "Location",
"properties": {
"displayName": {
Expand Down

0 comments on commit 3950c50

Please sign in to comment.