diff --git a/README.md b/README.md
index a9b8e9d8..6528a0e4 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/docs/BilingualFileApi.md b/docs/BilingualFileApi.md
index 20cea9c3..ca5e2056 100644
--- a/docs/BilingualFileApi.md
+++ b/docs/BilingualFileApi.md
@@ -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**
@@ -52,6 +52,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```
+
### Parameters
Name | Type | Description | Notes
@@ -127,6 +128,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```
+
### Parameters
Name | Type | Description | Notes
@@ -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
@@ -205,6 +209,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```
+
### Parameters
Name | Type | Description | Notes
@@ -282,6 +287,7 @@ with phrasetms_client.ApiClient(configuration) as api_client:
```
+
### Parameters
Name | Type | Description | Notes
@@ -319,12 +325,12 @@ 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
@@ -332,7 +338,8 @@ Returns updated job parts
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
@@ -347,33 +354,32 @@ 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
@@ -381,7 +387,7 @@ No authorization required
### HTTP request headers
- - **Content-Type**: application/octet-stream
+ - **Content-Type**: multipart/form-data
- **Accept**: application/json
### HTTP response details
diff --git a/docs/MultipartFile.md b/docs/MultipartFile.md
new file mode 100644
index 00000000..88461221
--- /dev/null
+++ b/docs/MultipartFile.md
@@ -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)
+
+
diff --git a/docs/ProjectJobPartsDto.md b/docs/ProjectJobPartsDto.md
new file mode 100644
index 00000000..63983a4a
--- /dev/null
+++ b/docs/ProjectJobPartsDto.md
@@ -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)
+
+
diff --git a/phrasetms_client/__init__.py b/phrasetms_client/__init__.py
index 7a7546ca..c18a22bf 100644
--- a/phrasetms_client/__init__.py
+++ b/phrasetms_client/__init__.py
@@ -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
@@ -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,
)
diff --git a/phrasetms_client/api/bilingual_file_api.py b/phrasetms_client/api/bilingual_file_api.py
index 9be7969d..f2ec12ef 100644
--- a/phrasetms_client/api/bilingual_file_api.py
+++ b/phrasetms_client/api/bilingual_file_api.py
@@ -25,7 +25,8 @@
from phrasetms_client.models.compared_segments_dto import ComparedSegmentsDto
from phrasetms_client.models.get_bilingual_file_dto import GetBilingualFileDto
-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.api_client import ApiClient
from phrasetms_client.api_response import ApiResponse
@@ -175,7 +176,7 @@ def compare_bilingual_file_with_http_info(self, workflow_level : Optional[conint
self.api_client.select_header_content_type(
['application/octet-stream']))
if _content_types_list:
- _header_params['Content-Type'] = _content_types_list
+ _header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
@@ -342,7 +343,7 @@ def convert_bilingual_file_with_http_info(self, var_from : StrictStr, to : Stric
self.api_client.select_header_content_type(
['application/octet-stream']))
if _content_types_list:
- _header_params['Content-Type'] = _content_types_list
+ _header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
@@ -370,6 +371,7 @@ def convert_bilingual_file_with_http_info(self, var_from : StrictStr, to : Stric
def get_bilingual_file(self, project_uid : StrictStr, format : Optional[StrictStr] = None, preview : Optional[StrictBool] = None, body : Optional[GetBilingualFileDto] = None, **kwargs) -> None: # noqa: E501
"""Download bilingual file # noqa: E501
+ 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. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
@@ -404,6 +406,7 @@ def get_bilingual_file(self, project_uid : StrictStr, format : Optional[StrictSt
def get_bilingual_file_with_http_info(self, project_uid : StrictStr, format : Optional[StrictStr] = None, preview : Optional[StrictBool] = None, body : Optional[GetBilingualFileDto] = None, **kwargs) -> ApiResponse: # noqa: E501
"""Download bilingual file # noqa: E501
+ 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. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
@@ -504,7 +507,7 @@ def get_bilingual_file_with_http_info(self, project_uid : StrictStr, format : Op
self.api_client.select_header_content_type(
['application/json']))
if _content_types_list:
- _header_params['Content-Type'] = _content_types_list
+ _header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
@@ -644,7 +647,7 @@ def get_preview_file_with_http_info(self, body : Optional[Dict[str, Any]] = None
self.api_client.select_header_content_type(
['application/octet-stream']))
if _content_types_list:
- _header_params['Content-Type'] = _content_types_list
+ _header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
@@ -669,24 +672,22 @@ def get_preview_file_with_http_info(self, body : Optional[Dict[str, Any]] = None
_request_auth=_params.get('_request_auth'))
@validate_arguments
- def upload_bilingual_file(self, format : Optional[StrictStr] = None, save_to_trans_memory : Optional[StrictStr] = None, set_completed : Optional[StrictBool] = None, body : Optional[Dict[str, Any]] = None, **kwargs) -> JobPartsDto: # noqa: E501
+ def upload_bilingual_file_v2(self, file : MultipartFile, save_to_trans_memory : Optional[StrictStr] = None, set_completed : Optional[StrictBool] = None, **kwargs) -> ProjectJobPartsDto: # noqa: E501
"""Upload bilingual file # noqa: E501
- Returns updated job parts # noqa: E501
+ Returns updated job parts and projects # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_bilingual_file(format, save_to_trans_memory, set_completed, body, async_req=True)
+ >>> thread = api.upload_bilingual_file_v2(file, save_to_trans_memory, set_completed, async_req=True)
>>> result = thread.get()
- :param format:
- :type format: str
+ :param file: (required)
+ :type file: MultipartFile
:param save_to_trans_memory:
:type save_to_trans_memory: str
:param set_completed:
:type set_completed: bool
- :param body:
- :type body: object
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _request_timeout: timeout setting for this request. If one
@@ -696,32 +697,30 @@ def upload_bilingual_file(self, format : Optional[StrictStr] = None, save_to_tra
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: JobPartsDto
+ :rtype: ProjectJobPartsDto
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
- raise ValueError("Error! Please call the upload_bilingual_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
- return self.upload_bilingual_file_with_http_info(format, save_to_trans_memory, set_completed, body, **kwargs) # noqa: E501
+ raise ValueError("Error! Please call the upload_bilingual_file_v2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
+ return self.upload_bilingual_file_v2_with_http_info(file, save_to_trans_memory, set_completed, **kwargs) # noqa: E501
@validate_arguments
- def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = None, save_to_trans_memory : Optional[StrictStr] = None, set_completed : Optional[StrictBool] = None, body : Optional[Dict[str, Any]] = None, **kwargs) -> ApiResponse: # noqa: E501
+ def upload_bilingual_file_v2_with_http_info(self, file : MultipartFile, save_to_trans_memory : Optional[StrictStr] = None, set_completed : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501
"""Upload bilingual file # noqa: E501
- Returns updated job parts # noqa: E501
+ Returns updated job parts and projects # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.upload_bilingual_file_with_http_info(format, save_to_trans_memory, set_completed, body, async_req=True)
+ >>> thread = api.upload_bilingual_file_v2_with_http_info(file, save_to_trans_memory, set_completed, async_req=True)
>>> result = thread.get()
- :param format:
- :type format: str
+ :param file: (required)
+ :type file: MultipartFile
:param save_to_trans_memory:
:type save_to_trans_memory: str
:param set_completed:
:type set_completed: bool
- :param body:
- :type body: object
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the ApiResponse.data will
@@ -744,16 +743,15 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(JobPartsDto, status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(ProjectJobPartsDto, status_code(int), headers(HTTPHeaderDict))
"""
_params = locals()
_all_params = [
- 'format',
+ 'file',
'save_to_trans_memory',
- 'set_completed',
- 'body'
+ 'set_completed'
]
_all_params.extend(
[
@@ -772,7 +770,7 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
- " to method upload_bilingual_file" % _key
+ " to method upload_bilingual_file_v2" % _key
)
_params[_key] = _val
del _params['kwargs']
@@ -784,9 +782,6 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
# process the query parameters
_query_params = []
- if _params.get('format') is not None: # noqa: E501
- _query_params.append(('format', _params['format'].value))
-
if _params.get('save_to_trans_memory') is not None: # noqa: E501
_query_params.append(('saveToTransMemory', _params['save_to_trans_memory'].value))
@@ -798,11 +793,11 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
# process the form parameters
_form_params = []
_files = {}
+ if _params['file']:
+ _form_params.append(('file', _params['file']))
+
# process the body parameter
_body_params = None
- if _params['body'] is not None:
- _body_params = _params['body']
-
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
@@ -810,15 +805,15 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
# set the HTTP header `Content-Type`
_content_types_list = _params.get('_content_type',
self.api_client.select_header_content_type(
- ['application/octet-stream']))
+ ['multipart/form-data']))
if _content_types_list:
- _header_params['Content-Type'] = _content_types_list
+ _header_params['Content-Type'] = _content_types_list
# authentication setting
_auth_settings = [] # noqa: E501
_response_types_map = {
- '200': "JobPartsDto",
+ '200': "ProjectJobPartsDto",
'400': None,
'401': None,
'403': None,
@@ -833,7 +828,7 @@ def upload_bilingual_file_with_http_info(self, format : Optional[StrictStr] = No
}
return self.api_client.call_api(
- '/api2/v1/bilingualFiles', 'PUT',
+ '/api2/v2/bilingualFiles', 'POST',
_path_params,
_query_params,
_header_params,
diff --git a/phrasetms_client/configuration.py b/phrasetms_client/configuration.py
index 92c68177..a4d1e3f0 100644
--- a/phrasetms_client/configuration.py
+++ b/phrasetms_client/configuration.py
@@ -423,7 +423,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: Latest\n"
- "SDK Package Version: 0.3.6".format(env=sys.platform, pyversion=sys.version)
+ "SDK Package Version: 0.3.7".format(env=sys.platform, pyversion=sys.version)
)
def get_host_settings(self):
diff --git a/phrasetms_client/models/__init__.py b/phrasetms_client/models/__init__.py
index 7fbf7431..970aa387 100644
--- a/phrasetms_client/models/__init__.py
+++ b/phrasetms_client/models/__init__.py
@@ -475,6 +475,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
from phrasetms_client.models.project_reference import ProjectReference
from phrasetms_client.models.project_reference_files_request_dto import ProjectReferenceFilesRequestDto
diff --git a/phrasetms_client/models/multipart_file.py b/phrasetms_client/models/multipart_file.py
new file mode 100644
index 00000000..06a7591d
--- /dev/null
+++ b/phrasetms_client/models/multipart_file.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ Phrase TMS API
+
+ Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
+
+ The version of the OpenAPI document: Latest
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, List, Optional, Union
+from pydantic import (
+ BaseModel,
+ Field,
+ StrictBool,
+ StrictInt,
+ StrictStr,
+ conbytes,
+ conlist,
+ constr,
+ validator,
+)
+
+
+class MultipartFile(BaseModel):
+ """
+ MultipartFile
+ """
+
+ name: Optional[StrictStr] = None
+ empty: Optional[StrictBool] = None
+ bytes: Optional[conlist(Union[conbytes(strict=True), constr(strict=True)])] = None
+ size: Optional[StrictInt] = None
+ input_stream: Optional[Dict[str, Any]] = Field(None, alias="inputStream")
+ content_type: Optional[StrictStr] = Field(None, alias="contentType")
+ original_filename: Optional[StrictStr] = Field(None, alias="originalFilename")
+ __properties = [
+ "name",
+ "empty",
+ "bytes",
+ "size",
+ "inputStream",
+ "contentType",
+ "originalFilename",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MultipartFile:
+ """Create an instance of MultipartFile from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MultipartFile:
+ """Create an instance of MultipartFile from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MultipartFile.parse_obj(obj)
+
+ _obj = MultipartFile.parse_obj(
+ {
+ "name": obj.get("name"),
+ "empty": obj.get("empty"),
+ "bytes": obj.get("bytes"),
+ "size": obj.get("size"),
+ "input_stream": obj.get("inputStream"),
+ "content_type": obj.get("contentType"),
+ "original_filename": obj.get("originalFilename"),
+ }
+ )
+ return _obj
diff --git a/phrasetms_client/models/project_job_parts_dto.py b/phrasetms_client/models/project_job_parts_dto.py
new file mode 100644
index 00000000..c797db75
--- /dev/null
+++ b/phrasetms_client/models/project_job_parts_dto.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ Phrase TMS API
+
+ Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
+
+ The version of the OpenAPI document: Latest
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, conlist
+from phrasetms_client.models.job_part_reference import JobPartReference
+from phrasetms_client.models.project_reference import ProjectReference
+
+class ProjectJobPartsDto(BaseModel):
+ """
+ ProjectJobPartsDto
+ """
+ jobs: Optional[conlist(JobPartReference)] = None
+ project: Optional[ProjectReference] = None
+ __properties = ["jobs", "project"]
+
+ class Config:
+ """Pydantic configuration"""
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ProjectJobPartsDto:
+ """Create an instance of ProjectJobPartsDto from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True,
+ exclude={
+ },
+ exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in jobs (list)
+ _items = []
+ if self.jobs:
+ for _item in self.jobs:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict['jobs'] = _items
+ # override the default output from pydantic by calling `to_dict()` of project
+ if self.project:
+ _dict['project'] = self.project.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ProjectJobPartsDto:
+ """Create an instance of ProjectJobPartsDto from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ProjectJobPartsDto.parse_obj(obj)
+
+ _obj = ProjectJobPartsDto.parse_obj({
+ "jobs": [JobPartReference.from_dict(_item) for _item in obj.get("jobs")] if obj.get("jobs") is not None else None,
+ "project": ProjectReference.from_dict(obj.get("project")) if obj.get("project") is not None else None
+ })
+ return _obj
+
+
diff --git a/pyproject.toml b/pyproject.toml
index 826c4220..9c2778ce 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "phrasetms_client"
-version = "0.3.6"
+version = "0.3.7"
description = "Phrase TMS API"
authors = ["Martin Chrástek"]
license = "NoLicense"
diff --git a/setup.py b/setup.py
index 1992abef..ef66c28e 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "phrasetms-client"
-VERSION = "0.3.6"
+VERSION = "0.3.7"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = ["urllib3 >= 1.25.3", "python-dateutil", "pydantic >= 1.10.5, < 2", "aenum"]
diff --git a/test/test_multipart_file.py b/test/test_multipart_file.py
new file mode 100644
index 00000000..b3166c4e
--- /dev/null
+++ b/test/test_multipart_file.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Phrase TMS API
+
+ Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
+
+ The version of the OpenAPI document: Latest
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+from phrasetms_client.models.multipart_file import MultipartFile # noqa: E501
+
+class TestMultipartFile(unittest.TestCase):
+ """MultipartFile unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> MultipartFile:
+ """Test MultipartFile
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MultipartFile`
+ """
+ model = MultipartFile() # noqa: E501
+ if include_optional:
+ return MultipartFile(
+ name = '',
+ empty = True,
+ bytes = [
+ 'YQ=='
+ ],
+ size = 56,
+ input_stream = None,
+ content_type = '',
+ original_filename = ''
+ )
+ else:
+ return MultipartFile(
+ )
+ """
+
+ def testMultipartFile(self):
+ """Test MultipartFile"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/test/test_project_job_parts_dto.py b/test/test_project_job_parts_dto.py
new file mode 100644
index 00000000..9ea0f039
--- /dev/null
+++ b/test/test_project_job_parts_dto.py
@@ -0,0 +1,82 @@
+# coding: utf-8
+
+"""
+ Phrase TMS API
+
+ Welcome to Phrase's TMS API documentation. Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers: > User-Agent: Example mobile app (example@phrase.com)
User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
+
+ The version of the OpenAPI document: Latest
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+import datetime
+
+from phrasetms_client.models.project_job_parts_dto import ProjectJobPartsDto # noqa: E501
+
+class TestProjectJobPartsDto(unittest.TestCase):
+ """ProjectJobPartsDto unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ProjectJobPartsDto:
+ """Test ProjectJobPartsDto
+ include_option is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ProjectJobPartsDto`
+ """
+ model = ProjectJobPartsDto() # noqa: E501
+ if include_optional:
+ return ProjectJobPartsDto(
+ jobs = [
+ phrasetms_client.models.job_part_reference.JobPartReference(
+ uid = '',
+ status = 'NEW',
+ providers = [
+ phrasetms_client.models.provider_reference.ProviderReference(
+ type = '',
+ id = '',
+ uid = '', )
+ ],
+ target_lang = '',
+ workflow_level = 56,
+ workflow_step = phrasetms_client.models.workflow_step_reference.WorkflowStepReference(
+ uid = '',
+ name = '',
+ abbreviation = '',
+ order = 56,
+ lqa_enabled = True, ),
+ filename = '',
+ date_due = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ date_created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ update_source_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ imported = True,
+ job_assigned_email_template = phrasetms_client.models.analyse.analyse(),
+ notification_interval_in_minutes = 56,
+ continuous = True,
+ source_file_uid = '', )
+ ],
+ project = phrasetms_client.models.project_reference.ProjectReference(
+ name = '',
+ uid = '', )
+ )
+ else:
+ return ProjectJobPartsDto(
+ )
+ """
+
+ def testProjectJobPartsDto(self):
+ """Test ProjectJobPartsDto"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()