Skip to content

Commit 8fa1081

Browse files
feat(translate): update the api
#### translate:v3 The following keys were added: - schemas.AdaptiveMtTranslateRequest.properties.glossaryConfig.$ref (Total Keys: 1) - schemas.AdaptiveMtTranslateRequest.properties.referenceSentenceConfig.$ref (Total Keys: 1) - schemas.AdaptiveMtTranslateResponse.properties.glossaryTranslations (Total Keys: 2) - schemas.ReferenceSentenceConfig (Total Keys: 6) - schemas.ReferenceSentencePair (Total Keys: 8) The following keys were changed: - resources.projects.resources.locations.resources.glossaries.methods.patch.scopes (Total Keys: 1)
1 parent ba212b8 commit 8fa1081

File tree

4 files changed

+106
-16
lines changed

4 files changed

+106
-16
lines changed

docs/dyn/translate_v3.projects.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ <h3>Method Details</h3>
219219
&quot;a_key&quot;: &quot;A String&quot;,
220220
},
221221
&quot;mimeType&quot;: &quot;A String&quot;, # Optional. The format of the source text, for example, &quot;text/html&quot;, &quot;text/plain&quot;. If left blank, the MIME type defaults to &quot;text/html&quot;.
222-
&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
222+
&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`, - Translation LLM models: `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, 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
223223
&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.
224224
&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.
225225
&quot;transliterationConfig&quot;: { # Configures transliteration feature on top of translation. # Optional. Transliteration to be applied.

docs/dyn/translate_v3.projects.locations.glossaries.glossaryEntries.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ <h3>Method Details</h3>
112112

113113
{ # Represents a single entry in a glossary.
114114
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
115-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
115+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
116116
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
117117
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
118118
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
@@ -143,7 +143,7 @@ <h3>Method Details</h3>
143143

144144
{ # Represents a single entry in a glossary.
145145
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
146-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
146+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
147147
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
148148
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
149149
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
@@ -199,7 +199,7 @@ <h3>Method Details</h3>
199199

200200
{ # Represents a single entry in a glossary.
201201
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
202-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
202+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
203203
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
204204
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
205205
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
@@ -241,7 +241,7 @@ <h3>Method Details</h3>
241241
&quot;glossaryEntries&quot;: [ # Optional. The Glossary Entries
242242
{ # Represents a single entry in a glossary.
243243
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
244-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
244+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
245245
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
246246
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
247247
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
@@ -285,13 +285,13 @@ <h3>Method Details</h3>
285285
<pre>Updates a glossary entry.
286286

287287
Args:
288-
name: string, Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot; (required)
288+
name: string, Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot; (required)
289289
body: object, The request body.
290290
The object takes the form of:
291291

292292
{ # Represents a single entry in a glossary.
293293
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
294-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
294+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
295295
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
296296
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
297297
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.
@@ -322,7 +322,7 @@ <h3>Method Details</h3>
322322

323323
{ # Represents a single entry in a glossary.
324324
&quot;description&quot;: &quot;A String&quot;, # Describes the glossary entry.
325-
&quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
325+
&quot;name&quot;: &quot;A String&quot;, # Identifier. The resource name of the entry. Format: &quot;projects/*/locations/*/glossaries/*/glossaryEntries/*&quot;
326326
&quot;termsPair&quot;: { # Represents a single entry for an unidirectional glossary. # Used for an unidirectional glossary.
327327
&quot;sourceTerm&quot;: { # Represents a single glossary term # The source term is the term that will get match in the text,
328328
&quot;languageCode&quot;: &quot;A String&quot;, # The language for this glossary term.

docs/dyn/translate_v3.projects.locations.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,28 @@ <h3>Method Details</h3>
146146
The object takes the form of:
147147

148148
{ # The request for sending an AdaptiveMt translation query.
149-
&quot;content&quot;: [ # Required. The content of the input in string format. For now only one sentence per request is supported.
149+
&quot;content&quot;: [ # Required. The content of the input in string format.
150150
&quot;A String&quot;,
151151
],
152152
&quot;dataset&quot;: &quot;A String&quot;, # Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
153+
&quot;glossaryConfig&quot;: { # Configures which glossary is used for a specific target language and defines options for applying that glossary. # 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.
154+
&quot;glossary&quot;: &quot;A String&quot;, # Required. The `glossary` to be applied for this translation. The format depends on the glossary: - User-provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
155+
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case insensitive. The default value is `false` if missing.
156+
},
157+
&quot;referenceSentenceConfig&quot;: { # Message of caller-provided reference configuration. # Configuration for caller provided reference sentences.
158+
&quot;referenceSentencePairLists&quot;: [ # Reference sentences pair lists. Each list will be used as the references to translate the sentence under &quot;content&quot; field at the corresponding index. Length of the list is required to be equal to the length of &quot;content&quot; field.
159+
{ # A list of reference sentence pairs.
160+
&quot;referenceSentencePairs&quot;: [ # Reference sentence pairs.
161+
{ # A pair of sentences used as reference in source and target languages.
162+
&quot;sourceSentence&quot;: &quot;A String&quot;, # Source sentence in the sentence pair.
163+
&quot;targetSentence&quot;: &quot;A String&quot;, # Target sentence in the sentence pair.
164+
},
165+
],
166+
},
167+
],
168+
&quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Source language code.
169+
&quot;targetLanguageCode&quot;: &quot;A String&quot;, # Target language code.
170+
},
153171
}
154172

155173
x__xgafv: string, V1 error format.
@@ -161,6 +179,11 @@ <h3>Method Details</h3>
161179
An object of the form:
162180

163181
{ # An AdaptiveMtTranslate response.
182+
&quot;glossaryTranslations&quot;: [ # Text translation response if a glossary is provided in the request. This could be the same as &#x27;translation&#x27; above if no terms apply.
183+
{ # An AdaptiveMt translation.
184+
&quot;translatedText&quot;: &quot;A String&quot;, # Output only. The translated text.
185+
},
186+
],
164187
&quot;languageCode&quot;: &quot;A String&quot;, # Output only. The translation&#x27;s language code.
165188
&quot;translations&quot;: [ # Output only. The translation.
166189
{ # An AdaptiveMt translation.
@@ -582,7 +605,7 @@ <h3>Method Details</h3>
582605
&quot;a_key&quot;: &quot;A String&quot;,
583606
},
584607
&quot;mimeType&quot;: &quot;A String&quot;, # Optional. The format of the source text, for example, &quot;text/html&quot;, &quot;text/plain&quot;. If left blank, the MIME type defaults to &quot;text/html&quot;.
585-
&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
608+
&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`, - Translation LLM models: `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, 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
586609
&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.
587610
&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.
588611
&quot;transliterationConfig&quot;: { # Configures transliteration feature on top of translation. # Optional. Transliteration to be applied.

googleapiclient/discovery_cache/documents/translate.v3.json

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,8 @@
12601260
"$ref": "Operation"
12611261
},
12621262
"scopes": [
1263-
"https://www.googleapis.com/auth/cloud-platform"
1263+
"https://www.googleapis.com/auth/cloud-platform",
1264+
"https://www.googleapis.com/auth/cloud-translation"
12641265
]
12651266
}
12661267
},
@@ -1395,7 +1396,7 @@
13951396
],
13961397
"parameters": {
13971398
"name": {
1398-
"description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
1399+
"description": "Identifier. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
13991400
"location": "path",
14001401
"pattern": "^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+$",
14011402
"required": true,
@@ -1706,7 +1707,7 @@
17061707
}
17071708
}
17081709
},
1709-
"revision": "20240301",
1710+
"revision": "20240718",
17101711
"rootUrl": "https://translation.googleapis.com/",
17111712
"schemas": {
17121713
"AdaptiveMtDataset": {
@@ -1817,7 +1818,7 @@
18171818
"id": "AdaptiveMtTranslateRequest",
18181819
"properties": {
18191820
"content": {
1820-
"description": "Required. The content of the input in string format. For now only one sentence per request is supported.",
1821+
"description": "Required. The content of the input in string format.",
18211822
"items": {
18221823
"type": "string"
18231824
},
@@ -1826,6 +1827,14 @@
18261827
"dataset": {
18271828
"description": "Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`",
18281829
"type": "string"
1830+
},
1831+
"glossaryConfig": {
1832+
"$ref": "TranslateTextGlossaryConfig",
1833+
"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."
1834+
},
1835+
"referenceSentenceConfig": {
1836+
"$ref": "ReferenceSentenceConfig",
1837+
"description": "Configuration for caller provided reference sentences."
18291838
}
18301839
},
18311840
"type": "object"
@@ -1834,6 +1843,13 @@
18341843
"description": "An AdaptiveMtTranslate response.",
18351844
"id": "AdaptiveMtTranslateResponse",
18361845
"properties": {
1846+
"glossaryTranslations": {
1847+
"description": "Text translation response if a glossary is provided in the request. This could be the same as 'translation' above if no terms apply.",
1848+
"items": {
1849+
"$ref": "AdaptiveMtTranslation"
1850+
},
1851+
"type": "array"
1852+
},
18371853
"languageCode": {
18381854
"description": "Output only. The translation's language code.",
18391855
"readOnly": true,
@@ -2360,7 +2376,7 @@
23602376
"type": "string"
23612377
},
23622378
"name": {
2363-
"description": "Required. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
2379+
"description": "Identifier. The resource name of the entry. Format: \"projects/*/locations/*/glossaries/*/glossaryEntries/*\"",
23642380
"type": "string"
23652381
},
23662382
"termsPair": {
@@ -2848,6 +2864,57 @@
28482864
},
28492865
"type": "object"
28502866
},
2867+
"ReferenceSentenceConfig": {
2868+
"description": "Message of caller-provided reference configuration.",
2869+
"id": "ReferenceSentenceConfig",
2870+
"properties": {
2871+
"referenceSentencePairLists": {
2872+
"description": "Reference sentences pair lists. Each list will be used as the references to translate the sentence under \"content\" field at the corresponding index. Length of the list is required to be equal to the length of \"content\" field.",
2873+
"items": {
2874+
"$ref": "ReferenceSentencePairList"
2875+
},
2876+
"type": "array"
2877+
},
2878+
"sourceLanguageCode": {
2879+
"description": "Source language code.",
2880+
"type": "string"
2881+
},
2882+
"targetLanguageCode": {
2883+
"description": "Target language code.",
2884+
"type": "string"
2885+
}
2886+
},
2887+
"type": "object"
2888+
},
2889+
"ReferenceSentencePair": {
2890+
"description": "A pair of sentences used as reference in source and target languages.",
2891+
"id": "ReferenceSentencePair",
2892+
"properties": {
2893+
"sourceSentence": {
2894+
"description": "Source sentence in the sentence pair.",
2895+
"type": "string"
2896+
},
2897+
"targetSentence": {
2898+
"description": "Target sentence in the sentence pair.",
2899+
"type": "string"
2900+
}
2901+
},
2902+
"type": "object"
2903+
},
2904+
"ReferenceSentencePairList": {
2905+
"description": "A list of reference sentence pairs.",
2906+
"id": "ReferenceSentencePairList",
2907+
"properties": {
2908+
"referenceSentencePairs": {
2909+
"description": "Reference sentence pairs.",
2910+
"items": {
2911+
"$ref": "ReferenceSentencePair"
2912+
},
2913+
"type": "array"
2914+
}
2915+
},
2916+
"type": "object"
2917+
},
28512918
"Romanization": {
28522919
"description": "A single romanization response.",
28532920
"id": "Romanization",
@@ -3078,7 +3145,7 @@
30783145
"type": "string"
30793146
},
30803147
"model": {
3081-
"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",
3148+
"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`, - Translation LLM models: `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, 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",
30823149
"type": "string"
30833150
},
30843151
"sourceLanguageCode": {

0 commit comments

Comments
 (0)