Skip to content

Commit 4b98d04

Browse files
authored
Bump template version to include multipart form data fix (#130)
Co-authored-by: Andy-Grigg <Andy-Grigg@users.noreply.github.com>
1 parent 819d9ac commit 4b98d04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+64411
-65464
lines changed

ansys-grantami-serverapi-openapi/poetry.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansys-grantami-serverapi-openapi/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55
[tool.poetry]
66
name = "ansys-grantami-serverapi-openapi"
77
description = "Autogenerated client library for the Granta MI Server API."
8-
version = "3.0.0.dev174"
8+
version = "3.0.0.dev183"
99
license = "MIT"
1010
authors = ["ANSYS, Inc. <pyansys.core@ansys.com>"]
1111
maintainers = ["ANSYS, Inc. <pyansys.core@ansys.com>"]
@@ -36,7 +36,7 @@ requests = "^2.26.0"
3636
python-dateutil = "^2.8.2"
3737

3838
[tool.poetry.group.dev.dependencies]
39-
pytest = ">=7,<9"
39+
pytest = "^7.0.0"
4040
requests-mock = "^1.0.0"
4141

4242
[tool.tox]

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1921,5 +1921,4 @@
19211921
from .models.granta_server_api_version_state import GrantaServerApiVersionState
19221922
from .models.jobqueue_files_body import JobqueueFilesBody
19231923
from .models.json_patch_document import JsonPatchDocument
1924-
from .models.system_io_stream import SystemIOStream
19251924
from .models.system_net_http_status_code import SystemNetHttpStatusCode

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/aggregation_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/data_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/data_export_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/database_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/integration_api.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

@@ -336,6 +337,7 @@ def _v1alpha_integration_schemas_schema_delete_with_http_info(
336337
local_var_files = {}
337338

338339
body_params = None
340+
339341
response_type_map = {
340342
204: None,
341343
403: None,

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/job_queue_api.py

+20-60
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

@@ -90,60 +91,30 @@ def _v1alpha_job_queue_current_user_get_with_http_info(self, **kwargs):
9091
)
9192

9293
def v1alpha_job_queue_files_post(
93-
self,
94-
*,
95-
content_type: "Optional[str]" = None,
96-
content_disposition: "Optional[str]" = None,
97-
headers: "Optional[Dict[str, List[str]]]" = None,
98-
length: "Optional[int]" = None,
99-
name: "Optional[str]" = None,
100-
file_name: "Optional[str]" = None,
94+
self, *, file: "Optional[Union[IO, pathlib.Path]]" = None
10195
) -> "str":
10296
"""Uploads an ephemeral file and returns an ID which can subsequently be used to refer to that file in a job creation request. Ephemeral files have a short lifespan and should be used to provide file data to jobs only. They should not be used as file storage.
10397
10498
This method makes a synchronous HTTP request.
10599
106100
Parameters
107101
----------
108-
content_type: str
109-
content_disposition: str
110-
headers: Dict[str, List[str]]
111-
length: int
112-
name: str
113-
file_name: str
102+
file: Union[IO, pathlib.Path]
114103
115104
Returns
116105
-------
117106
str
118107
"""
119108
data = self._v1alpha_job_queue_files_post_with_http_info(
120-
content_type,
121-
content_disposition,
122-
headers,
123-
length,
124-
name,
125-
file_name,
126-
_return_http_data_only=True,
109+
file, _return_http_data_only=True
127110
)
128111
return data # type: ignore[return-value]
129112

130113
def _v1alpha_job_queue_files_post_with_http_info(
131-
self,
132-
content_type: "Optional[str]" = None,
133-
content_disposition: "Optional[str]" = None,
134-
headers: "Optional[Dict[str, List[str]]]" = None,
135-
length: "Optional[int]" = None,
136-
name: "Optional[str]" = None,
137-
file_name: "Optional[str]" = None,
138-
**kwargs,
114+
self, file: "Optional[Union[IO, pathlib.Path]]" = None, **kwargs
139115
):
140116
all_params = [
141-
"content_type",
142-
"content_disposition",
143-
"headers",
144-
"length",
145-
"name",
146-
"file_name",
117+
"file",
147118
"_return_http_data_only",
148119
"_preload_content",
149120
"_request_timeout",
@@ -168,29 +139,17 @@ def _v1alpha_job_queue_files_post_with_http_info(
168139

169140
form_params = []
170141
local_var_files = {}
171-
if "content_type" in params and content_type is not None:
172-
form_params.append(("ContentType", params["content_type"]))
173-
if "content_disposition" in params and content_disposition is not None:
174-
form_params.append(("ContentDisposition", params["content_disposition"]))
175-
if "headers" in params and headers is not None:
176-
form_params.append(("Headers", params["headers"]))
177-
if "length" in params and length is not None:
178-
form_params.append(("Length", params["length"]))
179-
if "name" in params and name is not None:
180-
form_params.append(("Name", params["name"]))
181-
if "file_name" in params and file_name is not None:
182-
form_params.append(("FileName", params["file_name"]))
142+
if "file" in params and file is not None:
143+
local_var_files["file"] = params["file"]
183144

184145
body_params = None
185146
# HTTP header 'Accept'
186147
header_params["Accept"] = self.api_client.select_header_accept(
187148
["text/plain", "application/json", "text/json"]
188149
)
189150

190-
# HTTP header 'Content-Type'
191-
header_params["Content-Type"] = self.api_client.select_header_content_type(
192-
["multipart/form-data"]
193-
)
151+
# multipart/form-data request detected. Content-Type header will be
152+
# populated by openapi-common based on request content.
194153

195154
response_type_map = {
196155
200: "str",
@@ -483,6 +442,7 @@ def _v1alpha_job_queue_jobs_id_delete_with_http_info(self, id: "str", **kwargs):
483442
local_var_files = {}
484443

485444
body_params = None
445+
486446
response_type_map = {
487447
200: None,
488448
204: None,
@@ -673,7 +633,7 @@ def _v1alpha_job_queue_jobs_id_outputs_get_with_http_info(
673633

674634
def v1alpha_job_queue_jobs_id_outputsexport_get(
675635
self, *, id: "str", file_name: "str"
676-
) -> "Union[None, SystemIOStream]":
636+
) -> "Union[None, str]":
677637
"""Retrieve a job output file.
678638
679639
This method makes a synchronous HTTP request.
@@ -685,7 +645,7 @@ def v1alpha_job_queue_jobs_id_outputsexport_get(
685645
686646
Returns
687647
-------
688-
Union[None, SystemIOStream]
648+
Union[None, str]
689649
"""
690650
data = self._v1alpha_job_queue_jobs_id_outputsexport_get_with_http_info(
691651
id, file_name, _return_http_data_only=True
@@ -740,11 +700,11 @@ def _v1alpha_job_queue_jobs_id_outputsexport_get_with_http_info(
740700
body_params = None
741701
# HTTP header 'Accept'
742702
header_params["Accept"] = self.api_client.select_header_accept(
743-
["text/plain", "application/json", "text/json"]
703+
["application/octet-stream"]
744704
)
745705

746706
response_type_map = {
747-
200: "SystemIOStream",
707+
200: "file",
748708
404: None,
749709
}
750710

@@ -924,6 +884,7 @@ def _v1alpha_job_queue_jobs_idmove_to_top_post_with_http_info(
924884
local_var_files = {}
925885

926886
body_params = None
887+
927888
response_type_map = {
928889
200: None,
929890
404: None,
@@ -1135,7 +1096,7 @@ def _v1alpha_job_queue_jobs_idretrieve_definition_get_with_http_info(
11351096

11361097
def v1alpha_job_queue_jobs_post(
11371098
self, *, body: "Optional[GrantaServerApiAsyncJobsCreateJobRequest]" = None
1138-
) -> "Union[GrantaServerApiAsyncJobsJob, None]":
1099+
) -> "GrantaServerApiAsyncJobsJob":
11391100
"""Create a new job.
11401101
11411102
This method makes a synchronous HTTP request.
@@ -1146,7 +1107,7 @@ def v1alpha_job_queue_jobs_post(
11461107
11471108
Returns
11481109
-------
1149-
Union[GrantaServerApiAsyncJobsJob, None]
1110+
GrantaServerApiAsyncJobsJob
11501111
"""
11511112
data = self._v1alpha_job_queue_jobs_post_with_http_info(
11521113
body, _return_http_data_only=True
@@ -1204,8 +1165,7 @@ def _v1alpha_job_queue_jobs_post_with_http_info(
12041165
)
12051166

12061167
response_type_map = {
1207-
200: "GrantaServerApiAsyncJobsJob",
1208-
201: None,
1168+
201: "GrantaServerApiAsyncJobsJob",
12091169
}
12101170

12111171
return self.api_client.call_api(

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/license_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/list_item_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/list_management_api.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

@@ -231,6 +232,7 @@ def _api_v1_lists_list_list_identifier_delete_with_http_info(
231232
local_var_files = {}
232233

233234
body_params = None
235+
234236
response_type_map = {
235237
200: None,
236238
403: None,

ansys-grantami-serverapi-openapi/src/ansys/grantami/serverapi_openapi/api/list_permissions_api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"""
1010

1111
import re # noqa: F401
12-
from typing import TYPE_CHECKING, Dict, List, Optional, Union # noqa: F401
12+
from typing import TYPE_CHECKING, Dict, IO, List, Optional, Union # noqa: F401
1313
from . import ApiBase
1414

1515

1616
if TYPE_CHECKING:
17+
import pathlib
1718
from ..models import *
1819

1920

0 commit comments

Comments
 (0)