9
9
"""
10
10
11
11
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
13
13
from . import ApiBase
14
14
15
15
16
16
if TYPE_CHECKING :
17
+ import pathlib
17
18
from ..models import *
18
19
19
20
@@ -90,60 +91,30 @@ def _v1alpha_job_queue_current_user_get_with_http_info(self, **kwargs):
90
91
)
91
92
92
93
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
101
95
) -> "str" :
102
96
"""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.
103
97
104
98
This method makes a synchronous HTTP request.
105
99
106
100
Parameters
107
101
----------
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]
114
103
115
104
Returns
116
105
-------
117
106
str
118
107
"""
119
108
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
127
110
)
128
111
return data # type: ignore[return-value]
129
112
130
113
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
139
115
):
140
116
all_params = [
141
- "content_type" ,
142
- "content_disposition" ,
143
- "headers" ,
144
- "length" ,
145
- "name" ,
146
- "file_name" ,
117
+ "file" ,
147
118
"_return_http_data_only" ,
148
119
"_preload_content" ,
149
120
"_request_timeout" ,
@@ -168,29 +139,17 @@ def _v1alpha_job_queue_files_post_with_http_info(
168
139
169
140
form_params = []
170
141
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" ]
183
144
184
145
body_params = None
185
146
# HTTP header 'Accept'
186
147
header_params ["Accept" ] = self .api_client .select_header_accept (
187
148
["text/plain" , "application/json" , "text/json" ]
188
149
)
189
150
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.
194
153
195
154
response_type_map = {
196
155
200 : "str" ,
@@ -483,6 +442,7 @@ def _v1alpha_job_queue_jobs_id_delete_with_http_info(self, id: "str", **kwargs):
483
442
local_var_files = {}
484
443
485
444
body_params = None
445
+
486
446
response_type_map = {
487
447
200 : None ,
488
448
204 : None ,
@@ -673,7 +633,7 @@ def _v1alpha_job_queue_jobs_id_outputs_get_with_http_info(
673
633
674
634
def v1alpha_job_queue_jobs_id_outputsexport_get (
675
635
self , * , id : "str" , file_name : "str"
676
- ) -> "Union[None, SystemIOStream ]" :
636
+ ) -> "Union[None, str ]" :
677
637
"""Retrieve a job output file.
678
638
679
639
This method makes a synchronous HTTP request.
@@ -685,7 +645,7 @@ def v1alpha_job_queue_jobs_id_outputsexport_get(
685
645
686
646
Returns
687
647
-------
688
- Union[None, SystemIOStream ]
648
+ Union[None, str ]
689
649
"""
690
650
data = self ._v1alpha_job_queue_jobs_id_outputsexport_get_with_http_info (
691
651
id , file_name , _return_http_data_only = True
@@ -740,11 +700,11 @@ def _v1alpha_job_queue_jobs_id_outputsexport_get_with_http_info(
740
700
body_params = None
741
701
# HTTP header 'Accept'
742
702
header_params ["Accept" ] = self .api_client .select_header_accept (
743
- ["text/plain" , " application/json" , "text/json " ]
703
+ ["application/octet-stream " ]
744
704
)
745
705
746
706
response_type_map = {
747
- 200 : "SystemIOStream " ,
707
+ 200 : "file " ,
748
708
404 : None ,
749
709
}
750
710
@@ -924,6 +884,7 @@ def _v1alpha_job_queue_jobs_idmove_to_top_post_with_http_info(
924
884
local_var_files = {}
925
885
926
886
body_params = None
887
+
927
888
response_type_map = {
928
889
200 : None ,
929
890
404 : None ,
@@ -1135,7 +1096,7 @@ def _v1alpha_job_queue_jobs_idretrieve_definition_get_with_http_info(
1135
1096
1136
1097
def v1alpha_job_queue_jobs_post (
1137
1098
self , * , body : "Optional[GrantaServerApiAsyncJobsCreateJobRequest]" = None
1138
- ) -> "Union[ GrantaServerApiAsyncJobsJob, None] " :
1099
+ ) -> "GrantaServerApiAsyncJobsJob" :
1139
1100
"""Create a new job.
1140
1101
1141
1102
This method makes a synchronous HTTP request.
@@ -1146,7 +1107,7 @@ def v1alpha_job_queue_jobs_post(
1146
1107
1147
1108
Returns
1148
1109
-------
1149
- Union[ GrantaServerApiAsyncJobsJob, None]
1110
+ GrantaServerApiAsyncJobsJob
1150
1111
"""
1151
1112
data = self ._v1alpha_job_queue_jobs_post_with_http_info (
1152
1113
body , _return_http_data_only = True
@@ -1204,8 +1165,7 @@ def _v1alpha_job_queue_jobs_post_with_http_info(
1204
1165
)
1205
1166
1206
1167
response_type_map = {
1207
- 200 : "GrantaServerApiAsyncJobsJob" ,
1208
- 201 : None ,
1168
+ 201 : "GrantaServerApiAsyncJobsJob" ,
1209
1169
}
1210
1170
1211
1171
return self .api_client .call_api (
0 commit comments