queueflow 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. queueflow/__init__.py +80 -0
  2. queueflow/api/__init__.py +11 -0
  3. queueflow/api/cron_api.py +1808 -0
  4. queueflow/api/dlq_api.py +996 -0
  5. queueflow/api/health_api.py +527 -0
  6. queueflow/api/jobs_api.py +1830 -0
  7. queueflow/api/system_api.py +523 -0
  8. queueflow/api/worker_api.py +1229 -0
  9. queueflow/api/workflows_api.py +1804 -0
  10. queueflow/api_client.py +797 -0
  11. queueflow/api_response.py +21 -0
  12. queueflow/configuration.py +579 -0
  13. queueflow/exceptions.py +199 -0
  14. queueflow/facade.py +255 -0
  15. queueflow/models/__init__.py +57 -0
  16. queueflow/models/backoff_strategy.py +38 -0
  17. queueflow/models/complete_job_request.py +89 -0
  18. queueflow/models/create_batch_jobs_request.py +95 -0
  19. queueflow/models/create_batch_jobs_response.py +90 -0
  20. queueflow/models/create_cron_request.py +111 -0
  21. queueflow/models/create_cron_response.py +87 -0
  22. queueflow/models/create_job_request.py +108 -0
  23. queueflow/models/create_job_response.py +87 -0
  24. queueflow/models/create_workflow_request.py +101 -0
  25. queueflow/models/create_workflow_response.py +87 -0
  26. queueflow/models/cron_schedule.py +134 -0
  27. queueflow/models/dead_letter.py +136 -0
  28. queueflow/models/error_body.py +90 -0
  29. queueflow/models/fail_job_request.py +91 -0
  30. queueflow/models/health_status.py +92 -0
  31. queueflow/models/heartbeat_request.py +90 -0
  32. queueflow/models/heartbeat_response.py +88 -0
  33. queueflow/models/job.py +172 -0
  34. queueflow/models/job_config.py +106 -0
  35. queueflow/models/job_config_request.py +143 -0
  36. queueflow/models/job_status.py +41 -0
  37. queueflow/models/lease_jobs_request.py +107 -0
  38. queueflow/models/lease_jobs_response.py +95 -0
  39. queueflow/models/leased_job.py +93 -0
  40. queueflow/models/list_crons_response.py +115 -0
  41. queueflow/models/list_dead_letters_response.py +115 -0
  42. queueflow/models/list_jobs_response.py +115 -0
  43. queueflow/models/list_workflows_response.py +115 -0
  44. queueflow/models/on_failure.py +38 -0
  45. queueflow/models/on_success.py +36 -0
  46. queueflow/models/ready_status.py +87 -0
  47. queueflow/models/replay_dead_letter_response.py +87 -0
  48. queueflow/models/stats_snapshot.py +102 -0
  49. queueflow/models/step_status.py +41 -0
  50. queueflow/models/tasks_response.py +87 -0
  51. queueflow/models/workflow.py +130 -0
  52. queueflow/models/workflow_diagram_response.py +89 -0
  53. queueflow/models/workflow_status.py +41 -0
  54. queueflow/models/workflow_step.py +112 -0
  55. queueflow/models/workflow_step_state.py +97 -0
  56. queueflow/models/workflow_step_states_response.py +95 -0
  57. queueflow/py.typed +0 -0
  58. queueflow/rest.py +257 -0
  59. queueflow-0.1.0.dist-info/METADATA +26 -0
  60. queueflow-0.1.0.dist-info/RECORD +62 -0
  61. queueflow-0.1.0.dist-info/WHEEL +5 -0
  62. queueflow-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,523 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ QueueFlow API
5
+
6
+ REST API for QueueFlow, a PostgreSQL-native distributed job queue and workflow engine.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from queueflow.models.stats_snapshot import StatsSnapshot
20
+ from queueflow.models.tasks_response import TasksResponse
21
+
22
+ from queueflow.api_client import ApiClient, RequestSerialized
23
+ from queueflow.api_response import ApiResponse
24
+ from queueflow.rest import RESTResponseType
25
+
26
+
27
+ class SystemApi:
28
+ """NOTE: This class is auto generated by OpenAPI Generator
29
+ Ref: https://openapi-generator.tech
30
+
31
+ Do not edit the class manually.
32
+ """
33
+
34
+ def __init__(self, api_client=None) -> None:
35
+ if api_client is None:
36
+ api_client = ApiClient.get_default()
37
+ self.api_client = api_client
38
+
39
+
40
+ @validate_call
41
+ def get_stats(
42
+ self,
43
+ _request_timeout: Union[
44
+ None,
45
+ Annotated[StrictFloat, Field(gt=0)],
46
+ Tuple[
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Annotated[StrictFloat, Field(gt=0)]
49
+ ]
50
+ ] = None,
51
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
52
+ _content_type: Optional[StrictStr] = None,
53
+ _headers: Optional[Dict[StrictStr, Any]] = None,
54
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
55
+ ) -> StatsSnapshot:
56
+ """get_stats
57
+
58
+
59
+ :param _request_timeout: timeout setting for this request. If one
60
+ number provided, it will be total request
61
+ timeout. It can also be a pair (tuple) of
62
+ (connection, read) timeouts.
63
+ :type _request_timeout: int, tuple(int, int), optional
64
+ :param _request_auth: set to override the auth_settings for an a single
65
+ request; this effectively ignores the
66
+ authentication in the spec for a single request.
67
+ :type _request_auth: dict, optional
68
+ :param _content_type: force content-type for the request.
69
+ :type _content_type: str, Optional
70
+ :param _headers: set to override the headers for a single
71
+ request; this effectively ignores the headers
72
+ in the spec for a single request.
73
+ :type _headers: dict, optional
74
+ :param _host_index: set to override the host_index for a single
75
+ request; this effectively ignores the host_index
76
+ in the spec for a single request.
77
+ :type _host_index: int, optional
78
+ :return: Returns the result object.
79
+ """ # noqa: E501
80
+
81
+ _param = self._get_stats_serialize(
82
+ _request_auth=_request_auth,
83
+ _content_type=_content_type,
84
+ _headers=_headers,
85
+ _host_index=_host_index
86
+ )
87
+
88
+ _response_types_map: Dict[str, Optional[str]] = {
89
+ '200': "StatsSnapshot",
90
+ }
91
+ response_data = self.api_client.call_api(
92
+ *_param,
93
+ _request_timeout=_request_timeout
94
+ )
95
+ response_data.read()
96
+ return self.api_client.response_deserialize(
97
+ response_data=response_data,
98
+ response_types_map=_response_types_map,
99
+ ).data
100
+
101
+
102
+ @validate_call
103
+ def get_stats_with_http_info(
104
+ self,
105
+ _request_timeout: Union[
106
+ None,
107
+ Annotated[StrictFloat, Field(gt=0)],
108
+ Tuple[
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Annotated[StrictFloat, Field(gt=0)]
111
+ ]
112
+ ] = None,
113
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
114
+ _content_type: Optional[StrictStr] = None,
115
+ _headers: Optional[Dict[StrictStr, Any]] = None,
116
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
117
+ ) -> ApiResponse[StatsSnapshot]:
118
+ """get_stats
119
+
120
+
121
+ :param _request_timeout: timeout setting for this request. If one
122
+ number provided, it will be total request
123
+ timeout. It can also be a pair (tuple) of
124
+ (connection, read) timeouts.
125
+ :type _request_timeout: int, tuple(int, int), optional
126
+ :param _request_auth: set to override the auth_settings for an a single
127
+ request; this effectively ignores the
128
+ authentication in the spec for a single request.
129
+ :type _request_auth: dict, optional
130
+ :param _content_type: force content-type for the request.
131
+ :type _content_type: str, Optional
132
+ :param _headers: set to override the headers for a single
133
+ request; this effectively ignores the headers
134
+ in the spec for a single request.
135
+ :type _headers: dict, optional
136
+ :param _host_index: set to override the host_index for a single
137
+ request; this effectively ignores the host_index
138
+ in the spec for a single request.
139
+ :type _host_index: int, optional
140
+ :return: Returns the result object.
141
+ """ # noqa: E501
142
+
143
+ _param = self._get_stats_serialize(
144
+ _request_auth=_request_auth,
145
+ _content_type=_content_type,
146
+ _headers=_headers,
147
+ _host_index=_host_index
148
+ )
149
+
150
+ _response_types_map: Dict[str, Optional[str]] = {
151
+ '200': "StatsSnapshot",
152
+ }
153
+ response_data = self.api_client.call_api(
154
+ *_param,
155
+ _request_timeout=_request_timeout
156
+ )
157
+ response_data.read()
158
+ return self.api_client.response_deserialize(
159
+ response_data=response_data,
160
+ response_types_map=_response_types_map,
161
+ )
162
+
163
+
164
+ @validate_call
165
+ def get_stats_without_preload_content(
166
+ self,
167
+ _request_timeout: Union[
168
+ None,
169
+ Annotated[StrictFloat, Field(gt=0)],
170
+ Tuple[
171
+ Annotated[StrictFloat, Field(gt=0)],
172
+ Annotated[StrictFloat, Field(gt=0)]
173
+ ]
174
+ ] = None,
175
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
176
+ _content_type: Optional[StrictStr] = None,
177
+ _headers: Optional[Dict[StrictStr, Any]] = None,
178
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
179
+ ) -> RESTResponseType:
180
+ """get_stats
181
+
182
+
183
+ :param _request_timeout: timeout setting for this request. If one
184
+ number provided, it will be total request
185
+ timeout. It can also be a pair (tuple) of
186
+ (connection, read) timeouts.
187
+ :type _request_timeout: int, tuple(int, int), optional
188
+ :param _request_auth: set to override the auth_settings for an a single
189
+ request; this effectively ignores the
190
+ authentication in the spec for a single request.
191
+ :type _request_auth: dict, optional
192
+ :param _content_type: force content-type for the request.
193
+ :type _content_type: str, Optional
194
+ :param _headers: set to override the headers for a single
195
+ request; this effectively ignores the headers
196
+ in the spec for a single request.
197
+ :type _headers: dict, optional
198
+ :param _host_index: set to override the host_index for a single
199
+ request; this effectively ignores the host_index
200
+ in the spec for a single request.
201
+ :type _host_index: int, optional
202
+ :return: Returns the result object.
203
+ """ # noqa: E501
204
+
205
+ _param = self._get_stats_serialize(
206
+ _request_auth=_request_auth,
207
+ _content_type=_content_type,
208
+ _headers=_headers,
209
+ _host_index=_host_index
210
+ )
211
+
212
+ _response_types_map: Dict[str, Optional[str]] = {
213
+ '200': "StatsSnapshot",
214
+ }
215
+ response_data = self.api_client.call_api(
216
+ *_param,
217
+ _request_timeout=_request_timeout
218
+ )
219
+ return response_data.response
220
+
221
+
222
+ def _get_stats_serialize(
223
+ self,
224
+ _request_auth,
225
+ _content_type,
226
+ _headers,
227
+ _host_index,
228
+ ) -> RequestSerialized:
229
+
230
+ _host = None
231
+
232
+ _collection_formats: Dict[str, str] = {
233
+ }
234
+
235
+ _path_params: Dict[str, str] = {}
236
+ _query_params: List[Tuple[str, str]] = []
237
+ _header_params: Dict[str, Optional[str]] = _headers or {}
238
+ _form_params: List[Tuple[str, str]] = []
239
+ _files: Dict[
240
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
241
+ ] = {}
242
+ _body_params: Optional[bytes] = None
243
+
244
+ # process the path parameters
245
+ # process the query parameters
246
+ # process the header parameters
247
+ # process the form parameters
248
+ # process the body parameter
249
+
250
+
251
+ # set the HTTP header `Accept`
252
+ if 'Accept' not in _header_params:
253
+ _header_params['Accept'] = self.api_client.select_header_accept(
254
+ [
255
+ 'application/json'
256
+ ]
257
+ )
258
+
259
+
260
+ # authentication setting
261
+ _auth_settings: List[str] = [
262
+ 'bearerAuth'
263
+ ]
264
+
265
+ return self.api_client.param_serialize(
266
+ method='GET',
267
+ resource_path='/api/v1/stats',
268
+ path_params=_path_params,
269
+ query_params=_query_params,
270
+ header_params=_header_params,
271
+ body=_body_params,
272
+ post_params=_form_params,
273
+ files=_files,
274
+ auth_settings=_auth_settings,
275
+ collection_formats=_collection_formats,
276
+ _host=_host,
277
+ _request_auth=_request_auth
278
+ )
279
+
280
+
281
+
282
+
283
+ @validate_call
284
+ def list_tasks(
285
+ self,
286
+ _request_timeout: Union[
287
+ None,
288
+ Annotated[StrictFloat, Field(gt=0)],
289
+ Tuple[
290
+ Annotated[StrictFloat, Field(gt=0)],
291
+ Annotated[StrictFloat, Field(gt=0)]
292
+ ]
293
+ ] = None,
294
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
295
+ _content_type: Optional[StrictStr] = None,
296
+ _headers: Optional[Dict[StrictStr, Any]] = None,
297
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
298
+ ) -> TasksResponse:
299
+ """list_tasks
300
+
301
+
302
+ :param _request_timeout: timeout setting for this request. If one
303
+ number provided, it will be total request
304
+ timeout. It can also be a pair (tuple) of
305
+ (connection, read) timeouts.
306
+ :type _request_timeout: int, tuple(int, int), optional
307
+ :param _request_auth: set to override the auth_settings for an a single
308
+ request; this effectively ignores the
309
+ authentication in the spec for a single request.
310
+ :type _request_auth: dict, optional
311
+ :param _content_type: force content-type for the request.
312
+ :type _content_type: str, Optional
313
+ :param _headers: set to override the headers for a single
314
+ request; this effectively ignores the headers
315
+ in the spec for a single request.
316
+ :type _headers: dict, optional
317
+ :param _host_index: set to override the host_index for a single
318
+ request; this effectively ignores the host_index
319
+ in the spec for a single request.
320
+ :type _host_index: int, optional
321
+ :return: Returns the result object.
322
+ """ # noqa: E501
323
+
324
+ _param = self._list_tasks_serialize(
325
+ _request_auth=_request_auth,
326
+ _content_type=_content_type,
327
+ _headers=_headers,
328
+ _host_index=_host_index
329
+ )
330
+
331
+ _response_types_map: Dict[str, Optional[str]] = {
332
+ '200': "TasksResponse",
333
+ }
334
+ response_data = self.api_client.call_api(
335
+ *_param,
336
+ _request_timeout=_request_timeout
337
+ )
338
+ response_data.read()
339
+ return self.api_client.response_deserialize(
340
+ response_data=response_data,
341
+ response_types_map=_response_types_map,
342
+ ).data
343
+
344
+
345
+ @validate_call
346
+ def list_tasks_with_http_info(
347
+ self,
348
+ _request_timeout: Union[
349
+ None,
350
+ Annotated[StrictFloat, Field(gt=0)],
351
+ Tuple[
352
+ Annotated[StrictFloat, Field(gt=0)],
353
+ Annotated[StrictFloat, Field(gt=0)]
354
+ ]
355
+ ] = None,
356
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
357
+ _content_type: Optional[StrictStr] = None,
358
+ _headers: Optional[Dict[StrictStr, Any]] = None,
359
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
360
+ ) -> ApiResponse[TasksResponse]:
361
+ """list_tasks
362
+
363
+
364
+ :param _request_timeout: timeout setting for this request. If one
365
+ number provided, it will be total request
366
+ timeout. It can also be a pair (tuple) of
367
+ (connection, read) timeouts.
368
+ :type _request_timeout: int, tuple(int, int), optional
369
+ :param _request_auth: set to override the auth_settings for an a single
370
+ request; this effectively ignores the
371
+ authentication in the spec for a single request.
372
+ :type _request_auth: dict, optional
373
+ :param _content_type: force content-type for the request.
374
+ :type _content_type: str, Optional
375
+ :param _headers: set to override the headers for a single
376
+ request; this effectively ignores the headers
377
+ in the spec for a single request.
378
+ :type _headers: dict, optional
379
+ :param _host_index: set to override the host_index for a single
380
+ request; this effectively ignores the host_index
381
+ in the spec for a single request.
382
+ :type _host_index: int, optional
383
+ :return: Returns the result object.
384
+ """ # noqa: E501
385
+
386
+ _param = self._list_tasks_serialize(
387
+ _request_auth=_request_auth,
388
+ _content_type=_content_type,
389
+ _headers=_headers,
390
+ _host_index=_host_index
391
+ )
392
+
393
+ _response_types_map: Dict[str, Optional[str]] = {
394
+ '200': "TasksResponse",
395
+ }
396
+ response_data = self.api_client.call_api(
397
+ *_param,
398
+ _request_timeout=_request_timeout
399
+ )
400
+ response_data.read()
401
+ return self.api_client.response_deserialize(
402
+ response_data=response_data,
403
+ response_types_map=_response_types_map,
404
+ )
405
+
406
+
407
+ @validate_call
408
+ def list_tasks_without_preload_content(
409
+ self,
410
+ _request_timeout: Union[
411
+ None,
412
+ Annotated[StrictFloat, Field(gt=0)],
413
+ Tuple[
414
+ Annotated[StrictFloat, Field(gt=0)],
415
+ Annotated[StrictFloat, Field(gt=0)]
416
+ ]
417
+ ] = None,
418
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
419
+ _content_type: Optional[StrictStr] = None,
420
+ _headers: Optional[Dict[StrictStr, Any]] = None,
421
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
422
+ ) -> RESTResponseType:
423
+ """list_tasks
424
+
425
+
426
+ :param _request_timeout: timeout setting for this request. If one
427
+ number provided, it will be total request
428
+ timeout. It can also be a pair (tuple) of
429
+ (connection, read) timeouts.
430
+ :type _request_timeout: int, tuple(int, int), optional
431
+ :param _request_auth: set to override the auth_settings for an a single
432
+ request; this effectively ignores the
433
+ authentication in the spec for a single request.
434
+ :type _request_auth: dict, optional
435
+ :param _content_type: force content-type for the request.
436
+ :type _content_type: str, Optional
437
+ :param _headers: set to override the headers for a single
438
+ request; this effectively ignores the headers
439
+ in the spec for a single request.
440
+ :type _headers: dict, optional
441
+ :param _host_index: set to override the host_index for a single
442
+ request; this effectively ignores the host_index
443
+ in the spec for a single request.
444
+ :type _host_index: int, optional
445
+ :return: Returns the result object.
446
+ """ # noqa: E501
447
+
448
+ _param = self._list_tasks_serialize(
449
+ _request_auth=_request_auth,
450
+ _content_type=_content_type,
451
+ _headers=_headers,
452
+ _host_index=_host_index
453
+ )
454
+
455
+ _response_types_map: Dict[str, Optional[str]] = {
456
+ '200': "TasksResponse",
457
+ }
458
+ response_data = self.api_client.call_api(
459
+ *_param,
460
+ _request_timeout=_request_timeout
461
+ )
462
+ return response_data.response
463
+
464
+
465
+ def _list_tasks_serialize(
466
+ self,
467
+ _request_auth,
468
+ _content_type,
469
+ _headers,
470
+ _host_index,
471
+ ) -> RequestSerialized:
472
+
473
+ _host = None
474
+
475
+ _collection_formats: Dict[str, str] = {
476
+ }
477
+
478
+ _path_params: Dict[str, str] = {}
479
+ _query_params: List[Tuple[str, str]] = []
480
+ _header_params: Dict[str, Optional[str]] = _headers or {}
481
+ _form_params: List[Tuple[str, str]] = []
482
+ _files: Dict[
483
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
484
+ ] = {}
485
+ _body_params: Optional[bytes] = None
486
+
487
+ # process the path parameters
488
+ # process the query parameters
489
+ # process the header parameters
490
+ # process the form parameters
491
+ # process the body parameter
492
+
493
+
494
+ # set the HTTP header `Accept`
495
+ if 'Accept' not in _header_params:
496
+ _header_params['Accept'] = self.api_client.select_header_accept(
497
+ [
498
+ 'application/json'
499
+ ]
500
+ )
501
+
502
+
503
+ # authentication setting
504
+ _auth_settings: List[str] = [
505
+ 'bearerAuth'
506
+ ]
507
+
508
+ return self.api_client.param_serialize(
509
+ method='GET',
510
+ resource_path='/api/v1/tasks',
511
+ path_params=_path_params,
512
+ query_params=_query_params,
513
+ header_params=_header_params,
514
+ body=_body_params,
515
+ post_params=_form_params,
516
+ files=_files,
517
+ auth_settings=_auth_settings,
518
+ collection_formats=_collection_formats,
519
+ _host=_host,
520
+ _request_auth=_request_auth
521
+ )
522
+
523
+