Skip to content

Commit bad3bdb

Browse files
authored
Bilingual file - uploadBilingualFileV2 (#14)
* Bilingual file - uploadBilingualFileV2 * Version 0.3.7
1 parent 42b7397 commit bad3bdb

14 files changed

+450
-56
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Please, include the `User-Agent` header with the name of your application or pro
1313
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
1414

1515
- API version: Latest
16-
- Package version: 0.3.6
16+
- Package version: 0.3.7
1717
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1818

1919
## Requirements.

docs/BilingualFileApi.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Method | HTTP request | Description
88
[**convert_bilingual_file**](BilingualFileApi.md#convert_bilingual_file) | **POST** /api2/v1/bilingualFiles/convert | Convert bilingual file
99
[**get_bilingual_file**](BilingualFileApi.md#get_bilingual_file) | **POST** /api2/v1/projects/{projectUid}/jobs/bilingualFile | Download bilingual file
1010
[**get_preview_file**](BilingualFileApi.md#get_preview_file) | **POST** /api2/v1/bilingualFiles/preview | Download preview
11-
[**upload_bilingual_file**](BilingualFileApi.md#upload_bilingual_file) | **PUT** /api2/v1/bilingualFiles | Upload bilingual file
11+
[**upload_bilingual_file_v2**](BilingualFileApi.md#upload_bilingual_file_v2) | **POST** /api2/v2/bilingualFiles | Upload bilingual file
1212

1313

1414
# **compare_bilingual_file**
@@ -52,6 +52,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
5252
```
5353

5454

55+
5556
### Parameters
5657

5758
Name | Type | Description | Notes
@@ -127,6 +128,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
127128
```
128129

129130

131+
130132
### Parameters
131133

132134
Name | Type | Description | Notes
@@ -171,6 +173,8 @@ No authorization required
171173
172174
Download bilingual file
173175

176+
This API call generates a bilingual file in the chosen format by merging all submitted jobs together. Note that all submitted jobs must belong to the same project; it's not feasible to merge jobs from multiple projects. When dealing with MXLIFF or DOCX files, modifications made externally can be imported back into the Phrase TMS project. Any changes will be synchronized into the editor, allowing actions like confirming or locking segments. Unlike the user interface (UI), the APIs also support XLIFF as a bilingual format, intended primarily for export purposes. However, TMX and XLIFF files cannot be imported back into the project to reflect external changes. While MXLIFF files are editable using various means, their primary intended use is with the [CAT Desktop Editor](https://support.phrase.com/hc/en-us/articles/5709683873052-CAT-Desktop-Editor-TMS-). It's crucial to note that alterations to the file incompatible with the CAT Desktop Editor's features may result in a corrupted file, leading to potential loss or duplication of work.
177+
174178
### Example
175179

176180
```python
@@ -205,6 +209,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
205209
```
206210

207211

212+
208213
### Parameters
209214

210215
Name | Type | Description | Notes
@@ -282,6 +287,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
282287
```
283288

284289

290+
285291
### Parameters
286292

287293
Name | Type | Description | Notes
@@ -319,20 +325,21 @@ No authorization required
319325

320326
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
321327

322-
# **upload_bilingual_file**
323-
> JobPartsDto upload_bilingual_file(format=format, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed, body=body)
328+
# **upload_bilingual_file_v2**
329+
> ProjectJobPartsDto upload_bilingual_file_v2(file, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed)
324330
325331
Upload bilingual file
326332

327-
Returns updated job parts
333+
Returns updated job parts and projects
328334

329335
### Example
330336

331337
```python
332338
import time
333339
import os
334340
import phrasetms_client
335-
from phrasetms_client.models.job_parts_dto import JobPartsDto
341+
from phrasetms_client.models.multipart_file import MultipartFile
342+
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto
336343
from phrasetms_client.rest import ApiException
337344
from pprint import pprint
338345

@@ -347,41 +354,40 @@ configuration = phrasetms_client.Configuration(
347354
with phrasetms_client.ApiClient(configuration) as api_client:
348355
# Create an instance of the API class
349356
api_instance = phrasetms_client.BilingualFileApi(api_client)
350-
format = 'MXLF' # str | (optional) (default to 'MXLF')
357+
file = phrasetms_client.MultipartFile() # MultipartFile |
351358
save_to_trans_memory = 'Confirmed' # str | (optional) (default to 'Confirmed')
352359
set_completed = False # bool | (optional) (default to False)
353-
body = None # object | (optional)
354360

355361
try:
356362
# Upload bilingual file
357-
api_response = api_instance.upload_bilingual_file(format=format, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed, body=body)
358-
print("The response of BilingualFileApi->upload_bilingual_file:\n")
363+
api_response = api_instance.upload_bilingual_file_v2(file, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed)
364+
print("The response of BilingualFileApi->upload_bilingual_file_v2:\n")
359365
pprint(api_response)
360366
except Exception as e:
361-
print("Exception when calling BilingualFileApi->upload_bilingual_file: %s\n" % e)
367+
print("Exception when calling BilingualFileApi->upload_bilingual_file_v2: %s\n" % e)
362368
```
363369

364370

371+
365372
### Parameters
366373

367374
Name | Type | Description | Notes
368375
------------- | ------------- | ------------- | -------------
369-
**format** | **str**| | [optional] [default to 'MXLF']
376+
**file** | [**MultipartFile**](MultipartFile.md)| |
370377
**save_to_trans_memory** | **str**| | [optional] [default to 'Confirmed']
371378
**set_completed** | **bool**| | [optional] [default to False]
372-
**body** | **object**| | [optional]
373379

374380
### Return type
375381

376-
[**JobPartsDto**](JobPartsDto.md)
382+
[**ProjectJobPartsDto**](ProjectJobPartsDto.md)
377383

378384
### Authorization
379385

380386
No authorization required
381387

382388
### HTTP request headers
383389

384-
- **Content-Type**: application/octet-stream
390+
- **Content-Type**: multipart/form-data
385391
- **Accept**: application/json
386392

387393
### HTTP response details

docs/MultipartFile.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# MultipartFile
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**name** | **str** | | [optional]
8+
**empty** | **bool** | | [optional]
9+
**bytes** | **List[bytearray]** | | [optional]
10+
**size** | **int** | | [optional]
11+
**input_stream** | **object** | | [optional]
12+
**content_type** | **str** | | [optional]
13+
**original_filename** | **str** | | [optional]
14+
15+
## Example
16+
17+
```python
18+
from phrasetms_client.models.multipart_file import MultipartFile
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of MultipartFile from a JSON string
23+
multipart_file_instance = MultipartFile.from_json(json)
24+
# print the JSON string representation of the object
25+
print MultipartFile.to_json()
26+
27+
# convert the object into a dict
28+
multipart_file_dict = multipart_file_instance.to_dict()
29+
# create an instance of MultipartFile from a dict
30+
multipart_file_form_dict = multipart_file.from_dict(multipart_file_dict)
31+
```
32+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33+
34+

docs/ProjectJobPartsDto.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ProjectJobPartsDto
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**jobs** | [**List[JobPartReference]**](JobPartReference.md) | | [optional]
8+
**project** | [**ProjectReference**](ProjectReference.md) | | [optional]
9+
10+
## Example
11+
12+
```python
13+
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto
14+
15+
# TODO update the JSON string below
16+
json = "{}"
17+
# create an instance of ProjectJobPartsDto from a JSON string
18+
project_job_parts_dto_instance = ProjectJobPartsDto.from_json(json)
19+
# print the JSON string representation of the object
20+
print ProjectJobPartsDto.to_json()
21+
22+
# convert the object into a dict
23+
project_job_parts_dto_dict = project_job_parts_dto_instance.to_dict()
24+
# create an instance of ProjectJobPartsDto from a dict
25+
project_job_parts_dto_form_dict = project_job_parts_dto.from_dict(project_job_parts_dto_dict)
26+
```
27+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
28+
29+

phrasetms_client/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""
1515

1616

17-
__version__ = "0.3.6"
17+
__version__ = "0.3.7"
1818

1919
# import apis into sdk package
2020
from phrasetms_client.api.additional_workflow_step_api import AdditionalWorkflowStepApi
@@ -779,6 +779,7 @@
779779
from phrasetms_client.models.progress_dto import ProgressDto
780780
from phrasetms_client.models.progress_dto_v2 import ProgressDtoV2
781781
from phrasetms_client.models.progress_reference import ProgressReference
782+
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto
782783
from phrasetms_client.models.project_mt_settings_per_lang_dto import (
783784
ProjectMTSettingsPerLangDto,
784785
)

0 commit comments

Comments
 (0)