skillforge-client 0.3.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.
- skillforge_client/__init__.py +8 -0
- skillforge_client/api/__init__.py +1 -0
- skillforge_client/api/auth/__init__.py +1 -0
- skillforge_client/api/auth/create_application_client_endpoint_api_v1_auth_clients_post.py +166 -0
- skillforge_client/api/auth/create_application_client_secret_endpoint_api_v1_auth_clients_client_id_secrets_post.py +182 -0
- skillforge_client/api/auth/create_token_api_v1_auth_token_post.py +165 -0
- skillforge_client/api/auth/grant_application_client_scopes_endpoint_api_v1_auth_clients_client_id_scopes_post.py +182 -0
- skillforge_client/api/auth/read_application_client_api_v1_auth_clients_client_id_get.py +161 -0
- skillforge_client/api/auth/read_application_clients_api_v1_auth_clients_get.py +133 -0
- skillforge_client/api/auth/revoke_application_client_scope_endpoint_api_v1_auth_clients_client_id_scopes_scope_key_delete.py +173 -0
- skillforge_client/api/auth/revoke_application_client_secret_endpoint_api_v1_auth_clients_client_id_secrets_secret_id_delete.py +174 -0
- skillforge_client/api/auth/update_application_client_endpoint_api_v1_auth_clients_client_id_patch.py +182 -0
- skillforge_client/api/bot/__init__.py +1 -0
- skillforge_client/api/bot/add_user_to_group_endpoint_api_v1_bot_users_discord_id_groups_group_key_put.py +199 -0
- skillforge_client/api/bot/cancel_operation_endpoint_api_v1_bot_operations_operation_id_cancel_post.py +203 -0
- skillforge_client/api/bot/check_authorization_endpoint_api_v1_bot_authz_check_post.py +206 -0
- skillforge_client/api/bot/claim_jobs_endpoint_api_v1_bot_jobs_claim_post.py +210 -0
- skillforge_client/api/bot/commit_student_activation_endpoint_api_v1_bot_students_activations_operation_id_commit_post.py +204 -0
- skillforge_client/api/bot/commit_student_deactivation_endpoint_api_v1_bot_students_guild_id_student_discord_id_deactivate_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_student_pop_endpoint_api_v1_bot_students_guild_id_student_discord_id_pop_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_student_stash_endpoint_api_v1_bot_students_guild_id_student_discord_id_stash_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/commit_tutor_activation_endpoint_api_v1_bot_tutors_activations_operation_id_commit_post.py +204 -0
- skillforge_client/api/bot/commit_tutor_deactivation_endpoint_api_v1_bot_tutors_guild_id_tutor_discord_id_deactivate_operation_id_commit_post.py +211 -0
- skillforge_client/api/bot/complete_job_endpoint_api_v1_bot_jobs_job_id_complete_post.py +183 -0
- skillforge_client/api/bot/deactivate_discord_account_endpoint_api_v1_bot_users_discord_id_account_delete.py +197 -0
- skillforge_client/api/bot/delete_command_env_endpoint_api_v1_bot_command_envs_guild_id_channel_id_kind_delete.py +204 -0
- skillforge_client/api/bot/fail_job_endpoint_api_v1_bot_jobs_job_id_fail_post.py +228 -0
- skillforge_client/api/bot/job_queue_summary_endpoint_api_v1_bot_jobs_summary_get.py +202 -0
- skillforge_client/api/bot/link_discord_account_endpoint_api_v1_bot_users_discord_id_account_put.py +227 -0
- skillforge_client/api/bot/list_jobs_endpoint_api_v1_bot_jobs_get.py +243 -0
- skillforge_client/api/bot/list_operations_endpoint_api_v1_bot_operations_get.py +302 -0
- skillforge_client/api/bot/prepare_student_activation_endpoint_api_v1_bot_students_activations_prepare_post.py +181 -0
- skillforge_client/api/bot/prepare_student_deactivation_endpoint_api_v1_bot_students_guild_id_student_discord_id_deactivate_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_student_pop_endpoint_api_v1_bot_students_guild_id_student_discord_id_pop_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_student_stash_endpoint_api_v1_bot_students_guild_id_student_discord_id_stash_prepare_post.py +190 -0
- skillforge_client/api/bot/prepare_tutor_activation_endpoint_api_v1_bot_tutors_activations_prepare_post.py +181 -0
- skillforge_client/api/bot/prepare_tutor_deactivation_endpoint_api_v1_bot_tutors_guild_id_tutor_discord_id_deactivate_prepare_post.py +190 -0
- skillforge_client/api/bot/read_job_api_v1_bot_jobs_job_id_get.py +186 -0
- skillforge_client/api/bot/read_operation_api_v1_bot_operations_operation_id_get.py +186 -0
- skillforge_client/api/bot/read_principal_api_v1_bot_runtime_principals_discord_id_get.py +177 -0
- skillforge_client/api/bot/read_principals_batch_api_v1_bot_runtime_principals_batch_post.py +189 -0
- skillforge_client/api/bot/read_student_context_api_v1_bot_runtime_students_guild_id_discord_id_get.py +191 -0
- skillforge_client/api/bot/read_student_contexts_batch_api_v1_bot_runtime_students_guild_id_batch_post.py +205 -0
- skillforge_client/api/bot/read_tutor_context_api_v1_bot_runtime_tutors_guild_id_discord_id_get.py +191 -0
- skillforge_client/api/bot/read_tutor_contexts_batch_api_v1_bot_runtime_tutors_guild_id_batch_post.py +205 -0
- skillforge_client/api/bot/remove_user_from_group_endpoint_api_v1_bot_users_discord_id_groups_group_key_delete.py +197 -0
- skillforge_client/api/bot/resolve_command_env_endpoint_api_v1_bot_runtime_command_envs_resolve_get.py +234 -0
- skillforge_client/api/bot/upsert_command_env_endpoint_api_v1_bot_command_envs_put.py +181 -0
- skillforge_client/api/bot/upsert_discord_user_endpoint_api_v1_bot_users_discord_id_put.py +213 -0
- skillforge_client/api/default/__init__.py +1 -0
- skillforge_client/api/default/root_get.py +81 -0
- skillforge_client/api/system/__init__.py +1 -0
- skillforge_client/api/system/dependencies_health_check_health_dependencies_get.py +136 -0
- skillforge_client/api/system/dependency_health_check_health_dependencies_dependency_name_get.py +170 -0
- skillforge_client/api/system/liveness_check_health_live_get.py +132 -0
- skillforge_client/api/system/system_health_check_health_get.py +136 -0
- skillforge_client/api/system/worker_health_check_health_workers_worker_name_get.py +170 -0
- skillforge_client/api/system/workers_health_check_health_workers_get.py +136 -0
- skillforge_client/client.py +268 -0
- skillforge_client/errors.py +16 -0
- skillforge_client/models/__init__.py +167 -0
- skillforge_client/models/access_token_response.py +85 -0
- skillforge_client/models/application_client_create_request.py +91 -0
- skillforge_client/models/application_client_response.py +149 -0
- skillforge_client/models/application_client_scope_grant_request.py +61 -0
- skillforge_client/models/application_client_secret_create_request.py +104 -0
- skillforge_client/models/application_client_secret_response.py +160 -0
- skillforge_client/models/application_client_status.py +9 -0
- skillforge_client/models/application_client_update_request.py +124 -0
- skillforge_client/models/authorization_check_request.py +78 -0
- skillforge_client/models/authorization_check_response.py +61 -0
- skillforge_client/models/body_create_token_api_v1_auth_token_post.py +123 -0
- skillforge_client/models/bot_job.py +119 -0
- skillforge_client/models/bot_job_payload.py +47 -0
- skillforge_client/models/bot_principal.py +148 -0
- skillforge_client/models/command_env_channel_response.py +100 -0
- skillforge_client/models/command_env_kind.py +9 -0
- skillforge_client/models/command_env_upsert_request.py +100 -0
- skillforge_client/models/contact_info_profile.py +92 -0
- skillforge_client/models/contact_info_type.py +9 -0
- skillforge_client/models/created_client_secret_response.py +75 -0
- skillforge_client/models/dependencies_health_check_response.py +77 -0
- skillforge_client/models/dependencies_health_check_response_checks.py +56 -0
- skillforge_client/models/dependency_health_check_response.py +72 -0
- skillforge_client/models/dependency_name.py +8 -0
- skillforge_client/models/discord_account_link_request.py +82 -0
- skillforge_client/models/discord_account_link_response.py +86 -0
- skillforge_client/models/discord_account_profile.py +77 -0
- skillforge_client/models/discord_id_batch_request.py +62 -0
- skillforge_client/models/discord_user_response.py +87 -0
- skillforge_client/models/discord_user_upsert_request.py +81 -0
- skillforge_client/models/error_response.py +61 -0
- skillforge_client/models/external_accounts_profile.py +124 -0
- skillforge_client/models/group_membership_response.py +69 -0
- skillforge_client/models/health_check_response.py +63 -0
- skillforge_client/models/health_status.py +10 -0
- skillforge_client/models/http_validation_error.py +79 -0
- skillforge_client/models/job_claim_request.py +113 -0
- skillforge_client/models/job_detail.py +239 -0
- skillforge_client/models/job_detail_payload.py +47 -0
- skillforge_client/models/job_fail_request.py +82 -0
- skillforge_client/models/job_kind_counts.py +92 -0
- skillforge_client/models/job_list_item.py +225 -0
- skillforge_client/models/job_page.py +100 -0
- skillforge_client/models/job_queue_summary.py +106 -0
- skillforge_client/models/job_response.py +187 -0
- skillforge_client/models/job_status.py +11 -0
- skillforge_client/models/job_status_counts.py +86 -0
- skillforge_client/models/member_role.py +10 -0
- skillforge_client/models/microsoft_account_profile.py +61 -0
- skillforge_client/models/operation_cancel_response.py +108 -0
- skillforge_client/models/operation_kind.py +13 -0
- skillforge_client/models/operation_page.py +100 -0
- skillforge_client/models/operation_response.py +257 -0
- skillforge_client/models/operation_response_plan.py +47 -0
- skillforge_client/models/operation_status.py +12 -0
- skillforge_client/models/operation_summary.py +243 -0
- skillforge_client/models/operational_profile.py +178 -0
- skillforge_client/models/party_relation_type.py +10 -0
- skillforge_client/models/person_profile.py +69 -0
- skillforge_client/models/principal_batch.py +84 -0
- skillforge_client/models/relation_profile.py +81 -0
- skillforge_client/models/relation_profile_direction.py +9 -0
- skillforge_client/models/student_activation_commit_request.py +61 -0
- skillforge_client/models/student_activation_prepare_request.py +77 -0
- skillforge_client/models/student_channel_state.py +9 -0
- skillforge_client/models/student_context.py +140 -0
- skillforge_client/models/student_context_batch.py +83 -0
- skillforge_client/models/system_health_check_response.py +87 -0
- skillforge_client/models/transition_commit_response.py +108 -0
- skillforge_client/models/transition_prepare_response.py +95 -0
- skillforge_client/models/transition_prepare_response_plan.py +47 -0
- skillforge_client/models/tutor_activation_commit_request.py +69 -0
- skillforge_client/models/tutor_activation_prepare_request.py +69 -0
- skillforge_client/models/tutor_context.py +99 -0
- skillforge_client/models/tutor_context_batch.py +83 -0
- skillforge_client/models/validation_error.py +123 -0
- skillforge_client/models/validation_error_context.py +47 -0
- skillforge_client/models/worker_health_check_response.py +72 -0
- skillforge_client/models/worker_name.py +8 -0
- skillforge_client/models/workers_health_check_response.py +77 -0
- skillforge_client/models/workers_health_check_response_checks.py +56 -0
- skillforge_client/py.typed +1 -0
- skillforge_client/types.py +54 -0
- skillforge_client-0.3.0.dist-info/METADATA +83 -0
- skillforge_client-0.3.0.dist-info/RECORD +147 -0
- skillforge_client-0.3.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
from attrs import define as _attrs_define
|
|
9
|
+
from attrs import field as _attrs_field
|
|
10
|
+
|
|
11
|
+
from ..models.job_status import JobStatus
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.job_detail_payload import JobDetailPayload
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="JobDetail")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class JobDetail:
|
|
22
|
+
"""Full read view of a single job, including its ``payload``.
|
|
23
|
+
|
|
24
|
+
Attributes:
|
|
25
|
+
attempt (int):
|
|
26
|
+
available_at (datetime.datetime):
|
|
27
|
+
claimed_at (datetime.datetime | None):
|
|
28
|
+
claimed_by (None | str):
|
|
29
|
+
completed_at (datetime.datetime | None):
|
|
30
|
+
created_at (datetime.datetime):
|
|
31
|
+
failed_at (datetime.datetime | None):
|
|
32
|
+
job_id (UUID):
|
|
33
|
+
kind (str):
|
|
34
|
+
last_error (None | str):
|
|
35
|
+
max_attempts (int):
|
|
36
|
+
payload (JobDetailPayload):
|
|
37
|
+
status (JobStatus):
|
|
38
|
+
updated_at (datetime.datetime):
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
attempt: int
|
|
42
|
+
available_at: datetime.datetime
|
|
43
|
+
claimed_at: datetime.datetime | None
|
|
44
|
+
claimed_by: None | str
|
|
45
|
+
completed_at: datetime.datetime | None
|
|
46
|
+
created_at: datetime.datetime
|
|
47
|
+
failed_at: datetime.datetime | None
|
|
48
|
+
job_id: UUID
|
|
49
|
+
kind: str
|
|
50
|
+
last_error: None | str
|
|
51
|
+
max_attempts: int
|
|
52
|
+
payload: JobDetailPayload
|
|
53
|
+
status: JobStatus
|
|
54
|
+
updated_at: datetime.datetime
|
|
55
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> dict[str, Any]:
|
|
58
|
+
attempt = self.attempt
|
|
59
|
+
|
|
60
|
+
available_at = self.available_at.isoformat()
|
|
61
|
+
|
|
62
|
+
claimed_at: None | str
|
|
63
|
+
if isinstance(self.claimed_at, datetime.datetime):
|
|
64
|
+
claimed_at = self.claimed_at.isoformat()
|
|
65
|
+
else:
|
|
66
|
+
claimed_at = self.claimed_at
|
|
67
|
+
|
|
68
|
+
claimed_by: None | str
|
|
69
|
+
claimed_by = self.claimed_by
|
|
70
|
+
|
|
71
|
+
completed_at: None | str
|
|
72
|
+
if isinstance(self.completed_at, datetime.datetime):
|
|
73
|
+
completed_at = self.completed_at.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
completed_at = self.completed_at
|
|
76
|
+
|
|
77
|
+
created_at = self.created_at.isoformat()
|
|
78
|
+
|
|
79
|
+
failed_at: None | str
|
|
80
|
+
if isinstance(self.failed_at, datetime.datetime):
|
|
81
|
+
failed_at = self.failed_at.isoformat()
|
|
82
|
+
else:
|
|
83
|
+
failed_at = self.failed_at
|
|
84
|
+
|
|
85
|
+
job_id = str(self.job_id)
|
|
86
|
+
|
|
87
|
+
kind = self.kind
|
|
88
|
+
|
|
89
|
+
last_error: None | str
|
|
90
|
+
last_error = self.last_error
|
|
91
|
+
|
|
92
|
+
max_attempts = self.max_attempts
|
|
93
|
+
|
|
94
|
+
payload = self.payload.to_dict()
|
|
95
|
+
|
|
96
|
+
status = self.status.value
|
|
97
|
+
|
|
98
|
+
updated_at = self.updated_at.isoformat()
|
|
99
|
+
|
|
100
|
+
field_dict: dict[str, Any] = {}
|
|
101
|
+
field_dict.update(self.additional_properties)
|
|
102
|
+
field_dict.update(
|
|
103
|
+
{
|
|
104
|
+
"attempt": attempt,
|
|
105
|
+
"available_at": available_at,
|
|
106
|
+
"claimed_at": claimed_at,
|
|
107
|
+
"claimed_by": claimed_by,
|
|
108
|
+
"completed_at": completed_at,
|
|
109
|
+
"created_at": created_at,
|
|
110
|
+
"failed_at": failed_at,
|
|
111
|
+
"job_id": job_id,
|
|
112
|
+
"kind": kind,
|
|
113
|
+
"last_error": last_error,
|
|
114
|
+
"max_attempts": max_attempts,
|
|
115
|
+
"payload": payload,
|
|
116
|
+
"status": status,
|
|
117
|
+
"updated_at": updated_at,
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return field_dict
|
|
122
|
+
|
|
123
|
+
@classmethod
|
|
124
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
125
|
+
from ..models.job_detail_payload import JobDetailPayload
|
|
126
|
+
|
|
127
|
+
d = dict(src_dict)
|
|
128
|
+
attempt = d.pop("attempt")
|
|
129
|
+
|
|
130
|
+
available_at = datetime.datetime.fromisoformat(d.pop("available_at"))
|
|
131
|
+
|
|
132
|
+
def _parse_claimed_at(data: object) -> datetime.datetime | None:
|
|
133
|
+
if data is None:
|
|
134
|
+
return data
|
|
135
|
+
try:
|
|
136
|
+
if not isinstance(data, str):
|
|
137
|
+
raise TypeError()
|
|
138
|
+
claimed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
139
|
+
|
|
140
|
+
return claimed_at_type_0
|
|
141
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
142
|
+
pass
|
|
143
|
+
return cast(datetime.datetime | None, data)
|
|
144
|
+
|
|
145
|
+
claimed_at = _parse_claimed_at(d.pop("claimed_at"))
|
|
146
|
+
|
|
147
|
+
def _parse_claimed_by(data: object) -> None | str:
|
|
148
|
+
if data is None:
|
|
149
|
+
return data
|
|
150
|
+
return cast(None | str, data)
|
|
151
|
+
|
|
152
|
+
claimed_by = _parse_claimed_by(d.pop("claimed_by"))
|
|
153
|
+
|
|
154
|
+
def _parse_completed_at(data: object) -> datetime.datetime | None:
|
|
155
|
+
if data is None:
|
|
156
|
+
return data
|
|
157
|
+
try:
|
|
158
|
+
if not isinstance(data, str):
|
|
159
|
+
raise TypeError()
|
|
160
|
+
completed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
161
|
+
|
|
162
|
+
return completed_at_type_0
|
|
163
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
164
|
+
pass
|
|
165
|
+
return cast(datetime.datetime | None, data)
|
|
166
|
+
|
|
167
|
+
completed_at = _parse_completed_at(d.pop("completed_at"))
|
|
168
|
+
|
|
169
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
170
|
+
|
|
171
|
+
def _parse_failed_at(data: object) -> datetime.datetime | None:
|
|
172
|
+
if data is None:
|
|
173
|
+
return data
|
|
174
|
+
try:
|
|
175
|
+
if not isinstance(data, str):
|
|
176
|
+
raise TypeError()
|
|
177
|
+
failed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
178
|
+
|
|
179
|
+
return failed_at_type_0
|
|
180
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
181
|
+
pass
|
|
182
|
+
return cast(datetime.datetime | None, data)
|
|
183
|
+
|
|
184
|
+
failed_at = _parse_failed_at(d.pop("failed_at"))
|
|
185
|
+
|
|
186
|
+
job_id = UUID(d.pop("job_id"))
|
|
187
|
+
|
|
188
|
+
kind = d.pop("kind")
|
|
189
|
+
|
|
190
|
+
def _parse_last_error(data: object) -> None | str:
|
|
191
|
+
if data is None:
|
|
192
|
+
return data
|
|
193
|
+
return cast(None | str, data)
|
|
194
|
+
|
|
195
|
+
last_error = _parse_last_error(d.pop("last_error"))
|
|
196
|
+
|
|
197
|
+
max_attempts = d.pop("max_attempts")
|
|
198
|
+
|
|
199
|
+
payload = JobDetailPayload.from_dict(d.pop("payload"))
|
|
200
|
+
|
|
201
|
+
status = JobStatus(d.pop("status"))
|
|
202
|
+
|
|
203
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
204
|
+
|
|
205
|
+
job_detail = cls(
|
|
206
|
+
attempt=attempt,
|
|
207
|
+
available_at=available_at,
|
|
208
|
+
claimed_at=claimed_at,
|
|
209
|
+
claimed_by=claimed_by,
|
|
210
|
+
completed_at=completed_at,
|
|
211
|
+
created_at=created_at,
|
|
212
|
+
failed_at=failed_at,
|
|
213
|
+
job_id=job_id,
|
|
214
|
+
kind=kind,
|
|
215
|
+
last_error=last_error,
|
|
216
|
+
max_attempts=max_attempts,
|
|
217
|
+
payload=payload,
|
|
218
|
+
status=status,
|
|
219
|
+
updated_at=updated_at,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
job_detail.additional_properties = d
|
|
223
|
+
return job_detail
|
|
224
|
+
|
|
225
|
+
@property
|
|
226
|
+
def additional_keys(self) -> list[str]:
|
|
227
|
+
return list(self.additional_properties.keys())
|
|
228
|
+
|
|
229
|
+
def __getitem__(self, key: str) -> Any:
|
|
230
|
+
return self.additional_properties[key]
|
|
231
|
+
|
|
232
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
233
|
+
self.additional_properties[key] = value
|
|
234
|
+
|
|
235
|
+
def __delitem__(self, key: str) -> None:
|
|
236
|
+
del self.additional_properties[key]
|
|
237
|
+
|
|
238
|
+
def __contains__(self, key: str) -> bool:
|
|
239
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="JobDetailPayload")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class JobDetailPayload:
|
|
14
|
+
""" """
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
field_dict: dict[str, Any] = {}
|
|
21
|
+
field_dict.update(self.additional_properties)
|
|
22
|
+
|
|
23
|
+
return field_dict
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
27
|
+
d = dict(src_dict)
|
|
28
|
+
job_detail_payload = cls()
|
|
29
|
+
|
|
30
|
+
job_detail_payload.additional_properties = d
|
|
31
|
+
return job_detail_payload
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def additional_keys(self) -> list[str]:
|
|
35
|
+
return list(self.additional_properties.keys())
|
|
36
|
+
|
|
37
|
+
def __getitem__(self, key: str) -> Any:
|
|
38
|
+
return self.additional_properties[key]
|
|
39
|
+
|
|
40
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
41
|
+
self.additional_properties[key] = value
|
|
42
|
+
|
|
43
|
+
def __delitem__(self, key: str) -> None:
|
|
44
|
+
del self.additional_properties[key]
|
|
45
|
+
|
|
46
|
+
def __contains__(self, key: str) -> bool:
|
|
47
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="JobFailRequest")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class JobFailRequest:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
error (None | str | Unset):
|
|
19
|
+
retry (bool | Unset): Default: False.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
error: None | str | Unset = UNSET
|
|
23
|
+
retry: bool | Unset = False
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
error: None | str | Unset
|
|
28
|
+
if isinstance(self.error, Unset):
|
|
29
|
+
error = UNSET
|
|
30
|
+
else:
|
|
31
|
+
error = self.error
|
|
32
|
+
|
|
33
|
+
retry = self.retry
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update({})
|
|
38
|
+
if error is not UNSET:
|
|
39
|
+
field_dict["error"] = error
|
|
40
|
+
if retry is not UNSET:
|
|
41
|
+
field_dict["retry"] = retry
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
47
|
+
d = dict(src_dict)
|
|
48
|
+
|
|
49
|
+
def _parse_error(data: object) -> None | str | Unset:
|
|
50
|
+
if data is None:
|
|
51
|
+
return data
|
|
52
|
+
if isinstance(data, Unset):
|
|
53
|
+
return data
|
|
54
|
+
return cast(None | str | Unset, data)
|
|
55
|
+
|
|
56
|
+
error = _parse_error(d.pop("error", UNSET))
|
|
57
|
+
|
|
58
|
+
retry = d.pop("retry", UNSET)
|
|
59
|
+
|
|
60
|
+
job_fail_request = cls(
|
|
61
|
+
error=error,
|
|
62
|
+
retry=retry,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
job_fail_request.additional_properties = d
|
|
66
|
+
return job_fail_request
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.job_status_counts import JobStatusCounts
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="JobKindCounts")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class JobKindCounts:
|
|
18
|
+
"""Queue funnel for a single job kind: depth (``total``/``open``) and the status breakdown.
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
kind (str):
|
|
22
|
+
open_ (int):
|
|
23
|
+
statuses (JobStatusCounts): Job counts for every status in the queue funnel, zero-filled (no silent gaps).
|
|
24
|
+
total (int):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
kind: str
|
|
28
|
+
open_: int
|
|
29
|
+
statuses: JobStatusCounts
|
|
30
|
+
total: int
|
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
kind = self.kind
|
|
35
|
+
|
|
36
|
+
open_ = self.open_
|
|
37
|
+
|
|
38
|
+
statuses = self.statuses.to_dict()
|
|
39
|
+
|
|
40
|
+
total = self.total
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"kind": kind,
|
|
47
|
+
"open": open_,
|
|
48
|
+
"statuses": statuses,
|
|
49
|
+
"total": total,
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
57
|
+
from ..models.job_status_counts import JobStatusCounts
|
|
58
|
+
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
kind = d.pop("kind")
|
|
61
|
+
|
|
62
|
+
open_ = d.pop("open")
|
|
63
|
+
|
|
64
|
+
statuses = JobStatusCounts.from_dict(d.pop("statuses"))
|
|
65
|
+
|
|
66
|
+
total = d.pop("total")
|
|
67
|
+
|
|
68
|
+
job_kind_counts = cls(
|
|
69
|
+
kind=kind,
|
|
70
|
+
open_=open_,
|
|
71
|
+
statuses=statuses,
|
|
72
|
+
total=total,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
job_kind_counts.additional_properties = d
|
|
76
|
+
return job_kind_counts
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def additional_keys(self) -> list[str]:
|
|
80
|
+
return list(self.additional_properties.keys())
|
|
81
|
+
|
|
82
|
+
def __getitem__(self, key: str) -> Any:
|
|
83
|
+
return self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
86
|
+
self.additional_properties[key] = value
|
|
87
|
+
|
|
88
|
+
def __delitem__(self, key: str) -> None:
|
|
89
|
+
del self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __contains__(self, key: str) -> bool:
|
|
92
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar, cast
|
|
6
|
+
from uuid import UUID
|
|
7
|
+
|
|
8
|
+
from attrs import define as _attrs_define
|
|
9
|
+
from attrs import field as _attrs_field
|
|
10
|
+
|
|
11
|
+
from ..models.job_status import JobStatus
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="JobListItem")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class JobListItem:
|
|
18
|
+
"""List view of a job. Omits the ``payload`` -- fetch a single job by id for that.
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
attempt (int):
|
|
22
|
+
available_at (datetime.datetime):
|
|
23
|
+
claimed_at (datetime.datetime | None):
|
|
24
|
+
claimed_by (None | str):
|
|
25
|
+
completed_at (datetime.datetime | None):
|
|
26
|
+
created_at (datetime.datetime):
|
|
27
|
+
failed_at (datetime.datetime | None):
|
|
28
|
+
job_id (UUID):
|
|
29
|
+
kind (str):
|
|
30
|
+
last_error (None | str):
|
|
31
|
+
max_attempts (int):
|
|
32
|
+
status (JobStatus):
|
|
33
|
+
updated_at (datetime.datetime):
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
attempt: int
|
|
37
|
+
available_at: datetime.datetime
|
|
38
|
+
claimed_at: datetime.datetime | None
|
|
39
|
+
claimed_by: None | str
|
|
40
|
+
completed_at: datetime.datetime | None
|
|
41
|
+
created_at: datetime.datetime
|
|
42
|
+
failed_at: datetime.datetime | None
|
|
43
|
+
job_id: UUID
|
|
44
|
+
kind: str
|
|
45
|
+
last_error: None | str
|
|
46
|
+
max_attempts: int
|
|
47
|
+
status: JobStatus
|
|
48
|
+
updated_at: datetime.datetime
|
|
49
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
attempt = self.attempt
|
|
53
|
+
|
|
54
|
+
available_at = self.available_at.isoformat()
|
|
55
|
+
|
|
56
|
+
claimed_at: None | str
|
|
57
|
+
if isinstance(self.claimed_at, datetime.datetime):
|
|
58
|
+
claimed_at = self.claimed_at.isoformat()
|
|
59
|
+
else:
|
|
60
|
+
claimed_at = self.claimed_at
|
|
61
|
+
|
|
62
|
+
claimed_by: None | str
|
|
63
|
+
claimed_by = self.claimed_by
|
|
64
|
+
|
|
65
|
+
completed_at: None | str
|
|
66
|
+
if isinstance(self.completed_at, datetime.datetime):
|
|
67
|
+
completed_at = self.completed_at.isoformat()
|
|
68
|
+
else:
|
|
69
|
+
completed_at = self.completed_at
|
|
70
|
+
|
|
71
|
+
created_at = self.created_at.isoformat()
|
|
72
|
+
|
|
73
|
+
failed_at: None | str
|
|
74
|
+
if isinstance(self.failed_at, datetime.datetime):
|
|
75
|
+
failed_at = self.failed_at.isoformat()
|
|
76
|
+
else:
|
|
77
|
+
failed_at = self.failed_at
|
|
78
|
+
|
|
79
|
+
job_id = str(self.job_id)
|
|
80
|
+
|
|
81
|
+
kind = self.kind
|
|
82
|
+
|
|
83
|
+
last_error: None | str
|
|
84
|
+
last_error = self.last_error
|
|
85
|
+
|
|
86
|
+
max_attempts = self.max_attempts
|
|
87
|
+
|
|
88
|
+
status = self.status.value
|
|
89
|
+
|
|
90
|
+
updated_at = self.updated_at.isoformat()
|
|
91
|
+
|
|
92
|
+
field_dict: dict[str, Any] = {}
|
|
93
|
+
field_dict.update(self.additional_properties)
|
|
94
|
+
field_dict.update(
|
|
95
|
+
{
|
|
96
|
+
"attempt": attempt,
|
|
97
|
+
"available_at": available_at,
|
|
98
|
+
"claimed_at": claimed_at,
|
|
99
|
+
"claimed_by": claimed_by,
|
|
100
|
+
"completed_at": completed_at,
|
|
101
|
+
"created_at": created_at,
|
|
102
|
+
"failed_at": failed_at,
|
|
103
|
+
"job_id": job_id,
|
|
104
|
+
"kind": kind,
|
|
105
|
+
"last_error": last_error,
|
|
106
|
+
"max_attempts": max_attempts,
|
|
107
|
+
"status": status,
|
|
108
|
+
"updated_at": updated_at,
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return field_dict
|
|
113
|
+
|
|
114
|
+
@classmethod
|
|
115
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
116
|
+
d = dict(src_dict)
|
|
117
|
+
attempt = d.pop("attempt")
|
|
118
|
+
|
|
119
|
+
available_at = datetime.datetime.fromisoformat(d.pop("available_at"))
|
|
120
|
+
|
|
121
|
+
def _parse_claimed_at(data: object) -> datetime.datetime | None:
|
|
122
|
+
if data is None:
|
|
123
|
+
return data
|
|
124
|
+
try:
|
|
125
|
+
if not isinstance(data, str):
|
|
126
|
+
raise TypeError()
|
|
127
|
+
claimed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
128
|
+
|
|
129
|
+
return claimed_at_type_0
|
|
130
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
131
|
+
pass
|
|
132
|
+
return cast(datetime.datetime | None, data)
|
|
133
|
+
|
|
134
|
+
claimed_at = _parse_claimed_at(d.pop("claimed_at"))
|
|
135
|
+
|
|
136
|
+
def _parse_claimed_by(data: object) -> None | str:
|
|
137
|
+
if data is None:
|
|
138
|
+
return data
|
|
139
|
+
return cast(None | str, data)
|
|
140
|
+
|
|
141
|
+
claimed_by = _parse_claimed_by(d.pop("claimed_by"))
|
|
142
|
+
|
|
143
|
+
def _parse_completed_at(data: object) -> datetime.datetime | None:
|
|
144
|
+
if data is None:
|
|
145
|
+
return data
|
|
146
|
+
try:
|
|
147
|
+
if not isinstance(data, str):
|
|
148
|
+
raise TypeError()
|
|
149
|
+
completed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
150
|
+
|
|
151
|
+
return completed_at_type_0
|
|
152
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
153
|
+
pass
|
|
154
|
+
return cast(datetime.datetime | None, data)
|
|
155
|
+
|
|
156
|
+
completed_at = _parse_completed_at(d.pop("completed_at"))
|
|
157
|
+
|
|
158
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
159
|
+
|
|
160
|
+
def _parse_failed_at(data: object) -> datetime.datetime | None:
|
|
161
|
+
if data is None:
|
|
162
|
+
return data
|
|
163
|
+
try:
|
|
164
|
+
if not isinstance(data, str):
|
|
165
|
+
raise TypeError()
|
|
166
|
+
failed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
167
|
+
|
|
168
|
+
return failed_at_type_0
|
|
169
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
170
|
+
pass
|
|
171
|
+
return cast(datetime.datetime | None, data)
|
|
172
|
+
|
|
173
|
+
failed_at = _parse_failed_at(d.pop("failed_at"))
|
|
174
|
+
|
|
175
|
+
job_id = UUID(d.pop("job_id"))
|
|
176
|
+
|
|
177
|
+
kind = d.pop("kind")
|
|
178
|
+
|
|
179
|
+
def _parse_last_error(data: object) -> None | str:
|
|
180
|
+
if data is None:
|
|
181
|
+
return data
|
|
182
|
+
return cast(None | str, data)
|
|
183
|
+
|
|
184
|
+
last_error = _parse_last_error(d.pop("last_error"))
|
|
185
|
+
|
|
186
|
+
max_attempts = d.pop("max_attempts")
|
|
187
|
+
|
|
188
|
+
status = JobStatus(d.pop("status"))
|
|
189
|
+
|
|
190
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
191
|
+
|
|
192
|
+
job_list_item = cls(
|
|
193
|
+
attempt=attempt,
|
|
194
|
+
available_at=available_at,
|
|
195
|
+
claimed_at=claimed_at,
|
|
196
|
+
claimed_by=claimed_by,
|
|
197
|
+
completed_at=completed_at,
|
|
198
|
+
created_at=created_at,
|
|
199
|
+
failed_at=failed_at,
|
|
200
|
+
job_id=job_id,
|
|
201
|
+
kind=kind,
|
|
202
|
+
last_error=last_error,
|
|
203
|
+
max_attempts=max_attempts,
|
|
204
|
+
status=status,
|
|
205
|
+
updated_at=updated_at,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
job_list_item.additional_properties = d
|
|
209
|
+
return job_list_item
|
|
210
|
+
|
|
211
|
+
@property
|
|
212
|
+
def additional_keys(self) -> list[str]:
|
|
213
|
+
return list(self.additional_properties.keys())
|
|
214
|
+
|
|
215
|
+
def __getitem__(self, key: str) -> Any:
|
|
216
|
+
return self.additional_properties[key]
|
|
217
|
+
|
|
218
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
219
|
+
self.additional_properties[key] = value
|
|
220
|
+
|
|
221
|
+
def __delitem__(self, key: str) -> None:
|
|
222
|
+
del self.additional_properties[key]
|
|
223
|
+
|
|
224
|
+
def __contains__(self, key: str) -> bool:
|
|
225
|
+
return key in self.additional_properties
|