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