blob: 093092cf4b2d1d01b331e6699fd9df85f56b48a5 [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, 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.glossaries.html">glossaries</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Creates a glossary and returns the long-running operation. Returns</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a glossary, or cancels glossary construction</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
85<p class="firstline">Gets a glossary. Returns NOT_FOUND, if the glossary doesn't</p>
86<p class="toc_element">
87 <code><a href="#list">list(parent, pageToken=None, pageSize=None, filter=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
95 <pre>Creates a glossary and returns the long-running operation. Returns
96NOT_FOUND, if the project doesn&#x27;t exist.
97
98Args:
99 parent: string, Required. The project name. (required)
100 body: object, The request body.
101 The object takes the form of:
102
103{ # Represents a glossary built from user provided data.
104 &quot;entryCount&quot;: 42, # Output only. The number of entries defined in the glossary.
105 &quot;inputConfig&quot;: { # Input configuration for glossaries. # Required. Provides examples to build the glossary from.
106 # Total glossary must not exceed 10M Unicode codepoints.
107 &quot;gcsSource&quot;: { # The Google Cloud Storage location for the input content. # Required. Google Cloud Storage location of glossary data.
108 # File format is determined based on the filename extension. API returns
109 # [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file
110 # formats. Wildcards are not allowed. This must be a single file in one of
111 # the following formats:
112 #
113 # For unidirectional glossaries:
114 #
115 # - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated.
116 # The first column is source text. The second column is target text.
117 # The file must not contain headers. That is, the first row is data, not
118 # column names.
119 #
120 # - TMX (`.tmx`): TMX file with parallel data defining source/target term
121 # pairs.
122 #
123 # For equivalent term sets glossaries:
124 #
125 # - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms
126 # in multiple languages. The format is defined for Google Translation
127 # Toolkit and documented in [Use a
128 # glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en).
129 &quot;inputUri&quot;: &quot;A String&quot;, # Required. Source data URI. For example, `gs://my_bucket/my_object`.
130 },
131 },
132 &quot;submitTime&quot;: &quot;A String&quot;, # Output only. When CreateGlossary was called.
133 &quot;languagePair&quot;: { # Used with unidirectional glossaries. # Used with unidirectional glossaries.
134 &quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code for translation output, for example,
135 # &quot;zh-CN&quot;. Expected to be an exact match for GlossaryTerm.language_code.
136 &quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code of the input text, for example,
137 # &quot;en-US&quot;. Expected to be an exact match for GlossaryTerm.language_code.
138 },
139 &quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the glossary. Glossary names have the form
140 # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
141 &quot;languageCodesSet&quot;: { # Used with equivalent term set glossaries. # Used with equivalent term set glossaries.
142 &quot;languageCodes&quot;: [ # The BCP-47 language code(s) for terms defined in the glossary.
143 # All entries are unique. The list contains at least two entries.
144 # Expected to be an exact match for GlossaryTerm.language_code.
145 &quot;A String&quot;,
146 ],
147 },
148 &quot;endTime&quot;: &quot;A String&quot;, # Output only. When the glossary creation was finished.
149 }
150
151 x__xgafv: string, V1 error format.
152 Allowed values
153 1 - v1 error format
154 2 - v2 error format
155
156Returns:
157 An object of the form:
158
159 { # This resource represents a long-running operation that is the result of a
160 # network API call.
161 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
162 # If `true`, the operation is completed, and either `error` or `response` is
163 # available.
164 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
165 # method returns no data on success, such as `Delete`, the response is
166 # `google.protobuf.Empty`. If the original method is standard
167 # `Get`/`Create`/`Update`, the response should be the resource. For other
168 # methods, the response should have the type `XxxResponse`, where `Xxx`
169 # is the original method name. For example, if the original method name
170 # is `TakeSnapshot()`, the inferred response type is
171 # `TakeSnapshotResponse`.
172 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
173 },
174 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
175 # originally returns it. If you use the default HTTP mapping, the
176 # `name` should be a resource name ending with `operations/{unique_id}`.
177 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
178 # different programming environments, including REST APIs and RPC APIs. It is
179 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
180 # three pieces of data: error code, error message, and error details.
181 #
182 # You can find out more about this error model and how to work with it in the
183 # [API Design Guide](https://cloud.google.com/apis/design/errors).
184 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
185 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
186 # user-facing error message should be localized and sent in the
187 # google.rpc.Status.details field, or localized by the client.
188 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
189 # message types for APIs to use.
190 {
191 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
192 },
193 ],
194 },
195 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
196 # contains progress information and common metadata such as create time.
197 # Some services might not provide such metadata. Any method that returns a
198 # long-running operation should document the metadata type, if any.
199 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
200 },
201 }</pre>
202</div>
203
204<div class="method">
205 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
206 <pre>Deletes a glossary, or cancels glossary construction
207if the glossary isn&#x27;t created yet.
208Returns NOT_FOUND, if the glossary doesn&#x27;t exist.
209
210Args:
211 name: string, Required. The name of the glossary to delete. (required)
212 x__xgafv: string, V1 error format.
213 Allowed values
214 1 - v1 error format
215 2 - v2 error format
216
217Returns:
218 An object of the form:
219
220 { # This resource represents a long-running operation that is the result of a
221 # network API call.
222 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
223 # If `true`, the operation is completed, and either `error` or `response` is
224 # available.
225 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
226 # method returns no data on success, such as `Delete`, the response is
227 # `google.protobuf.Empty`. If the original method is standard
228 # `Get`/`Create`/`Update`, the response should be the resource. For other
229 # methods, the response should have the type `XxxResponse`, where `Xxx`
230 # is the original method name. For example, if the original method name
231 # is `TakeSnapshot()`, the inferred response type is
232 # `TakeSnapshotResponse`.
233 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
234 },
235 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
236 # originally returns it. If you use the default HTTP mapping, the
237 # `name` should be a resource name ending with `operations/{unique_id}`.
238 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
239 # different programming environments, including REST APIs and RPC APIs. It is
240 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
241 # three pieces of data: error code, error message, and error details.
242 #
243 # You can find out more about this error model and how to work with it in the
244 # [API Design Guide](https://cloud.google.com/apis/design/errors).
245 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
246 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
247 # user-facing error message should be localized and sent in the
248 # google.rpc.Status.details field, or localized by the client.
249 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
250 # message types for APIs to use.
251 {
252 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
253 },
254 ],
255 },
256 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
257 # contains progress information and common metadata such as create time.
258 # Some services might not provide such metadata. Any method that returns a
259 # long-running operation should document the metadata type, if any.
260 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
261 },
262 }</pre>
263</div>
264
265<div class="method">
266 <code class="details" id="get">get(name, x__xgafv=None)</code>
267 <pre>Gets a glossary. Returns NOT_FOUND, if the glossary doesn&#x27;t
268exist.
269
270Args:
271 name: string, Required. The name of the glossary to retrieve. (required)
272 x__xgafv: string, V1 error format.
273 Allowed values
274 1 - v1 error format
275 2 - v2 error format
276
277Returns:
278 An object of the form:
279
280 { # Represents a glossary built from user provided data.
281 &quot;entryCount&quot;: 42, # Output only. The number of entries defined in the glossary.
282 &quot;inputConfig&quot;: { # Input configuration for glossaries. # Required. Provides examples to build the glossary from.
283 # Total glossary must not exceed 10M Unicode codepoints.
284 &quot;gcsSource&quot;: { # The Google Cloud Storage location for the input content. # Required. Google Cloud Storage location of glossary data.
285 # File format is determined based on the filename extension. API returns
286 # [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file
287 # formats. Wildcards are not allowed. This must be a single file in one of
288 # the following formats:
289 #
290 # For unidirectional glossaries:
291 #
292 # - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated.
293 # The first column is source text. The second column is target text.
294 # The file must not contain headers. That is, the first row is data, not
295 # column names.
296 #
297 # - TMX (`.tmx`): TMX file with parallel data defining source/target term
298 # pairs.
299 #
300 # For equivalent term sets glossaries:
301 #
302 # - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms
303 # in multiple languages. The format is defined for Google Translation
304 # Toolkit and documented in [Use a
305 # glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en).
306 &quot;inputUri&quot;: &quot;A String&quot;, # Required. Source data URI. For example, `gs://my_bucket/my_object`.
307 },
308 },
309 &quot;submitTime&quot;: &quot;A String&quot;, # Output only. When CreateGlossary was called.
310 &quot;languagePair&quot;: { # Used with unidirectional glossaries. # Used with unidirectional glossaries.
311 &quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code for translation output, for example,
312 # &quot;zh-CN&quot;. Expected to be an exact match for GlossaryTerm.language_code.
313 &quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code of the input text, for example,
314 # &quot;en-US&quot;. Expected to be an exact match for GlossaryTerm.language_code.
315 },
316 &quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the glossary. Glossary names have the form
317 # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
318 &quot;languageCodesSet&quot;: { # Used with equivalent term set glossaries. # Used with equivalent term set glossaries.
319 &quot;languageCodes&quot;: [ # The BCP-47 language code(s) for terms defined in the glossary.
320 # All entries are unique. The list contains at least two entries.
321 # Expected to be an exact match for GlossaryTerm.language_code.
322 &quot;A String&quot;,
323 ],
324 },
325 &quot;endTime&quot;: &quot;A String&quot;, # Output only. When the glossary creation was finished.
326 }</pre>
327</div>
328
329<div class="method">
330 <code class="details" id="list">list(parent, pageToken=None, pageSize=None, filter=None, x__xgafv=None)</code>
331 <pre>Lists glossaries in a project. Returns NOT_FOUND, if the project doesn&#x27;t
332exist.
333
334Args:
335 parent: string, Required. The name of the project from which to list all of the glossaries. (required)
336 pageToken: string, Optional. A token identifying a page of results the server should return.
337Typically, this is the value of [ListGlossariesResponse.next_page_token]
338returned from the previous call to `ListGlossaries` method.
339The first page is returned if `page_token`is empty or missing.
340 pageSize: integer, Optional. Requested page size. The server may return fewer glossaries than
341requested. If unspecified, the server picks an appropriate default.
342 filter: string, Optional. Filter specifying constraints of a list operation.
343Filtering is not supported yet, and the parameter currently has no effect.
344If missing, no filtering is performed.
345 x__xgafv: string, V1 error format.
346 Allowed values
347 1 - v1 error format
348 2 - v2 error format
349
350Returns:
351 An object of the form:
352
353 { # Response message for ListGlossaries.
354 &quot;glossaries&quot;: [ # The list of glossaries for a project.
355 { # Represents a glossary built from user provided data.
356 &quot;entryCount&quot;: 42, # Output only. The number of entries defined in the glossary.
357 &quot;inputConfig&quot;: { # Input configuration for glossaries. # Required. Provides examples to build the glossary from.
358 # Total glossary must not exceed 10M Unicode codepoints.
359 &quot;gcsSource&quot;: { # The Google Cloud Storage location for the input content. # Required. Google Cloud Storage location of glossary data.
360 # File format is determined based on the filename extension. API returns
361 # [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file
362 # formats. Wildcards are not allowed. This must be a single file in one of
363 # the following formats:
364 #
365 # For unidirectional glossaries:
366 #
367 # - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated.
368 # The first column is source text. The second column is target text.
369 # The file must not contain headers. That is, the first row is data, not
370 # column names.
371 #
372 # - TMX (`.tmx`): TMX file with parallel data defining source/target term
373 # pairs.
374 #
375 # For equivalent term sets glossaries:
376 #
377 # - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms
378 # in multiple languages. The format is defined for Google Translation
379 # Toolkit and documented in [Use a
380 # glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en).
381 &quot;inputUri&quot;: &quot;A String&quot;, # Required. Source data URI. For example, `gs://my_bucket/my_object`.
382 },
383 },
384 &quot;submitTime&quot;: &quot;A String&quot;, # Output only. When CreateGlossary was called.
385 &quot;languagePair&quot;: { # Used with unidirectional glossaries. # Used with unidirectional glossaries.
386 &quot;targetLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code for translation output, for example,
387 # &quot;zh-CN&quot;. Expected to be an exact match for GlossaryTerm.language_code.
388 &quot;sourceLanguageCode&quot;: &quot;A String&quot;, # Required. The BCP-47 language code of the input text, for example,
389 # &quot;en-US&quot;. Expected to be an exact match for GlossaryTerm.language_code.
390 },
391 &quot;name&quot;: &quot;A String&quot;, # Required. The resource name of the glossary. Glossary names have the form
392 # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`.
393 &quot;languageCodesSet&quot;: { # Used with equivalent term set glossaries. # Used with equivalent term set glossaries.
394 &quot;languageCodes&quot;: [ # The BCP-47 language code(s) for terms defined in the glossary.
395 # All entries are unique. The list contains at least two entries.
396 # Expected to be an exact match for GlossaryTerm.language_code.
397 &quot;A String&quot;,
398 ],
399 },
400 &quot;endTime&quot;: &quot;A String&quot;, # Output only. When the glossary creation was finished.
401 },
402 ],
403 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve a page of results. Pass this value in the
404 # [ListGlossariesRequest.page_token] field in the subsequent call to
405 # `ListGlossaries` method to retrieve the next page of results.
406 }</pre>
407</div>
408
409<div class="method">
410 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
411 <pre>Retrieves the next page of results.
412
413Args:
414 previous_request: The request for the previous page. (required)
415 previous_response: The response from the request for the previous page. (required)
416
417Returns:
418 A request object that you can call &#x27;execute()&#x27; on to request the next
419 page. Returns None if there are no more items in the collection.
420 </pre>
421</div>
422
423</body></html>