Skip to content

Commit 4801588

Browse files
feat(translate): update the api
#### translate:v3 The following keys were added: - resources.projects.resources.locations.resources.datasets.methods.create (Total Keys: 12) - resources.projects.resources.locations.resources.datasets.methods.delete (Total Keys: 11) - resources.projects.resources.locations.resources.datasets.methods.exportData (Total Keys: 12) - resources.projects.resources.locations.resources.datasets.methods.get (Total Keys: 11) - resources.projects.resources.locations.resources.datasets.methods.importData (Total Keys: 12) - resources.projects.resources.locations.resources.datasets.methods.list (Total Keys: 16) - resources.projects.resources.locations.resources.datasets.resources.examples.methods.list (Total Keys: 18) - resources.projects.resources.locations.resources.models.methods.create (Total Keys: 12) - resources.projects.resources.locations.resources.models.methods.delete (Total Keys: 11) - resources.projects.resources.locations.resources.models.methods.get (Total Keys: 11) - resources.projects.resources.locations.resources.models.methods.list (Total Keys: 18) - schemas.BatchTranslateDocumentRequest.properties.customizedAttribution.type (Total Keys: 1) - schemas.Dataset (Total Keys: 31) - schemas.Example (Total Keys: 8) - schemas.ExportDataRequest (Total Keys: 3) - schemas.GcsInputSource (Total Keys: 3) - schemas.GcsOutputDestination (Total Keys: 3) - schemas.ImportDataRequest (Total Keys: 3) - schemas.InputFile (Total Keys: 4) - schemas.ListDatasetsResponse (Total Keys: 5) - schemas.ListExamplesResponse (Total Keys: 5) - schemas.ListModelsResponse (Total Keys: 5) - schemas.Model (Total Keys: 27) - schemas.TranslateDocumentRequest.properties.enableShadowRemovalNativePdf.type (Total Keys: 1) #### translate:v3beta1 The following keys were added: - schemas.BatchTranslateDocumentRequest.properties.customizedAttribution.type (Total Keys: 1) - schemas.TranslateDocumentRequest.properties.enableShadowRemovalNativePdf.type (Total Keys: 1)
1 parent 9a9bb5a commit 4801588

9 files changed

+1515
-67
lines changed

docs/dyn/translate_v3.projects.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h3>Method Details</h3>
127127
&quot;languages&quot;: [ # The most probable language detected by the Translation API. For each request, the Translation API will always return only one result.
128128
{ # The response message for language detection.
129129
&quot;confidence&quot;: 3.14, # The confidence of the detection result for this language.
130-
&quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code of source content in the request, detected automatically.
130+
&quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code of the source content in the request, detected automatically.
131131
},
132132
],
133133
}</pre>
@@ -152,10 +152,10 @@ <h3>Method Details</h3>
152152
{ # The response message for discovering supported languages.
153153
&quot;languages&quot;: [ # A list of supported language responses. This list contains an entry for each language the Translation API supports.
154154
{ # A single supported language response corresponds to information related to one supported language.
155-
&quot;displayName&quot;: &quot;A String&quot;, # Human readable name of the language localized in the display language specified in the request.
156-
&quot;languageCode&quot;: &quot;A String&quot;, # Supported language code, generally consisting of its ISO 639-1 identifier, for example, &#x27;en&#x27;, &#x27;ja&#x27;. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, &#x27;zh-TW&#x27; and &#x27;zh-CN&#x27;)
157-
&quot;supportSource&quot;: True or False, # Can be used as source language.
158-
&quot;supportTarget&quot;: True or False, # Can be used as target language.
155+
&quot;displayName&quot;: &quot;A String&quot;, # Human-readable name of the language localized in the display language specified in the request.
156+
&quot;languageCode&quot;: &quot;A String&quot;, # Supported language code, generally consisting of its ISO 639-1 identifier, for example, &#x27;en&#x27;, &#x27;ja&#x27;. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, &#x27;zh-TW&#x27; and &#x27;zh-CN&#x27;).
157+
&quot;supportSource&quot;: True or False, # Can be used as a source language.
158+
&quot;supportTarget&quot;: True or False, # Can be used as a target language.
159159
},
160160
],
161161
}</pre>
@@ -171,12 +171,12 @@ <h3>Method Details</h3>
171171
The object takes the form of:
172172

173173
{ # The request message for synchronous translation.
174-
&quot;contents&quot;: [ # 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.
174+
&quot;contents&quot;: [ # Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.
175175
&quot;A String&quot;,
176176
],
177-
&quot;glossaryConfig&quot;: { # Configures which glossary should be 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.
178-
&quot;glossary&quot;: &quot;A String&quot;, # Required. The `glossary` to be applied for this translation. The format depends on glossary: - User provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
179-
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case-insensitive. Default value is false if missing.
177+
&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.
178+
&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}`
179+
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case insensitive. The default value is `false` if missing.
180180
},
181181
&quot;labels&quot;: { # 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.
182182
&quot;a_key&quot;: &quot;A String&quot;,
@@ -199,9 +199,9 @@ <h3>Method Details</h3>
199199
&quot;glossaryTranslations&quot;: [ # 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`.
200200
{ # A single translation response.
201201
&quot;detectedLanguageCode&quot;: &quot;A String&quot;, # 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.
202-
&quot;glossaryConfig&quot;: { # Configures which glossary should be used for a specific target language, and defines options for applying that glossary. # The `glossary_config` used for this translation.
203-
&quot;glossary&quot;: &quot;A String&quot;, # Required. The `glossary` to be applied for this translation. The format depends on glossary: - User provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
204-
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case-insensitive. Default value is false if missing.
202+
&quot;glossaryConfig&quot;: { # Configures which glossary is used for a specific target language and defines options for applying that glossary. # The `glossary_config` used for this translation.
203+
&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}`
204+
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case insensitive. The default value is `false` if missing.
205205
},
206206
&quot;model&quot;: &quot;A String&quot;, # 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`.
207207
&quot;translatedText&quot;: &quot;A String&quot;, # Text translated into the target language. If an error occurs during translation, this field might be excluded from the response.
@@ -210,9 +210,9 @@ <h3>Method Details</h3>
210210
&quot;translations&quot;: [ # Text translation responses with no glossary applied. This field has the same length as `contents`.
211211
{ # A single translation response.
212212
&quot;detectedLanguageCode&quot;: &quot;A String&quot;, # 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.
213-
&quot;glossaryConfig&quot;: { # Configures which glossary should be used for a specific target language, and defines options for applying that glossary. # The `glossary_config` used for this translation.
214-
&quot;glossary&quot;: &quot;A String&quot;, # Required. The `glossary` to be applied for this translation. The format depends on glossary: - User provided custom glossary: `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
215-
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case-insensitive. Default value is false if missing.
213+
&quot;glossaryConfig&quot;: { # Configures which glossary is used for a specific target language and defines options for applying that glossary. # The `glossary_config` used for this translation.
214+
&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}`
215+
&quot;ignoreCase&quot;: True or False, # Optional. Indicates match is case insensitive. The default value is `false` if missing.
216216
},
217217
&quot;model&quot;: &quot;A String&quot;, # 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`.
218218
&quot;translatedText&quot;: &quot;A String&quot;, # Text translated into the target language. If an error occurs during translation, this field might be excluded from the response.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<html><body>
2+
<style>
3+
4+
body, h1, h2, h3, div, span, p, pre, a {
5+
margin: 0;
6+
padding: 0;
7+
border: 0;
8+
font-weight: inherit;
9+
font-style: inherit;
10+
font-size: 100%;
11+
font-family: inherit;
12+
vertical-align: baseline;
13+
}
14+
15+
body {
16+
font-size: 13px;
17+
padding: 1em;
18+
}
19+
20+
h1 {
21+
font-size: 26px;
22+
margin-bottom: 1em;
23+
}
24+
25+
h2 {
26+
font-size: 24px;
27+
margin-bottom: 1em;
28+
}
29+
30+
h3 {
31+
font-size: 20px;
32+
margin-bottom: 1em;
33+
margin-top: 1em;
34+
}
35+
36+
pre, code {
37+
line-height: 1.5;
38+
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39+
}
40+
41+
pre {
42+
margin-top: 0.5em;
43+
}
44+
45+
h1, h2, h3, p {
46+
font-family: Arial, sans serif;
47+
}
48+
49+
h1, h2, h3 {
50+
border-bottom: solid #CCC 1px;
51+
}
52+
53+
.toc_element {
54+
margin-top: 0.5em;
55+
}
56+
57+
.firstline {
58+
margin-left: 2 em;
59+
}
60+
61+
.method {
62+
margin-top: 1em;
63+
border: solid 1px #CCC;
64+
padding: 1em;
65+
background: #EEE;
66+
}
67+
68+
.details {
69+
font-weight: bold;
70+
font-size: 14px;
71+
}
72+
73+
</style>
74+
75+
<h1><a href="translate_v3.html">Cloud Translation API</a> . <a href="translate_v3.projects.html">projects</a> . <a href="translate_v3.projects.locations.html">locations</a> . <a href="translate_v3.projects.locations.datasets.html">datasets</a> . <a href="translate_v3.projects.locations.datasets.examples.html">examples</a></h1>
76+
<h2>Instance Methods</h2>
77+
<p class="toc_element">
78+
<code><a href="#close">close()</a></code></p>
79+
<p class="firstline">Close httplib2 connections.</p>
80+
<p class="toc_element">
81+
<code><a href="#list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
82+
<p class="firstline">Lists sentence pairs in the dataset.</p>
83+
<p class="toc_element">
84+
<code><a href="#list_next">list_next()</a></code></p>
85+
<p class="firstline">Retrieves the next page of results.</p>
86+
<h3>Method Details</h3>
87+
<div class="method">
88+
<code class="details" id="close">close()</code>
89+
<pre>Close httplib2 connections.</pre>
90+
</div>
91+
92+
<div class="method">
93+
<code class="details" id="list">list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
94+
<pre>Lists sentence pairs in the dataset.
95+
96+
Args:
97+
parent: string, Required. Name of the parent dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` (required)
98+
filter: string, Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN`
99+
pageSize: integer, Optional. Requested page size. The server can return fewer results than requested.
100+
pageToken: string, Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListExamples call.
101+
x__xgafv: string, V1 error format.
102+
Allowed values
103+
1 - v1 error format
104+
2 - v2 error format
105+
106+
Returns:
107+
An object of the form:
108+
109+
{ # Response message for ListExamples.
110+
&quot;examples&quot;: [ # The sentence pairs.
111+
{ # A sentence pair.
112+
&quot;name&quot;: &quot;A String&quot;, # Output only. The resource name of the example, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}&#x27;
113+
&quot;sourceText&quot;: &quot;A String&quot;, # Sentence in source language.
114+
&quot;targetText&quot;: &quot;A String&quot;, # Sentence in target language.
115+
&quot;usage&quot;: &quot;A String&quot;, # Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.
116+
},
117+
],
118+
&quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve next page of results. Pass this token to the page_token field in the ListExamplesRequest to obtain the corresponding page.
119+
}</pre>
120+
</div>
121+
122+
<div class="method">
123+
<code class="details" id="list_next">list_next()</code>
124+
<pre>Retrieves the next page of results.
125+
126+
Args:
127+
previous_request: The request for the previous page. (required)
128+
previous_response: The response from the request for the previous page. (required)
129+
130+
Returns:
131+
A request object that you can call &#x27;execute()&#x27; on to request the next
132+
page. Returns None if there are no more items in the collection.
133+
</pre>
134+
</div>
135+
136+
</body></html>

0 commit comments

Comments
 (0)