Skip to content

Commit 44b1979

Browse files
committed
[QI2-1143] Implemented dummy compile endpoint
1 parent 3e5d2d7 commit 44b1979

File tree

10 files changed

+555
-2
lines changed

10 files changed

+555
-2
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ compute_api_client/docs/BatchJobsApi.md
4141
compute_api_client/docs/Commit.md
4242
compute_api_client/docs/CommitIn.md
4343
compute_api_client/docs/CommitsApi.md
44+
compute_api_client/docs/CompilePayload.md
4445
compute_api_client/docs/CompileStage.md
4546
compute_api_client/docs/Domain.md
4647
compute_api_client/docs/File.md
@@ -123,6 +124,7 @@ compute_api_client/models/batch_job_in.py
123124
compute_api_client/models/batch_job_status.py
124125
compute_api_client/models/commit.py
125126
compute_api_client/models/commit_in.py
127+
compute_api_client/models/compile_payload.py
126128
compute_api_client/models/compile_stage.py
127129
compute_api_client/models/domain.py
128130
compute_api_client/models/file.py

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Class | Method | HTTP request | Description
8989
*BatchJobsApi* | [**pop_batch_job_batch_jobs_pop_patch**](compute_api_client/docs/BatchJobsApi.md#pop_batch_job_batch_jobs_pop_patch) | **PATCH** /batch_jobs/pop | Take batch job
9090
*BatchJobsApi* | [**read_batch_jobs_batch_jobs_get**](compute_api_client/docs/BatchJobsApi.md#read_batch_jobs_batch_jobs_get) | **GET** /batch_jobs | List batch jobs
9191
*BatchJobsApi* | [**unpop_batch_job_batch_jobs_unpop_patch**](compute_api_client/docs/BatchJobsApi.md#unpop_batch_job_batch_jobs_unpop_patch) | **PATCH** /batch_jobs/unpop | Take batch job
92+
*CommitsApi* | [**compile_commit_commits_id_compile_post**](compute_api_client/docs/CommitsApi.md#compile_commit_commits_id_compile_post) | **POST** /commits/{id}/compile | Compile file in a commit
9293
*CommitsApi* | [**create_commit_commits_post**](compute_api_client/docs/CommitsApi.md#create_commit_commits_post) | **POST** /commits | Create commit
9394
*CommitsApi* | [**delete_commit_commits_id_delete**](compute_api_client/docs/CommitsApi.md#delete_commit_commits_id_delete) | **DELETE** /commits/{id} | Destroy commit
9495
*CommitsApi* | [**read_commit_commits_id_get**](compute_api_client/docs/CommitsApi.md#read_commit_commits_id_get) | **GET** /commits/{id} | Get commit by ID
@@ -160,6 +161,7 @@ Class | Method | HTTP request | Description
160161
- [BatchJobStatus](compute_api_client/docs/BatchJobStatus.md)
161162
- [Commit](compute_api_client/docs/Commit.md)
162163
- [CommitIn](compute_api_client/docs/CommitIn.md)
164+
- [CompilePayload](compute_api_client/docs/CompilePayload.md)
163165
- [CompileStage](compute_api_client/docs/CompileStage.md)
164166
- [Domain](compute_api_client/docs/Domain.md)
165167
- [File](compute_api_client/docs/File.md)
@@ -224,7 +226,7 @@ Authentication schemes defined for the API:
224226

225227
- **Type**: OAuth
226228
- **Flow**: accessCode
227-
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_development/protocol/openid-connect/auth
229+
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_staging/protocol/openid-connect/auth
228230
- **Scopes**: N/A
229231

230232
<a id="backend"></a>

compute_api_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
from compute_api_client.models.batch_job_status import BatchJobStatus
6464
from compute_api_client.models.commit import Commit
6565
from compute_api_client.models.commit_in import CommitIn
66+
from compute_api_client.models.compile_payload import CompilePayload
6667
from compute_api_client.models.compile_stage import CompileStage
6768
from compute_api_client.models.domain import Domain
6869
from compute_api_client.models.file import File

compute_api_client/api/commits_api.py

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
from compute_api_client.models.commit import Commit
3535
from compute_api_client.models.commit_in import CommitIn
36+
from compute_api_client.models.compile_payload import CompilePayload
3637
from compute_api_client.models.page_commit import PageCommit
3738

3839
from compute_api_client.api_client import ApiClient
@@ -53,6 +54,294 @@ def __init__(self, api_client=None) -> None:
5354
self.api_client = api_client
5455

5556

57+
@validate_call
58+
async def compile_commit_commits_id_compile_post(
59+
self,
60+
id: StrictInt,
61+
compile_payload: CompilePayload,
62+
_request_timeout: Union[
63+
None,
64+
Annotated[StrictFloat, Field(gt=0)],
65+
Tuple[
66+
Annotated[StrictFloat, Field(gt=0)],
67+
Annotated[StrictFloat, Field(gt=0)]
68+
]
69+
] = None,
70+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
71+
_content_type: Optional[StrictStr] = None,
72+
_headers: Optional[Dict[StrictStr, Any]] = None,
73+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
74+
) -> None:
75+
"""Compile file in a commit
76+
77+
Get commit by ID.
78+
79+
:param id: (required)
80+
:type id: int
81+
:param compile_payload: (required)
82+
:type compile_payload: CompilePayload
83+
:param _request_timeout: timeout setting for this request. If one
84+
number provided, it will be total request
85+
timeout. It can also be a pair (tuple) of
86+
(connection, read) timeouts.
87+
:type _request_timeout: int, tuple(int, int), optional
88+
:param _request_auth: set to override the auth_settings for an a single
89+
request; this effectively ignores the
90+
authentication in the spec for a single request.
91+
:type _request_auth: dict, optional
92+
:param _content_type: force content-type for the request.
93+
:type _content_type: str, Optional
94+
:param _headers: set to override the headers for a single
95+
request; this effectively ignores the headers
96+
in the spec for a single request.
97+
:type _headers: dict, optional
98+
:param _host_index: set to override the host_index for a single
99+
request; this effectively ignores the host_index
100+
in the spec for a single request.
101+
:type _host_index: int, optional
102+
:return: Returns the result object.
103+
""" # noqa: E501
104+
105+
_param = self._compile_commit_commits_id_compile_post_serialize(
106+
id=id,
107+
compile_payload=compile_payload,
108+
_request_auth=_request_auth,
109+
_content_type=_content_type,
110+
_headers=_headers,
111+
_host_index=_host_index
112+
)
113+
114+
_response_types_map: Dict[str, Optional[str]] = {
115+
116+
}
117+
response_data = await self.api_client.call_api(
118+
*_param,
119+
_request_timeout=_request_timeout
120+
)
121+
await response_data.read()
122+
return self.api_client.response_deserialize(
123+
response_data=response_data,
124+
response_types_map=_response_types_map,
125+
).data
126+
127+
128+
@validate_call
129+
async def compile_commit_commits_id_compile_post_with_http_info(
130+
self,
131+
id: StrictInt,
132+
compile_payload: CompilePayload,
133+
_request_timeout: Union[
134+
None,
135+
Annotated[StrictFloat, Field(gt=0)],
136+
Tuple[
137+
Annotated[StrictFloat, Field(gt=0)],
138+
Annotated[StrictFloat, Field(gt=0)]
139+
]
140+
] = None,
141+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
142+
_content_type: Optional[StrictStr] = None,
143+
_headers: Optional[Dict[StrictStr, Any]] = None,
144+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
145+
) -> ApiResponse[None]:
146+
"""Compile file in a commit
147+
148+
Get commit by ID.
149+
150+
:param id: (required)
151+
:type id: int
152+
:param compile_payload: (required)
153+
:type compile_payload: CompilePayload
154+
:param _request_timeout: timeout setting for this request. If one
155+
number provided, it will be total request
156+
timeout. It can also be a pair (tuple) of
157+
(connection, read) timeouts.
158+
:type _request_timeout: int, tuple(int, int), optional
159+
:param _request_auth: set to override the auth_settings for an a single
160+
request; this effectively ignores the
161+
authentication in the spec for a single request.
162+
:type _request_auth: dict, optional
163+
:param _content_type: force content-type for the request.
164+
:type _content_type: str, Optional
165+
:param _headers: set to override the headers for a single
166+
request; this effectively ignores the headers
167+
in the spec for a single request.
168+
:type _headers: dict, optional
169+
:param _host_index: set to override the host_index for a single
170+
request; this effectively ignores the host_index
171+
in the spec for a single request.
172+
:type _host_index: int, optional
173+
:return: Returns the result object.
174+
""" # noqa: E501
175+
176+
_param = self._compile_commit_commits_id_compile_post_serialize(
177+
id=id,
178+
compile_payload=compile_payload,
179+
_request_auth=_request_auth,
180+
_content_type=_content_type,
181+
_headers=_headers,
182+
_host_index=_host_index
183+
)
184+
185+
_response_types_map: Dict[str, Optional[str]] = {
186+
187+
}
188+
response_data = await self.api_client.call_api(
189+
*_param,
190+
_request_timeout=_request_timeout
191+
)
192+
await response_data.read()
193+
return self.api_client.response_deserialize(
194+
response_data=response_data,
195+
response_types_map=_response_types_map,
196+
)
197+
198+
199+
@validate_call
200+
async def compile_commit_commits_id_compile_post_without_preload_content(
201+
self,
202+
id: StrictInt,
203+
compile_payload: CompilePayload,
204+
_request_timeout: Union[
205+
None,
206+
Annotated[StrictFloat, Field(gt=0)],
207+
Tuple[
208+
Annotated[StrictFloat, Field(gt=0)],
209+
Annotated[StrictFloat, Field(gt=0)]
210+
]
211+
] = None,
212+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
213+
_content_type: Optional[StrictStr] = None,
214+
_headers: Optional[Dict[StrictStr, Any]] = None,
215+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
216+
) -> RESTResponseType:
217+
"""Compile file in a commit
218+
219+
Get commit by ID.
220+
221+
:param id: (required)
222+
:type id: int
223+
:param compile_payload: (required)
224+
:type compile_payload: CompilePayload
225+
:param _request_timeout: timeout setting for this request. If one
226+
number provided, it will be total request
227+
timeout. It can also be a pair (tuple) of
228+
(connection, read) timeouts.
229+
:type _request_timeout: int, tuple(int, int), optional
230+
:param _request_auth: set to override the auth_settings for an a single
231+
request; this effectively ignores the
232+
authentication in the spec for a single request.
233+
:type _request_auth: dict, optional
234+
:param _content_type: force content-type for the request.
235+
:type _content_type: str, Optional
236+
:param _headers: set to override the headers for a single
237+
request; this effectively ignores the headers
238+
in the spec for a single request.
239+
:type _headers: dict, optional
240+
:param _host_index: set to override the host_index for a single
241+
request; this effectively ignores the host_index
242+
in the spec for a single request.
243+
:type _host_index: int, optional
244+
:return: Returns the result object.
245+
""" # noqa: E501
246+
247+
_param = self._compile_commit_commits_id_compile_post_serialize(
248+
id=id,
249+
compile_payload=compile_payload,
250+
_request_auth=_request_auth,
251+
_content_type=_content_type,
252+
_headers=_headers,
253+
_host_index=_host_index
254+
)
255+
256+
_response_types_map: Dict[str, Optional[str]] = {
257+
258+
}
259+
response_data = await self.api_client.call_api(
260+
*_param,
261+
_request_timeout=_request_timeout
262+
)
263+
return response_data.response
264+
265+
266+
def _compile_commit_commits_id_compile_post_serialize(
267+
self,
268+
id,
269+
compile_payload,
270+
_request_auth,
271+
_content_type,
272+
_headers,
273+
_host_index,
274+
) -> Tuple:
275+
276+
_host = None
277+
278+
_collection_formats: Dict[str, str] = {
279+
280+
}
281+
282+
_path_params: Dict[str, str] = {}
283+
_query_params: List[Tuple[str, str]] = []
284+
_header_params: Dict[str, Optional[str]] = _headers or {}
285+
_form_params: List[Tuple[str, str]] = []
286+
_files: Dict[str, str] = {}
287+
_body_params: Optional[bytes] = None
288+
289+
# process the path parameters
290+
if id is not None:
291+
_path_params['id'] = id
292+
# process the query parameters
293+
# process the header parameters
294+
# process the form parameters
295+
# process the body parameter
296+
if compile_payload is not None:
297+
_body_params = compile_payload
298+
299+
300+
# set the HTTP header `Accept`
301+
_header_params['Accept'] = self.api_client.select_header_accept(
302+
[
303+
'application/json'
304+
]
305+
)
306+
307+
# set the HTTP header `Content-Type`
308+
if _content_type:
309+
_header_params['Content-Type'] = _content_type
310+
else:
311+
_default_content_type = (
312+
self.api_client.select_header_content_type(
313+
[
314+
'application/json'
315+
]
316+
)
317+
)
318+
if _default_content_type is not None:
319+
_header_params['Content-Type'] = _default_content_type
320+
321+
# authentication setting
322+
_auth_settings: List[str] = [
323+
'user_bearer',
324+
'backend'
325+
]
326+
327+
return self.api_client.param_serialize(
328+
method='POST',
329+
resource_path='/commits/{id}/compile',
330+
path_params=_path_params,
331+
query_params=_query_params,
332+
header_params=_header_params,
333+
body=_body_params,
334+
post_params=_form_params,
335+
files=_files,
336+
auth_settings=_auth_settings,
337+
collection_formats=_collection_formats,
338+
_host=_host,
339+
_request_auth=_request_auth
340+
)
341+
342+
343+
344+
56345
@validate_call
57346
async def create_commit_commits_post(
58347
self,

0 commit comments

Comments
 (0)