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,527 @@
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.health_status import HealthStatus
20
+ from queueflow.models.ready_status import ReadyStatus
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 HealthApi:
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_health(
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
+ ) -> HealthStatus:
56
+ """get_health
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_health_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': "HealthStatus",
90
+ '503': "ErrorBody",
91
+ }
92
+ response_data = self.api_client.call_api(
93
+ *_param,
94
+ _request_timeout=_request_timeout
95
+ )
96
+ response_data.read()
97
+ return self.api_client.response_deserialize(
98
+ response_data=response_data,
99
+ response_types_map=_response_types_map,
100
+ ).data
101
+
102
+
103
+ @validate_call
104
+ def get_health_with_http_info(
105
+ self,
106
+ _request_timeout: Union[
107
+ None,
108
+ Annotated[StrictFloat, Field(gt=0)],
109
+ Tuple[
110
+ Annotated[StrictFloat, Field(gt=0)],
111
+ Annotated[StrictFloat, Field(gt=0)]
112
+ ]
113
+ ] = None,
114
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
115
+ _content_type: Optional[StrictStr] = None,
116
+ _headers: Optional[Dict[StrictStr, Any]] = None,
117
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
118
+ ) -> ApiResponse[HealthStatus]:
119
+ """get_health
120
+
121
+
122
+ :param _request_timeout: timeout setting for this request. If one
123
+ number provided, it will be total request
124
+ timeout. It can also be a pair (tuple) of
125
+ (connection, read) timeouts.
126
+ :type _request_timeout: int, tuple(int, int), optional
127
+ :param _request_auth: set to override the auth_settings for an a single
128
+ request; this effectively ignores the
129
+ authentication in the spec for a single request.
130
+ :type _request_auth: dict, optional
131
+ :param _content_type: force content-type for the request.
132
+ :type _content_type: str, Optional
133
+ :param _headers: set to override the headers for a single
134
+ request; this effectively ignores the headers
135
+ in the spec for a single request.
136
+ :type _headers: dict, optional
137
+ :param _host_index: set to override the host_index for a single
138
+ request; this effectively ignores the host_index
139
+ in the spec for a single request.
140
+ :type _host_index: int, optional
141
+ :return: Returns the result object.
142
+ """ # noqa: E501
143
+
144
+ _param = self._get_health_serialize(
145
+ _request_auth=_request_auth,
146
+ _content_type=_content_type,
147
+ _headers=_headers,
148
+ _host_index=_host_index
149
+ )
150
+
151
+ _response_types_map: Dict[str, Optional[str]] = {
152
+ '200': "HealthStatus",
153
+ '503': "ErrorBody",
154
+ }
155
+ response_data = self.api_client.call_api(
156
+ *_param,
157
+ _request_timeout=_request_timeout
158
+ )
159
+ response_data.read()
160
+ return self.api_client.response_deserialize(
161
+ response_data=response_data,
162
+ response_types_map=_response_types_map,
163
+ )
164
+
165
+
166
+ @validate_call
167
+ def get_health_without_preload_content(
168
+ self,
169
+ _request_timeout: Union[
170
+ None,
171
+ Annotated[StrictFloat, Field(gt=0)],
172
+ Tuple[
173
+ Annotated[StrictFloat, Field(gt=0)],
174
+ Annotated[StrictFloat, Field(gt=0)]
175
+ ]
176
+ ] = None,
177
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
178
+ _content_type: Optional[StrictStr] = None,
179
+ _headers: Optional[Dict[StrictStr, Any]] = None,
180
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
181
+ ) -> RESTResponseType:
182
+ """get_health
183
+
184
+
185
+ :param _request_timeout: timeout setting for this request. If one
186
+ number provided, it will be total request
187
+ timeout. It can also be a pair (tuple) of
188
+ (connection, read) timeouts.
189
+ :type _request_timeout: int, tuple(int, int), optional
190
+ :param _request_auth: set to override the auth_settings for an a single
191
+ request; this effectively ignores the
192
+ authentication in the spec for a single request.
193
+ :type _request_auth: dict, optional
194
+ :param _content_type: force content-type for the request.
195
+ :type _content_type: str, Optional
196
+ :param _headers: set to override the headers for a single
197
+ request; this effectively ignores the headers
198
+ in the spec for a single request.
199
+ :type _headers: dict, optional
200
+ :param _host_index: set to override the host_index for a single
201
+ request; this effectively ignores the host_index
202
+ in the spec for a single request.
203
+ :type _host_index: int, optional
204
+ :return: Returns the result object.
205
+ """ # noqa: E501
206
+
207
+ _param = self._get_health_serialize(
208
+ _request_auth=_request_auth,
209
+ _content_type=_content_type,
210
+ _headers=_headers,
211
+ _host_index=_host_index
212
+ )
213
+
214
+ _response_types_map: Dict[str, Optional[str]] = {
215
+ '200': "HealthStatus",
216
+ '503': "ErrorBody",
217
+ }
218
+ response_data = self.api_client.call_api(
219
+ *_param,
220
+ _request_timeout=_request_timeout
221
+ )
222
+ return response_data.response
223
+
224
+
225
+ def _get_health_serialize(
226
+ self,
227
+ _request_auth,
228
+ _content_type,
229
+ _headers,
230
+ _host_index,
231
+ ) -> RequestSerialized:
232
+
233
+ _host = None
234
+
235
+ _collection_formats: Dict[str, str] = {
236
+ }
237
+
238
+ _path_params: Dict[str, str] = {}
239
+ _query_params: List[Tuple[str, str]] = []
240
+ _header_params: Dict[str, Optional[str]] = _headers or {}
241
+ _form_params: List[Tuple[str, str]] = []
242
+ _files: Dict[
243
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
244
+ ] = {}
245
+ _body_params: Optional[bytes] = None
246
+
247
+ # process the path parameters
248
+ # process the query parameters
249
+ # process the header parameters
250
+ # process the form parameters
251
+ # process the body parameter
252
+
253
+
254
+ # set the HTTP header `Accept`
255
+ if 'Accept' not in _header_params:
256
+ _header_params['Accept'] = self.api_client.select_header_accept(
257
+ [
258
+ 'application/json'
259
+ ]
260
+ )
261
+
262
+
263
+ # authentication setting
264
+ _auth_settings: List[str] = [
265
+ ]
266
+
267
+ return self.api_client.param_serialize(
268
+ method='GET',
269
+ resource_path='/health',
270
+ path_params=_path_params,
271
+ query_params=_query_params,
272
+ header_params=_header_params,
273
+ body=_body_params,
274
+ post_params=_form_params,
275
+ files=_files,
276
+ auth_settings=_auth_settings,
277
+ collection_formats=_collection_formats,
278
+ _host=_host,
279
+ _request_auth=_request_auth
280
+ )
281
+
282
+
283
+
284
+
285
+ @validate_call
286
+ def get_ready(
287
+ self,
288
+ _request_timeout: Union[
289
+ None,
290
+ Annotated[StrictFloat, Field(gt=0)],
291
+ Tuple[
292
+ Annotated[StrictFloat, Field(gt=0)],
293
+ Annotated[StrictFloat, Field(gt=0)]
294
+ ]
295
+ ] = None,
296
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
297
+ _content_type: Optional[StrictStr] = None,
298
+ _headers: Optional[Dict[StrictStr, Any]] = None,
299
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
300
+ ) -> ReadyStatus:
301
+ """get_ready
302
+
303
+
304
+ :param _request_timeout: timeout setting for this request. If one
305
+ number provided, it will be total request
306
+ timeout. It can also be a pair (tuple) of
307
+ (connection, read) timeouts.
308
+ :type _request_timeout: int, tuple(int, int), optional
309
+ :param _request_auth: set to override the auth_settings for an a single
310
+ request; this effectively ignores the
311
+ authentication in the spec for a single request.
312
+ :type _request_auth: dict, optional
313
+ :param _content_type: force content-type for the request.
314
+ :type _content_type: str, Optional
315
+ :param _headers: set to override the headers for a single
316
+ request; this effectively ignores the headers
317
+ in the spec for a single request.
318
+ :type _headers: dict, optional
319
+ :param _host_index: set to override the host_index for a single
320
+ request; this effectively ignores the host_index
321
+ in the spec for a single request.
322
+ :type _host_index: int, optional
323
+ :return: Returns the result object.
324
+ """ # noqa: E501
325
+
326
+ _param = self._get_ready_serialize(
327
+ _request_auth=_request_auth,
328
+ _content_type=_content_type,
329
+ _headers=_headers,
330
+ _host_index=_host_index
331
+ )
332
+
333
+ _response_types_map: Dict[str, Optional[str]] = {
334
+ '200': "ReadyStatus",
335
+ '503': "ErrorBody",
336
+ }
337
+ response_data = self.api_client.call_api(
338
+ *_param,
339
+ _request_timeout=_request_timeout
340
+ )
341
+ response_data.read()
342
+ return self.api_client.response_deserialize(
343
+ response_data=response_data,
344
+ response_types_map=_response_types_map,
345
+ ).data
346
+
347
+
348
+ @validate_call
349
+ def get_ready_with_http_info(
350
+ self,
351
+ _request_timeout: Union[
352
+ None,
353
+ Annotated[StrictFloat, Field(gt=0)],
354
+ Tuple[
355
+ Annotated[StrictFloat, Field(gt=0)],
356
+ Annotated[StrictFloat, Field(gt=0)]
357
+ ]
358
+ ] = None,
359
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
360
+ _content_type: Optional[StrictStr] = None,
361
+ _headers: Optional[Dict[StrictStr, Any]] = None,
362
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
363
+ ) -> ApiResponse[ReadyStatus]:
364
+ """get_ready
365
+
366
+
367
+ :param _request_timeout: timeout setting for this request. If one
368
+ number provided, it will be total request
369
+ timeout. It can also be a pair (tuple) of
370
+ (connection, read) timeouts.
371
+ :type _request_timeout: int, tuple(int, int), optional
372
+ :param _request_auth: set to override the auth_settings for an a single
373
+ request; this effectively ignores the
374
+ authentication in the spec for a single request.
375
+ :type _request_auth: dict, optional
376
+ :param _content_type: force content-type for the request.
377
+ :type _content_type: str, Optional
378
+ :param _headers: set to override the headers for a single
379
+ request; this effectively ignores the headers
380
+ in the spec for a single request.
381
+ :type _headers: dict, optional
382
+ :param _host_index: set to override the host_index for a single
383
+ request; this effectively ignores the host_index
384
+ in the spec for a single request.
385
+ :type _host_index: int, optional
386
+ :return: Returns the result object.
387
+ """ # noqa: E501
388
+
389
+ _param = self._get_ready_serialize(
390
+ _request_auth=_request_auth,
391
+ _content_type=_content_type,
392
+ _headers=_headers,
393
+ _host_index=_host_index
394
+ )
395
+
396
+ _response_types_map: Dict[str, Optional[str]] = {
397
+ '200': "ReadyStatus",
398
+ '503': "ErrorBody",
399
+ }
400
+ response_data = self.api_client.call_api(
401
+ *_param,
402
+ _request_timeout=_request_timeout
403
+ )
404
+ response_data.read()
405
+ return self.api_client.response_deserialize(
406
+ response_data=response_data,
407
+ response_types_map=_response_types_map,
408
+ )
409
+
410
+
411
+ @validate_call
412
+ def get_ready_without_preload_content(
413
+ self,
414
+ _request_timeout: Union[
415
+ None,
416
+ Annotated[StrictFloat, Field(gt=0)],
417
+ Tuple[
418
+ Annotated[StrictFloat, Field(gt=0)],
419
+ Annotated[StrictFloat, Field(gt=0)]
420
+ ]
421
+ ] = None,
422
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
423
+ _content_type: Optional[StrictStr] = None,
424
+ _headers: Optional[Dict[StrictStr, Any]] = None,
425
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
426
+ ) -> RESTResponseType:
427
+ """get_ready
428
+
429
+
430
+ :param _request_timeout: timeout setting for this request. If one
431
+ number provided, it will be total request
432
+ timeout. It can also be a pair (tuple) of
433
+ (connection, read) timeouts.
434
+ :type _request_timeout: int, tuple(int, int), optional
435
+ :param _request_auth: set to override the auth_settings for an a single
436
+ request; this effectively ignores the
437
+ authentication in the spec for a single request.
438
+ :type _request_auth: dict, optional
439
+ :param _content_type: force content-type for the request.
440
+ :type _content_type: str, Optional
441
+ :param _headers: set to override the headers for a single
442
+ request; this effectively ignores the headers
443
+ in the spec for a single request.
444
+ :type _headers: dict, optional
445
+ :param _host_index: set to override the host_index for a single
446
+ request; this effectively ignores the host_index
447
+ in the spec for a single request.
448
+ :type _host_index: int, optional
449
+ :return: Returns the result object.
450
+ """ # noqa: E501
451
+
452
+ _param = self._get_ready_serialize(
453
+ _request_auth=_request_auth,
454
+ _content_type=_content_type,
455
+ _headers=_headers,
456
+ _host_index=_host_index
457
+ )
458
+
459
+ _response_types_map: Dict[str, Optional[str]] = {
460
+ '200': "ReadyStatus",
461
+ '503': "ErrorBody",
462
+ }
463
+ response_data = self.api_client.call_api(
464
+ *_param,
465
+ _request_timeout=_request_timeout
466
+ )
467
+ return response_data.response
468
+
469
+
470
+ def _get_ready_serialize(
471
+ self,
472
+ _request_auth,
473
+ _content_type,
474
+ _headers,
475
+ _host_index,
476
+ ) -> RequestSerialized:
477
+
478
+ _host = None
479
+
480
+ _collection_formats: Dict[str, str] = {
481
+ }
482
+
483
+ _path_params: Dict[str, str] = {}
484
+ _query_params: List[Tuple[str, str]] = []
485
+ _header_params: Dict[str, Optional[str]] = _headers or {}
486
+ _form_params: List[Tuple[str, str]] = []
487
+ _files: Dict[
488
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
489
+ ] = {}
490
+ _body_params: Optional[bytes] = None
491
+
492
+ # process the path parameters
493
+ # process the query parameters
494
+ # process the header parameters
495
+ # process the form parameters
496
+ # process the body parameter
497
+
498
+
499
+ # set the HTTP header `Accept`
500
+ if 'Accept' not in _header_params:
501
+ _header_params['Accept'] = self.api_client.select_header_accept(
502
+ [
503
+ 'application/json'
504
+ ]
505
+ )
506
+
507
+
508
+ # authentication setting
509
+ _auth_settings: List[str] = [
510
+ ]
511
+
512
+ return self.api_client.param_serialize(
513
+ method='GET',
514
+ resource_path='/ready',
515
+ path_params=_path_params,
516
+ query_params=_query_params,
517
+ header_params=_header_params,
518
+ body=_body_params,
519
+ post_params=_form_params,
520
+ files=_files,
521
+ auth_settings=_auth_settings,
522
+ collection_formats=_collection_formats,
523
+ _host=_host,
524
+ _request_auth=_request_auth
525
+ )
526
+
527
+