Skip to content

Commit

Permalink
Fix incorrect handling of form params/files in upload_bilingual_file_…
Browse files Browse the repository at this point in the history
…v2 (#15)

* Fix incorrect handling of form params/files in upload_bilingual_file_v2

* Make local_path non-optional

* Version 0.3.8
  • Loading branch information
Martin005 authored Jan 30, 2025
1 parent bad3bdb commit 34109d5
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 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.7
- Package version: 0.3.8
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
2 changes: 1 addition & 1 deletion docs/BilingualFileApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ 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)
file = phrasetms_client.MultipartFile() # MultipartFile |
file = phrasetms_client.MultipartFile(local_path="output.mxliff") # MultipartFile |
save_to_trans_memory = 'Confirmed' # str | (optional) (default to 'Confirmed')
set_completed = False # bool | (optional) (default to False)

Expand Down
2 changes: 1 addition & 1 deletion docs/MultipartFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
**local_path** | **str** | | [optional]
**empty** | **bool** | | [optional]
**bytes** | **List[bytearray]** | | [optional]
**size** | **int** | | [optional]
Expand Down
2 changes: 1 addition & 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.7"
__version__ = "0.3.8"

# import apis into sdk package
from phrasetms_client.api.additional_workflow_step_api import AdditionalWorkflowStepApi
Expand Down
2 changes: 1 addition & 1 deletion phrasetms_client/api/bilingual_file_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def upload_bilingual_file_v2_with_http_info(self, file : MultipartFile, save_to_
_form_params = []
_files = {}
if _params['file']:
_form_params.append(('file', _params['file']))
_files['file'] = _params['file'].local_path

# process the body parameter
_body_params = None
Expand Down
2 changes: 1 addition & 1 deletion phrasetms_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.7".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 0.3.8".format(env=sys.platform, pyversion=sys.version)
)

def get_host_settings(self):
Expand Down
6 changes: 3 additions & 3 deletions phrasetms_client/models/multipart_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class MultipartFile(BaseModel):
MultipartFile
"""

name: Optional[StrictStr] = None
local_path: StrictStr = Field(...)
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",
"local_path",
"empty",
"bytes",
"size",
Expand Down Expand Up @@ -89,7 +89,7 @@ def from_dict(cls, obj: dict) -> MultipartFile:

_obj = MultipartFile.parse_obj(
{
"name": obj.get("name"),
"local_path": obj.get("local_path"),
"empty": obj.get("empty"),
"bytes": obj.get("bytes"),
"size": obj.get("size"),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "phrasetms_client"
version = "0.3.7"
version = "0.3.8"
description = "Phrase TMS API"
authors = ["Martin Chrástek"]
license = "NoLicense"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "phrasetms-client"
VERSION = "0.3.7"
VERSION = "0.3.8"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = ["urllib3 >= 1.25.3", "python-dateutil", "pydantic >= 1.10.5, < 2", "aenum"]

Expand Down
2 changes: 1 addition & 1 deletion test/test_multipart_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> MultipartFile:
model = MultipartFile() # noqa: E501
if include_optional:
return MultipartFile(
name = '',
local_path = '',
empty = True,
bytes = [
'YQ=='
Expand Down

0 comments on commit 34109d5

Please sign in to comment.