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,100 @@
|
|
|
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.operation_summary import OperationSummary
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="OperationPage")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class OperationPage:
|
|
18
|
+
"""A page of operations plus the total match count, for offset pagination.
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
items (list[OperationSummary]):
|
|
22
|
+
limit (int):
|
|
23
|
+
offset (int):
|
|
24
|
+
total (int):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
items: list[OperationSummary]
|
|
28
|
+
limit: int
|
|
29
|
+
offset: int
|
|
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
|
+
items = []
|
|
35
|
+
for items_item_data in self.items:
|
|
36
|
+
items_item = items_item_data.to_dict()
|
|
37
|
+
items.append(items_item)
|
|
38
|
+
|
|
39
|
+
limit = self.limit
|
|
40
|
+
|
|
41
|
+
offset = self.offset
|
|
42
|
+
|
|
43
|
+
total = self.total
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update(
|
|
48
|
+
{
|
|
49
|
+
"items": items,
|
|
50
|
+
"limit": limit,
|
|
51
|
+
"offset": offset,
|
|
52
|
+
"total": total,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
return field_dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
60
|
+
from ..models.operation_summary import OperationSummary
|
|
61
|
+
|
|
62
|
+
d = dict(src_dict)
|
|
63
|
+
items = []
|
|
64
|
+
_items = d.pop("items")
|
|
65
|
+
for items_item_data in _items:
|
|
66
|
+
items_item = OperationSummary.from_dict(items_item_data)
|
|
67
|
+
|
|
68
|
+
items.append(items_item)
|
|
69
|
+
|
|
70
|
+
limit = d.pop("limit")
|
|
71
|
+
|
|
72
|
+
offset = d.pop("offset")
|
|
73
|
+
|
|
74
|
+
total = d.pop("total")
|
|
75
|
+
|
|
76
|
+
operation_page = cls(
|
|
77
|
+
items=items,
|
|
78
|
+
limit=limit,
|
|
79
|
+
offset=offset,
|
|
80
|
+
total=total,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
operation_page.additional_properties = d
|
|
84
|
+
return operation_page
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def additional_keys(self) -> list[str]:
|
|
88
|
+
return list(self.additional_properties.keys())
|
|
89
|
+
|
|
90
|
+
def __getitem__(self, key: str) -> Any:
|
|
91
|
+
return self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
94
|
+
self.additional_properties[key] = value
|
|
95
|
+
|
|
96
|
+
def __delitem__(self, key: str) -> None:
|
|
97
|
+
del self.additional_properties[key]
|
|
98
|
+
|
|
99
|
+
def __contains__(self, key: str) -> bool:
|
|
100
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,257 @@
|
|
|
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.operation_kind import OperationKind
|
|
12
|
+
from ..models.operation_status import OperationStatus
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.operation_response_plan import OperationResponsePlan
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="OperationResponse")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class OperationResponse:
|
|
23
|
+
"""Full read view of a single operation, including the two-phase ``plan``.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
cancelled_at (datetime.datetime | None):
|
|
27
|
+
committed_at (datetime.datetime | None):
|
|
28
|
+
created_at (datetime.datetime):
|
|
29
|
+
expires_at (datetime.datetime):
|
|
30
|
+
failed_at (datetime.datetime | None):
|
|
31
|
+
guild_id (int):
|
|
32
|
+
kind (OperationKind):
|
|
33
|
+
last_error (None | str):
|
|
34
|
+
operation_id (UUID):
|
|
35
|
+
plan (OperationResponsePlan):
|
|
36
|
+
reserved_archive_category_channel_id (int | None):
|
|
37
|
+
status (OperationStatus):
|
|
38
|
+
subject_discord_id (int):
|
|
39
|
+
tutor_discord_id (int | None):
|
|
40
|
+
updated_at (datetime.datetime):
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
cancelled_at: datetime.datetime | None
|
|
44
|
+
committed_at: datetime.datetime | None
|
|
45
|
+
created_at: datetime.datetime
|
|
46
|
+
expires_at: datetime.datetime
|
|
47
|
+
failed_at: datetime.datetime | None
|
|
48
|
+
guild_id: int
|
|
49
|
+
kind: OperationKind
|
|
50
|
+
last_error: None | str
|
|
51
|
+
operation_id: UUID
|
|
52
|
+
plan: OperationResponsePlan
|
|
53
|
+
reserved_archive_category_channel_id: int | None
|
|
54
|
+
status: OperationStatus
|
|
55
|
+
subject_discord_id: int
|
|
56
|
+
tutor_discord_id: int | None
|
|
57
|
+
updated_at: datetime.datetime
|
|
58
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> dict[str, Any]:
|
|
61
|
+
cancelled_at: None | str
|
|
62
|
+
if isinstance(self.cancelled_at, datetime.datetime):
|
|
63
|
+
cancelled_at = self.cancelled_at.isoformat()
|
|
64
|
+
else:
|
|
65
|
+
cancelled_at = self.cancelled_at
|
|
66
|
+
|
|
67
|
+
committed_at: None | str
|
|
68
|
+
if isinstance(self.committed_at, datetime.datetime):
|
|
69
|
+
committed_at = self.committed_at.isoformat()
|
|
70
|
+
else:
|
|
71
|
+
committed_at = self.committed_at
|
|
72
|
+
|
|
73
|
+
created_at = self.created_at.isoformat()
|
|
74
|
+
|
|
75
|
+
expires_at = self.expires_at.isoformat()
|
|
76
|
+
|
|
77
|
+
failed_at: None | str
|
|
78
|
+
if isinstance(self.failed_at, datetime.datetime):
|
|
79
|
+
failed_at = self.failed_at.isoformat()
|
|
80
|
+
else:
|
|
81
|
+
failed_at = self.failed_at
|
|
82
|
+
|
|
83
|
+
guild_id = self.guild_id
|
|
84
|
+
|
|
85
|
+
kind = self.kind.value
|
|
86
|
+
|
|
87
|
+
last_error: None | str
|
|
88
|
+
last_error = self.last_error
|
|
89
|
+
|
|
90
|
+
operation_id = str(self.operation_id)
|
|
91
|
+
|
|
92
|
+
plan = self.plan.to_dict()
|
|
93
|
+
|
|
94
|
+
reserved_archive_category_channel_id: int | None
|
|
95
|
+
reserved_archive_category_channel_id = self.reserved_archive_category_channel_id
|
|
96
|
+
|
|
97
|
+
status = self.status.value
|
|
98
|
+
|
|
99
|
+
subject_discord_id = self.subject_discord_id
|
|
100
|
+
|
|
101
|
+
tutor_discord_id: int | None
|
|
102
|
+
tutor_discord_id = self.tutor_discord_id
|
|
103
|
+
|
|
104
|
+
updated_at = self.updated_at.isoformat()
|
|
105
|
+
|
|
106
|
+
field_dict: dict[str, Any] = {}
|
|
107
|
+
field_dict.update(self.additional_properties)
|
|
108
|
+
field_dict.update(
|
|
109
|
+
{
|
|
110
|
+
"cancelled_at": cancelled_at,
|
|
111
|
+
"committed_at": committed_at,
|
|
112
|
+
"created_at": created_at,
|
|
113
|
+
"expires_at": expires_at,
|
|
114
|
+
"failed_at": failed_at,
|
|
115
|
+
"guild_id": guild_id,
|
|
116
|
+
"kind": kind,
|
|
117
|
+
"last_error": last_error,
|
|
118
|
+
"operation_id": operation_id,
|
|
119
|
+
"plan": plan,
|
|
120
|
+
"reserved_archive_category_channel_id": reserved_archive_category_channel_id,
|
|
121
|
+
"status": status,
|
|
122
|
+
"subject_discord_id": subject_discord_id,
|
|
123
|
+
"tutor_discord_id": tutor_discord_id,
|
|
124
|
+
"updated_at": updated_at,
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
return field_dict
|
|
129
|
+
|
|
130
|
+
@classmethod
|
|
131
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
132
|
+
from ..models.operation_response_plan import OperationResponsePlan
|
|
133
|
+
|
|
134
|
+
d = dict(src_dict)
|
|
135
|
+
|
|
136
|
+
def _parse_cancelled_at(data: object) -> datetime.datetime | None:
|
|
137
|
+
if data is None:
|
|
138
|
+
return data
|
|
139
|
+
try:
|
|
140
|
+
if not isinstance(data, str):
|
|
141
|
+
raise TypeError()
|
|
142
|
+
cancelled_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
143
|
+
|
|
144
|
+
return cancelled_at_type_0
|
|
145
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
146
|
+
pass
|
|
147
|
+
return cast(datetime.datetime | None, data)
|
|
148
|
+
|
|
149
|
+
cancelled_at = _parse_cancelled_at(d.pop("cancelled_at"))
|
|
150
|
+
|
|
151
|
+
def _parse_committed_at(data: object) -> datetime.datetime | None:
|
|
152
|
+
if data is None:
|
|
153
|
+
return data
|
|
154
|
+
try:
|
|
155
|
+
if not isinstance(data, str):
|
|
156
|
+
raise TypeError()
|
|
157
|
+
committed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
158
|
+
|
|
159
|
+
return committed_at_type_0
|
|
160
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
161
|
+
pass
|
|
162
|
+
return cast(datetime.datetime | None, data)
|
|
163
|
+
|
|
164
|
+
committed_at = _parse_committed_at(d.pop("committed_at"))
|
|
165
|
+
|
|
166
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
167
|
+
|
|
168
|
+
expires_at = datetime.datetime.fromisoformat(d.pop("expires_at"))
|
|
169
|
+
|
|
170
|
+
def _parse_failed_at(data: object) -> datetime.datetime | None:
|
|
171
|
+
if data is None:
|
|
172
|
+
return data
|
|
173
|
+
try:
|
|
174
|
+
if not isinstance(data, str):
|
|
175
|
+
raise TypeError()
|
|
176
|
+
failed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
177
|
+
|
|
178
|
+
return failed_at_type_0
|
|
179
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
180
|
+
pass
|
|
181
|
+
return cast(datetime.datetime | None, data)
|
|
182
|
+
|
|
183
|
+
failed_at = _parse_failed_at(d.pop("failed_at"))
|
|
184
|
+
|
|
185
|
+
guild_id = d.pop("guild_id")
|
|
186
|
+
|
|
187
|
+
kind = OperationKind(d.pop("kind"))
|
|
188
|
+
|
|
189
|
+
def _parse_last_error(data: object) -> None | str:
|
|
190
|
+
if data is None:
|
|
191
|
+
return data
|
|
192
|
+
return cast(None | str, data)
|
|
193
|
+
|
|
194
|
+
last_error = _parse_last_error(d.pop("last_error"))
|
|
195
|
+
|
|
196
|
+
operation_id = UUID(d.pop("operation_id"))
|
|
197
|
+
|
|
198
|
+
plan = OperationResponsePlan.from_dict(d.pop("plan"))
|
|
199
|
+
|
|
200
|
+
def _parse_reserved_archive_category_channel_id(data: object) -> int | None:
|
|
201
|
+
if data is None:
|
|
202
|
+
return data
|
|
203
|
+
return cast(int | None, data)
|
|
204
|
+
|
|
205
|
+
reserved_archive_category_channel_id = _parse_reserved_archive_category_channel_id(
|
|
206
|
+
d.pop("reserved_archive_category_channel_id")
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
status = OperationStatus(d.pop("status"))
|
|
210
|
+
|
|
211
|
+
subject_discord_id = d.pop("subject_discord_id")
|
|
212
|
+
|
|
213
|
+
def _parse_tutor_discord_id(data: object) -> int | None:
|
|
214
|
+
if data is None:
|
|
215
|
+
return data
|
|
216
|
+
return cast(int | None, data)
|
|
217
|
+
|
|
218
|
+
tutor_discord_id = _parse_tutor_discord_id(d.pop("tutor_discord_id"))
|
|
219
|
+
|
|
220
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
221
|
+
|
|
222
|
+
operation_response = cls(
|
|
223
|
+
cancelled_at=cancelled_at,
|
|
224
|
+
committed_at=committed_at,
|
|
225
|
+
created_at=created_at,
|
|
226
|
+
expires_at=expires_at,
|
|
227
|
+
failed_at=failed_at,
|
|
228
|
+
guild_id=guild_id,
|
|
229
|
+
kind=kind,
|
|
230
|
+
last_error=last_error,
|
|
231
|
+
operation_id=operation_id,
|
|
232
|
+
plan=plan,
|
|
233
|
+
reserved_archive_category_channel_id=reserved_archive_category_channel_id,
|
|
234
|
+
status=status,
|
|
235
|
+
subject_discord_id=subject_discord_id,
|
|
236
|
+
tutor_discord_id=tutor_discord_id,
|
|
237
|
+
updated_at=updated_at,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
operation_response.additional_properties = d
|
|
241
|
+
return operation_response
|
|
242
|
+
|
|
243
|
+
@property
|
|
244
|
+
def additional_keys(self) -> list[str]:
|
|
245
|
+
return list(self.additional_properties.keys())
|
|
246
|
+
|
|
247
|
+
def __getitem__(self, key: str) -> Any:
|
|
248
|
+
return self.additional_properties[key]
|
|
249
|
+
|
|
250
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
251
|
+
self.additional_properties[key] = value
|
|
252
|
+
|
|
253
|
+
def __delitem__(self, key: str) -> None:
|
|
254
|
+
del self.additional_properties[key]
|
|
255
|
+
|
|
256
|
+
def __contains__(self, key: str) -> bool:
|
|
257
|
+
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="OperationResponsePlan")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class OperationResponsePlan:
|
|
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
|
+
operation_response_plan = cls()
|
|
29
|
+
|
|
30
|
+
operation_response_plan.additional_properties = d
|
|
31
|
+
return operation_response_plan
|
|
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,243 @@
|
|
|
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.operation_kind import OperationKind
|
|
12
|
+
from ..models.operation_status import OperationStatus
|
|
13
|
+
|
|
14
|
+
T = TypeVar("T", bound="OperationSummary")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@_attrs_define
|
|
18
|
+
class OperationSummary:
|
|
19
|
+
"""List view of an operation. Omits the heavy ``plan`` -- fetch a single operation by id for that.
|
|
20
|
+
|
|
21
|
+
Attributes:
|
|
22
|
+
cancelled_at (datetime.datetime | None):
|
|
23
|
+
committed_at (datetime.datetime | None):
|
|
24
|
+
created_at (datetime.datetime):
|
|
25
|
+
expires_at (datetime.datetime):
|
|
26
|
+
failed_at (datetime.datetime | None):
|
|
27
|
+
guild_id (int):
|
|
28
|
+
kind (OperationKind):
|
|
29
|
+
last_error (None | str):
|
|
30
|
+
operation_id (UUID):
|
|
31
|
+
reserved_archive_category_channel_id (int | None):
|
|
32
|
+
status (OperationStatus):
|
|
33
|
+
subject_discord_id (int):
|
|
34
|
+
tutor_discord_id (int | None):
|
|
35
|
+
updated_at (datetime.datetime):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
cancelled_at: datetime.datetime | None
|
|
39
|
+
committed_at: datetime.datetime | None
|
|
40
|
+
created_at: datetime.datetime
|
|
41
|
+
expires_at: datetime.datetime
|
|
42
|
+
failed_at: datetime.datetime | None
|
|
43
|
+
guild_id: int
|
|
44
|
+
kind: OperationKind
|
|
45
|
+
last_error: None | str
|
|
46
|
+
operation_id: UUID
|
|
47
|
+
reserved_archive_category_channel_id: int | None
|
|
48
|
+
status: OperationStatus
|
|
49
|
+
subject_discord_id: int
|
|
50
|
+
tutor_discord_id: int | None
|
|
51
|
+
updated_at: datetime.datetime
|
|
52
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> dict[str, Any]:
|
|
55
|
+
cancelled_at: None | str
|
|
56
|
+
if isinstance(self.cancelled_at, datetime.datetime):
|
|
57
|
+
cancelled_at = self.cancelled_at.isoformat()
|
|
58
|
+
else:
|
|
59
|
+
cancelled_at = self.cancelled_at
|
|
60
|
+
|
|
61
|
+
committed_at: None | str
|
|
62
|
+
if isinstance(self.committed_at, datetime.datetime):
|
|
63
|
+
committed_at = self.committed_at.isoformat()
|
|
64
|
+
else:
|
|
65
|
+
committed_at = self.committed_at
|
|
66
|
+
|
|
67
|
+
created_at = self.created_at.isoformat()
|
|
68
|
+
|
|
69
|
+
expires_at = self.expires_at.isoformat()
|
|
70
|
+
|
|
71
|
+
failed_at: None | str
|
|
72
|
+
if isinstance(self.failed_at, datetime.datetime):
|
|
73
|
+
failed_at = self.failed_at.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
failed_at = self.failed_at
|
|
76
|
+
|
|
77
|
+
guild_id = self.guild_id
|
|
78
|
+
|
|
79
|
+
kind = self.kind.value
|
|
80
|
+
|
|
81
|
+
last_error: None | str
|
|
82
|
+
last_error = self.last_error
|
|
83
|
+
|
|
84
|
+
operation_id = str(self.operation_id)
|
|
85
|
+
|
|
86
|
+
reserved_archive_category_channel_id: int | None
|
|
87
|
+
reserved_archive_category_channel_id = self.reserved_archive_category_channel_id
|
|
88
|
+
|
|
89
|
+
status = self.status.value
|
|
90
|
+
|
|
91
|
+
subject_discord_id = self.subject_discord_id
|
|
92
|
+
|
|
93
|
+
tutor_discord_id: int | None
|
|
94
|
+
tutor_discord_id = self.tutor_discord_id
|
|
95
|
+
|
|
96
|
+
updated_at = self.updated_at.isoformat()
|
|
97
|
+
|
|
98
|
+
field_dict: dict[str, Any] = {}
|
|
99
|
+
field_dict.update(self.additional_properties)
|
|
100
|
+
field_dict.update(
|
|
101
|
+
{
|
|
102
|
+
"cancelled_at": cancelled_at,
|
|
103
|
+
"committed_at": committed_at,
|
|
104
|
+
"created_at": created_at,
|
|
105
|
+
"expires_at": expires_at,
|
|
106
|
+
"failed_at": failed_at,
|
|
107
|
+
"guild_id": guild_id,
|
|
108
|
+
"kind": kind,
|
|
109
|
+
"last_error": last_error,
|
|
110
|
+
"operation_id": operation_id,
|
|
111
|
+
"reserved_archive_category_channel_id": reserved_archive_category_channel_id,
|
|
112
|
+
"status": status,
|
|
113
|
+
"subject_discord_id": subject_discord_id,
|
|
114
|
+
"tutor_discord_id": tutor_discord_id,
|
|
115
|
+
"updated_at": updated_at,
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return field_dict
|
|
120
|
+
|
|
121
|
+
@classmethod
|
|
122
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
123
|
+
d = dict(src_dict)
|
|
124
|
+
|
|
125
|
+
def _parse_cancelled_at(data: object) -> datetime.datetime | None:
|
|
126
|
+
if data is None:
|
|
127
|
+
return data
|
|
128
|
+
try:
|
|
129
|
+
if not isinstance(data, str):
|
|
130
|
+
raise TypeError()
|
|
131
|
+
cancelled_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
132
|
+
|
|
133
|
+
return cancelled_at_type_0
|
|
134
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
135
|
+
pass
|
|
136
|
+
return cast(datetime.datetime | None, data)
|
|
137
|
+
|
|
138
|
+
cancelled_at = _parse_cancelled_at(d.pop("cancelled_at"))
|
|
139
|
+
|
|
140
|
+
def _parse_committed_at(data: object) -> datetime.datetime | None:
|
|
141
|
+
if data is None:
|
|
142
|
+
return data
|
|
143
|
+
try:
|
|
144
|
+
if not isinstance(data, str):
|
|
145
|
+
raise TypeError()
|
|
146
|
+
committed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
147
|
+
|
|
148
|
+
return committed_at_type_0
|
|
149
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
150
|
+
pass
|
|
151
|
+
return cast(datetime.datetime | None, data)
|
|
152
|
+
|
|
153
|
+
committed_at = _parse_committed_at(d.pop("committed_at"))
|
|
154
|
+
|
|
155
|
+
created_at = datetime.datetime.fromisoformat(d.pop("created_at"))
|
|
156
|
+
|
|
157
|
+
expires_at = datetime.datetime.fromisoformat(d.pop("expires_at"))
|
|
158
|
+
|
|
159
|
+
def _parse_failed_at(data: object) -> datetime.datetime | None:
|
|
160
|
+
if data is None:
|
|
161
|
+
return data
|
|
162
|
+
try:
|
|
163
|
+
if not isinstance(data, str):
|
|
164
|
+
raise TypeError()
|
|
165
|
+
failed_at_type_0 = datetime.datetime.fromisoformat(data)
|
|
166
|
+
|
|
167
|
+
return failed_at_type_0
|
|
168
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
169
|
+
pass
|
|
170
|
+
return cast(datetime.datetime | None, data)
|
|
171
|
+
|
|
172
|
+
failed_at = _parse_failed_at(d.pop("failed_at"))
|
|
173
|
+
|
|
174
|
+
guild_id = d.pop("guild_id")
|
|
175
|
+
|
|
176
|
+
kind = OperationKind(d.pop("kind"))
|
|
177
|
+
|
|
178
|
+
def _parse_last_error(data: object) -> None | str:
|
|
179
|
+
if data is None:
|
|
180
|
+
return data
|
|
181
|
+
return cast(None | str, data)
|
|
182
|
+
|
|
183
|
+
last_error = _parse_last_error(d.pop("last_error"))
|
|
184
|
+
|
|
185
|
+
operation_id = UUID(d.pop("operation_id"))
|
|
186
|
+
|
|
187
|
+
def _parse_reserved_archive_category_channel_id(data: object) -> int | None:
|
|
188
|
+
if data is None:
|
|
189
|
+
return data
|
|
190
|
+
return cast(int | None, data)
|
|
191
|
+
|
|
192
|
+
reserved_archive_category_channel_id = _parse_reserved_archive_category_channel_id(
|
|
193
|
+
d.pop("reserved_archive_category_channel_id")
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
status = OperationStatus(d.pop("status"))
|
|
197
|
+
|
|
198
|
+
subject_discord_id = d.pop("subject_discord_id")
|
|
199
|
+
|
|
200
|
+
def _parse_tutor_discord_id(data: object) -> int | None:
|
|
201
|
+
if data is None:
|
|
202
|
+
return data
|
|
203
|
+
return cast(int | None, data)
|
|
204
|
+
|
|
205
|
+
tutor_discord_id = _parse_tutor_discord_id(d.pop("tutor_discord_id"))
|
|
206
|
+
|
|
207
|
+
updated_at = datetime.datetime.fromisoformat(d.pop("updated_at"))
|
|
208
|
+
|
|
209
|
+
operation_summary = cls(
|
|
210
|
+
cancelled_at=cancelled_at,
|
|
211
|
+
committed_at=committed_at,
|
|
212
|
+
created_at=created_at,
|
|
213
|
+
expires_at=expires_at,
|
|
214
|
+
failed_at=failed_at,
|
|
215
|
+
guild_id=guild_id,
|
|
216
|
+
kind=kind,
|
|
217
|
+
last_error=last_error,
|
|
218
|
+
operation_id=operation_id,
|
|
219
|
+
reserved_archive_category_channel_id=reserved_archive_category_channel_id,
|
|
220
|
+
status=status,
|
|
221
|
+
subject_discord_id=subject_discord_id,
|
|
222
|
+
tutor_discord_id=tutor_discord_id,
|
|
223
|
+
updated_at=updated_at,
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
operation_summary.additional_properties = d
|
|
227
|
+
return operation_summary
|
|
228
|
+
|
|
229
|
+
@property
|
|
230
|
+
def additional_keys(self) -> list[str]:
|
|
231
|
+
return list(self.additional_properties.keys())
|
|
232
|
+
|
|
233
|
+
def __getitem__(self, key: str) -> Any:
|
|
234
|
+
return self.additional_properties[key]
|
|
235
|
+
|
|
236
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
237
|
+
self.additional_properties[key] = value
|
|
238
|
+
|
|
239
|
+
def __delitem__(self, key: str) -> None:
|
|
240
|
+
del self.additional_properties[key]
|
|
241
|
+
|
|
242
|
+
def __contains__(self, key: str) -> bool:
|
|
243
|
+
return key in self.additional_properties
|