Skip to content

Commit

Permalink
Bilingual file - uploadBilingualFileV2 (#14)
Browse files Browse the repository at this point in the history
* Bilingual file - uploadBilingualFileV2

* Version 0.3.7
  • Loading branch information
Martin005 authored Jan 28, 2025
1 parent 42b7397 commit bad3bdb
Show file tree
Hide file tree
Showing 14 changed files with 450 additions and 56 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please, include the `User-Agent` header with the name of your application or pro
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: Latest
- Package version: 0.3.6
- Package version: 0.3.7
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
34 changes: 20 additions & 14 deletions docs/BilingualFileApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Method | HTTP request | Description
[**convert_bilingual_file**](BilingualFileApi.md#convert_bilingual_file) | **POST** /api2/v1/bilingualFiles/convert | Convert bilingual file
[**get_bilingual_file**](BilingualFileApi.md#get_bilingual_file) | **POST** /api2/v1/projects/{projectUid}/jobs/bilingualFile | Download bilingual file
[**get_preview_file**](BilingualFileApi.md#get_preview_file) | **POST** /api2/v1/bilingualFiles/preview | Download preview
[**upload_bilingual_file**](BilingualFileApi.md#upload_bilingual_file) | **PUT** /api2/v1/bilingualFiles | Upload bilingual file
[**upload_bilingual_file_v2**](BilingualFileApi.md#upload_bilingual_file_v2) | **POST** /api2/v2/bilingualFiles | Upload bilingual file


# **compare_bilingual_file**
Expand Down Expand Up @@ -52,6 +52,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```



### Parameters

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



### Parameters

Name | Type | Description | Notes
Expand Down Expand Up @@ -171,6 +173,8 @@ No authorization required
Download bilingual file

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.

### Example

```python
Expand Down Expand Up @@ -205,6 +209,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```



### Parameters

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



### Parameters

Name | Type | Description | Notes
Expand Down Expand Up @@ -319,20 +325,21 @@ No authorization required

[[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)

# **upload_bilingual_file**
> JobPartsDto upload_bilingual_file(format=format, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed, body=body)
# **upload_bilingual_file_v2**
> ProjectJobPartsDto upload_bilingual_file_v2(file, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed)
Upload bilingual file

Returns updated job parts
Returns updated job parts and projects

### Example

```python
import time
import os
import phrasetms_client
from phrasetms_client.models.job_parts_dto import JobPartsDto
from phrasetms_client.models.multipart_file import MultipartFile
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto
from phrasetms_client.rest import ApiException
from pprint import pprint

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

try:
# Upload bilingual file
api_response = api_instance.upload_bilingual_file(format=format, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed, body=body)
print("The response of BilingualFileApi->upload_bilingual_file:\n")
api_response = api_instance.upload_bilingual_file_v2(file, save_to_trans_memory=save_to_trans_memory, set_completed=set_completed)
print("The response of BilingualFileApi->upload_bilingual_file_v2:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BilingualFileApi->upload_bilingual_file: %s\n" % e)
print("Exception when calling BilingualFileApi->upload_bilingual_file_v2: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**format** | **str**| | [optional] [default to 'MXLF']
**file** | [**MultipartFile**](MultipartFile.md)| |
**save_to_trans_memory** | **str**| | [optional] [default to 'Confirmed']
**set_completed** | **bool**| | [optional] [default to False]
**body** | **object**| | [optional]

### Return type

[**JobPartsDto**](JobPartsDto.md)
[**ProjectJobPartsDto**](ProjectJobPartsDto.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/octet-stream
- **Content-Type**: multipart/form-data
- **Accept**: application/json

### HTTP response details
Expand Down
34 changes: 34 additions & 0 deletions docs/MultipartFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# MultipartFile


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
**empty** | **bool** | | [optional]
**bytes** | **List[bytearray]** | | [optional]
**size** | **int** | | [optional]
**input_stream** | **object** | | [optional]
**content_type** | **str** | | [optional]
**original_filename** | **str** | | [optional]

## Example

```python
from phrasetms_client.models.multipart_file import MultipartFile

# TODO update the JSON string below
json = "{}"
# create an instance of MultipartFile from a JSON string
multipart_file_instance = MultipartFile.from_json(json)
# print the JSON string representation of the object
print MultipartFile.to_json()

# convert the object into a dict
multipart_file_dict = multipart_file_instance.to_dict()
# create an instance of MultipartFile from a dict
multipart_file_form_dict = multipart_file.from_dict(multipart_file_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


29 changes: 29 additions & 0 deletions docs/ProjectJobPartsDto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ProjectJobPartsDto


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**jobs** | [**List[JobPartReference]**](JobPartReference.md) | | [optional]
**project** | [**ProjectReference**](ProjectReference.md) | | [optional]

## Example

```python
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto

# TODO update the JSON string below
json = "{}"
# create an instance of ProjectJobPartsDto from a JSON string
project_job_parts_dto_instance = ProjectJobPartsDto.from_json(json)
# print the JSON string representation of the object
print ProjectJobPartsDto.to_json()

# convert the object into a dict
project_job_parts_dto_dict = project_job_parts_dto_instance.to_dict()
# create an instance of ProjectJobPartsDto from a dict
project_job_parts_dto_form_dict = project_job_parts_dto.from_dict(project_job_parts_dto_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


3 changes: 2 additions & 1 deletion phrasetms_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""


__version__ = "0.3.6"
__version__ = "0.3.7"

# import apis into sdk package
from phrasetms_client.api.additional_workflow_step_api import AdditionalWorkflowStepApi
Expand Down Expand Up @@ -779,6 +779,7 @@
from phrasetms_client.models.progress_dto import ProgressDto
from phrasetms_client.models.progress_dto_v2 import ProgressDtoV2
from phrasetms_client.models.progress_reference import ProgressReference
from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto
from phrasetms_client.models.project_mt_settings_per_lang_dto import (
ProjectMTSettingsPerLangDto,
)
Expand Down
Loading

0 comments on commit bad3bdb

Please sign in to comment.