PyHiveLMS 5.12.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.
- pyhive/__init__.py +13 -0
- pyhive/client.py +355 -0
- pyhive/src/__init__.py +0 -0
- pyhive/src/authenticated_hive_client.py +250 -0
- pyhive/src/types/__init__.py +0 -0
- pyhive/src/types/assignment.py +192 -0
- pyhive/src/types/class_.py +113 -0
- pyhive/src/types/common.py +56 -0
- pyhive/src/types/core_item.py +22 -0
- pyhive/src/types/enums/__init__.py +0 -0
- pyhive/src/types/enums/action_enum.py +18 -0
- pyhive/src/types/enums/assignment_status_enum.py +17 -0
- pyhive/src/types/enums/class_type_enum.py +13 -0
- pyhive/src/types/enums/clearance_enum.py +16 -0
- pyhive/src/types/enums/event_type_enum.py +14 -0
- pyhive/src/types/enums/exercise_patbas_enum.py +15 -0
- pyhive/src/types/enums/exercise_preview_types.py +15 -0
- pyhive/src/types/enums/form_field_type_enum.py +15 -0
- pyhive/src/types/enums/gender_enum.py +14 -0
- pyhive/src/types/enums/help_response_type_enum.py +14 -0
- pyhive/src/types/enums/help_status_enum.py +13 -0
- pyhive/src/types/enums/help_type_enum.py +18 -0
- pyhive/src/types/enums/queue_rule_enum.py +15 -0
- pyhive/src/types/enums/status_enum.py +21 -0
- pyhive/src/types/enums/sync_status_enum.py +15 -0
- pyhive/src/types/enums/visibility_enum.py +14 -0
- pyhive/src/types/event.py +140 -0
- pyhive/src/types/event_attendees_type_0_item.py +69 -0
- pyhive/src/types/event_color.py +63 -0
- pyhive/src/types/exercise.py +192 -0
- pyhive/src/types/form_field.py +149 -0
- pyhive/src/types/help_.py +275 -0
- pyhive/src/types/help_response.py +113 -0
- pyhive/src/types/help_response_segel_nested.py +129 -0
- pyhive/src/types/module.py +107 -0
- pyhive/src/types/notification_nested.py +80 -0
- pyhive/src/types/program.py +172 -0
- pyhive/src/types/queue.py +150 -0
- pyhive/src/types/queue_item.py +88 -0
- pyhive/src/types/subject.py +116 -0
- pyhive/src/types/tag.py +62 -0
- pyhive/src/types/user.py +375 -0
- pyhivelms-5.12.0.dist-info/METADATA +92 -0
- pyhivelms-5.12.0.dist-info/RECORD +45 -0
- pyhivelms-5.12.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"""Defines the Assignment type and related logic for representing student assignments in the Hive API."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from attrs import define, field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
from src.types.common import UNSET, Unset
|
|
10
|
+
from src.types.core_item import HiveCoreItem
|
|
11
|
+
from src.types.enums.assignment_status_enum import AssignmentStatusEnum
|
|
12
|
+
from src.types.notification_nested import NotificationNested
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from client import HiveClient
|
|
16
|
+
from src.types.exercise import Exercise
|
|
17
|
+
from src.types.user import User
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="Assignment")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@define
|
|
23
|
+
class Assignment(HiveCoreItem):
|
|
24
|
+
"""Represents a student's assignment for an exercise.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
hive_client: Reference to the Hive API client.
|
|
28
|
+
id: Unique assignment ID.
|
|
29
|
+
user_id: ID of the assigned student.
|
|
30
|
+
checker_id: ID of the assigned checker, or None.
|
|
31
|
+
checker_first_name: First name of the checker.
|
|
32
|
+
checker_last_name: Last name of the checker.
|
|
33
|
+
is_subscribed: Whether the student is subscribed to updates.
|
|
34
|
+
exercise_id: ID of the exercise.
|
|
35
|
+
assignment_status: Current state of the assignment.
|
|
36
|
+
patbas: Whether it's a PATBAS assignment.
|
|
37
|
+
notifications: List of related notifications.
|
|
38
|
+
last_staff_updated: Timestamp of the last staff update.
|
|
39
|
+
work_time: Total work time in minutes.
|
|
40
|
+
student_assignment_status: The student’s view of the assignment status.
|
|
41
|
+
description: Optional text description.
|
|
42
|
+
submission_count: Total number of submissions.
|
|
43
|
+
total_check_count: Number of total checks.
|
|
44
|
+
manual_check_count: Number of manual checks.
|
|
45
|
+
flagged: Whether the assignment is flagged for review.
|
|
46
|
+
timer: Optional timer state string.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
hive_client: "HiveClient"
|
|
51
|
+
id: int
|
|
52
|
+
user_id: int
|
|
53
|
+
checker_id: None | int
|
|
54
|
+
checker_first_name: str
|
|
55
|
+
checker_last_name: str
|
|
56
|
+
is_subscribed: bool
|
|
57
|
+
exercise_id: int
|
|
58
|
+
assignment_status: AssignmentStatusEnum
|
|
59
|
+
patbas: bool
|
|
60
|
+
notifications: list["NotificationNested"]
|
|
61
|
+
last_staff_updated: datetime.datetime
|
|
62
|
+
work_time: int
|
|
63
|
+
student_assignment_status: Unset | AssignmentStatusEnum = UNSET
|
|
64
|
+
description: None | Unset | str = UNSET
|
|
65
|
+
submission_count: Unset | int = UNSET
|
|
66
|
+
total_check_count: Unset | int = UNSET
|
|
67
|
+
manual_check_count: Unset | int = UNSET
|
|
68
|
+
flagged: Unset | bool = UNSET
|
|
69
|
+
timer: None | Unset | str = UNSET
|
|
70
|
+
|
|
71
|
+
# Lazy-loaded objects
|
|
72
|
+
_user: "User | None" = field(init=False, default=None)
|
|
73
|
+
_checker: "User | None" = field(init=False, default=None)
|
|
74
|
+
_exercise: "Exercise | None" = field(init=False, default=None)
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def user(self) -> "User":
|
|
78
|
+
"""Lazily load and return the user this assignment belongs to."""
|
|
79
|
+
if self._user is None:
|
|
80
|
+
self._user = self.hive_client.get_user(self.user_id)
|
|
81
|
+
return self._user
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def checker(self) -> "User | None":
|
|
85
|
+
"""Lazily load and return the checker (if any) assigned to this assignment."""
|
|
86
|
+
if self.checker_id is None:
|
|
87
|
+
return None
|
|
88
|
+
if self._checker is None:
|
|
89
|
+
self._checker = self.hive_client.get_user(self.checker_id)
|
|
90
|
+
return self._checker
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def exercise(self) -> "Exercise":
|
|
94
|
+
"""Lazily load and return the exercise associated with this assignment."""
|
|
95
|
+
if self._exercise is None:
|
|
96
|
+
self._exercise = self.hive_client.get_exercise(self.exercise_id)
|
|
97
|
+
return self._exercise
|
|
98
|
+
|
|
99
|
+
def to_dict(self) -> dict[str, Any]:
|
|
100
|
+
"""Serialize Assignment to a dictionary."""
|
|
101
|
+
result: dict[str, None | str | int | list[dict[str, Any]]] = {
|
|
102
|
+
"id": self.id,
|
|
103
|
+
"user": self.user_id,
|
|
104
|
+
"checker": self.checker_id,
|
|
105
|
+
"checker_first_name": self.checker_first_name,
|
|
106
|
+
"checker_last_name": self.checker_last_name,
|
|
107
|
+
"is_subscribed": self.is_subscribed,
|
|
108
|
+
"exercise": self.exercise_id,
|
|
109
|
+
"assignment_status": self.assignment_status.value,
|
|
110
|
+
"patbas": self.patbas,
|
|
111
|
+
"notifications": [n.to_dict() for n in self.notifications],
|
|
112
|
+
"last_staff_updated": self.last_staff_updated.isoformat(),
|
|
113
|
+
"work_time": self.work_time,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# Conditionally include optional/unset fields
|
|
117
|
+
if not isinstance(self.student_assignment_status, Unset):
|
|
118
|
+
result["student_assignment_status"] = self.student_assignment_status.value
|
|
119
|
+
if not isinstance(self.description, Unset):
|
|
120
|
+
result["description"] = self.description
|
|
121
|
+
if not isinstance(self.submission_count, Unset):
|
|
122
|
+
result["submission_count"] = self.submission_count
|
|
123
|
+
if not isinstance(self.total_check_count, Unset):
|
|
124
|
+
result["total_check_count"] = self.total_check_count
|
|
125
|
+
if not isinstance(self.manual_check_count, Unset):
|
|
126
|
+
result["manual_check_count"] = self.manual_check_count
|
|
127
|
+
if not isinstance(self.flagged, Unset):
|
|
128
|
+
result["flagged"] = self.flagged
|
|
129
|
+
if not isinstance(self.timer, Unset):
|
|
130
|
+
result["timer"] = self.timer
|
|
131
|
+
|
|
132
|
+
return result
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def from_dict(cls, src_dict: Mapping[str, Any], hive_client: "HiveClient") -> Self:
|
|
136
|
+
"""Deserialize Assignment from a dictionary."""
|
|
137
|
+
|
|
138
|
+
d = dict(src_dict)
|
|
139
|
+
|
|
140
|
+
notifications = [
|
|
141
|
+
NotificationNested.from_dict(n, hive_client=hive_client)
|
|
142
|
+
for n in d.pop("notifications", [])
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
student_assignment_status = (
|
|
146
|
+
AssignmentStatusEnum(d["student_assignment_status"])
|
|
147
|
+
if "student_assignment_status" in d
|
|
148
|
+
and not isinstance(d["student_assignment_status"], Unset)
|
|
149
|
+
else UNSET
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
description = d.pop("description", UNSET)
|
|
153
|
+
submission_count = d.pop("submission_count", UNSET)
|
|
154
|
+
total_check_count = d.pop("total_check_count", UNSET)
|
|
155
|
+
manual_check_count = d.pop("manual_check_count", UNSET)
|
|
156
|
+
flagged = d.pop("flagged", UNSET)
|
|
157
|
+
timer = d.pop("timer", UNSET)
|
|
158
|
+
|
|
159
|
+
return cls(
|
|
160
|
+
hive_client=hive_client,
|
|
161
|
+
id=d["id"],
|
|
162
|
+
user_id=d["user"],
|
|
163
|
+
checker_id=cast("int | None", d["checker"]),
|
|
164
|
+
checker_first_name=d["checker_first_name"],
|
|
165
|
+
checker_last_name=d["checker_last_name"],
|
|
166
|
+
is_subscribed=d["is_subscribed"],
|
|
167
|
+
exercise_id=d["exercise"],
|
|
168
|
+
assignment_status=AssignmentStatusEnum(d["assignment_status"]),
|
|
169
|
+
patbas=d["patbas"],
|
|
170
|
+
notifications=notifications,
|
|
171
|
+
last_staff_updated=isoparse(d["last_staff_updated"]),
|
|
172
|
+
work_time=d["work_time"],
|
|
173
|
+
student_assignment_status=student_assignment_status,
|
|
174
|
+
description=cast("str | None | Unset", description),
|
|
175
|
+
submission_count=cast("int | Unset", submission_count),
|
|
176
|
+
total_check_count=cast("int | Unset", total_check_count),
|
|
177
|
+
manual_check_count=cast("int | Unset", manual_check_count),
|
|
178
|
+
flagged=cast("bool | Unset", flagged),
|
|
179
|
+
timer=cast("str | None | Unset", timer),
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
def __eq__(self, value: object) -> bool:
|
|
183
|
+
if not isinstance(value, Assignment):
|
|
184
|
+
return False
|
|
185
|
+
return (
|
|
186
|
+
self.id == value.id
|
|
187
|
+
and self.exercise_id == value.exercise_id
|
|
188
|
+
and self.user_id == value.user_id
|
|
189
|
+
and self.checker_id == value.checker_id
|
|
190
|
+
and self.assignment_status == value.assignment_status
|
|
191
|
+
and self.exercise == value.exercise
|
|
192
|
+
)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Defines the Class type representing a school class/group in a program,
|
|
3
|
+
including serialization and lazy-loading of related objects.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Mapping
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar, cast
|
|
8
|
+
|
|
9
|
+
from attrs import define, field
|
|
10
|
+
from src.types.common import UNSET, Unset
|
|
11
|
+
from src.types.core_item import HiveCoreItem
|
|
12
|
+
from src.types.enums.class_type_enum import ClassTypeEnum
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from client import HiveClient
|
|
16
|
+
from src.types.program import Program
|
|
17
|
+
from src.types.user import User
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="Class")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@define
|
|
23
|
+
class Class(HiveCoreItem):
|
|
24
|
+
"""Represents a school class/group in a program.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
id: Unique class ID.
|
|
28
|
+
name: Internal name.
|
|
29
|
+
display_name: Display name for UI.
|
|
30
|
+
program_id: ID of the associated program.
|
|
31
|
+
user_ids: List of user IDs assigned to this class.
|
|
32
|
+
program_name: Name of the program.
|
|
33
|
+
email: Optional class email address.
|
|
34
|
+
type_: Type of class, e.g., Room or Student Group.
|
|
35
|
+
description: Optional description text.
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
hive_client: "HiveClient"
|
|
40
|
+
id: int
|
|
41
|
+
name: str
|
|
42
|
+
display_name: str
|
|
43
|
+
program_id: int
|
|
44
|
+
user_ids: list[int]
|
|
45
|
+
program_name: str
|
|
46
|
+
email: Unset | str = UNSET
|
|
47
|
+
type_: Unset | ClassTypeEnum = UNSET
|
|
48
|
+
description: None | Unset | str = UNSET
|
|
49
|
+
|
|
50
|
+
# Lazy-loaded fields
|
|
51
|
+
_program: "Program | None" = field(init=False, default=None)
|
|
52
|
+
_users: "list[User] | None" = field(init=False, default=None)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def program(self) -> "Program":
|
|
56
|
+
"""Lazily load the associated Program object."""
|
|
57
|
+
if self._program is None:
|
|
58
|
+
self._program = self.hive_client.get_program(self.program_id)
|
|
59
|
+
return self._program
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def users(self) -> list["User"]:
|
|
63
|
+
"""Lazily load the list of User objects in this class."""
|
|
64
|
+
if self._users is None:
|
|
65
|
+
self._users = [self.hive_client.get_user(uid) for uid in self.user_ids]
|
|
66
|
+
return self._users
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> dict[str, Any]:
|
|
69
|
+
"""Serialize Class to dictionary form."""
|
|
70
|
+
result: dict[str, Any] = {
|
|
71
|
+
"id": self.id,
|
|
72
|
+
"name": self.name,
|
|
73
|
+
"display_name": self.display_name,
|
|
74
|
+
"program": self.program_id,
|
|
75
|
+
"users": self.user_ids,
|
|
76
|
+
"program__name": self.program_name,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if not isinstance(self.email, Unset):
|
|
80
|
+
result["email"] = self.email
|
|
81
|
+
if not isinstance(self.type_, Unset):
|
|
82
|
+
result["type"] = self.type_.value
|
|
83
|
+
if not isinstance(self.description, Unset):
|
|
84
|
+
result["description"] = self.description
|
|
85
|
+
|
|
86
|
+
return result
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, src_dict: Mapping[str, Any], hive_client: "HiveClient") -> Self:
|
|
90
|
+
"""Deserialize Class from dictionary form."""
|
|
91
|
+
d = dict(src_dict)
|
|
92
|
+
|
|
93
|
+
return cls(
|
|
94
|
+
hive_client=hive_client,
|
|
95
|
+
id=d["id"],
|
|
96
|
+
name=d["name"],
|
|
97
|
+
display_name=d["display_name"],
|
|
98
|
+
program_id=d["program"],
|
|
99
|
+
user_ids=cast("list[int]", d["users"]),
|
|
100
|
+
program_name=d["program__name"],
|
|
101
|
+
email=d.get("email", UNSET),
|
|
102
|
+
type_=(
|
|
103
|
+
UNSET
|
|
104
|
+
if isinstance((type_val := d.get("type", UNSET)), Unset)
|
|
105
|
+
else ClassTypeEnum(type_val)
|
|
106
|
+
),
|
|
107
|
+
description=cast("None | Unset | str", d.get("description", UNSET)),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def __eq__(self, value: object) -> bool:
|
|
111
|
+
if not isinstance(value, Class):
|
|
112
|
+
return False
|
|
113
|
+
return self.id == value.id and self.program_id == value.program_id
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""Contains some shared types for properties."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping, MutableMapping
|
|
4
|
+
from http import HTTPStatus
|
|
5
|
+
from typing import IO, BinaryIO, Generic, Literal, TypeVar, Union
|
|
6
|
+
|
|
7
|
+
from attrs import define
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Unset: # pylint: disable=too-few-public-methods
|
|
11
|
+
"""Sentinel type for unset optional values."""
|
|
12
|
+
|
|
13
|
+
def __bool__(self) -> Literal[False]:
|
|
14
|
+
return False
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
UNSET: Unset = Unset()
|
|
18
|
+
|
|
19
|
+
# The types that `httpx.Client(files=)` can accept, copied from that library.
|
|
20
|
+
FileContent = Union[IO[bytes], bytes, str]
|
|
21
|
+
FileTypes = Union[
|
|
22
|
+
# (filename, file (or bytes), content_type)
|
|
23
|
+
tuple[str | None, FileContent, str | None],
|
|
24
|
+
# (filename, file (or bytes), content_type, headers)
|
|
25
|
+
tuple[str | None, FileContent, str | None, Mapping[str, str]],
|
|
26
|
+
]
|
|
27
|
+
RequestFiles = list[tuple[str, FileTypes]]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@define
|
|
31
|
+
class File:
|
|
32
|
+
"""Contains information for file uploads."""
|
|
33
|
+
|
|
34
|
+
payload: BinaryIO
|
|
35
|
+
file_name: str | None = None
|
|
36
|
+
mime_type: str | None = None
|
|
37
|
+
|
|
38
|
+
def to_tuple(self) -> FileTypes:
|
|
39
|
+
"""Return a tuple representation that httpx will accept for multipart/form-data ."""
|
|
40
|
+
return self.file_name, self.payload, self.mime_type
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
T = TypeVar("T")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@define
|
|
47
|
+
class Response(Generic[T]):
|
|
48
|
+
"""A response from an endpoint."""
|
|
49
|
+
|
|
50
|
+
status_code: HTTPStatus
|
|
51
|
+
content: bytes
|
|
52
|
+
headers: MutableMapping[str, str]
|
|
53
|
+
parsed: T | None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Base class for Hive core items."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, Self
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from client import HiveClient
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class HiveCoreItem:
|
|
11
|
+
"""Base class for Hive core items."""
|
|
12
|
+
|
|
13
|
+
def to_dict(self) -> dict[str, Any]:
|
|
14
|
+
"""Serialize this HiveCoreItem instance to a plain dictionary."""
|
|
15
|
+
raise NotImplementedError
|
|
16
|
+
|
|
17
|
+
@classmethod
|
|
18
|
+
def from_dict(
|
|
19
|
+
cls, src_dict: Mapping[str, Any], hive_client: "HiveClient"
|
|
20
|
+
) -> Self: # noqa: D102
|
|
21
|
+
"""Deserialize a HiveCoreItem instance from a mapping."""
|
|
22
|
+
raise NotImplementedError
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Enumeration of possible action states for auto-tests."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ActionEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible action states for auto-tests."""
|
|
8
|
+
|
|
9
|
+
BUILT = "Built"
|
|
10
|
+
ERROR = "Error"
|
|
11
|
+
FINISHED = "Finished"
|
|
12
|
+
HANDLING = "Handling"
|
|
13
|
+
NO_CHECK = "No Check"
|
|
14
|
+
SENDING = "Sending"
|
|
15
|
+
SUCCESS = "Success"
|
|
16
|
+
|
|
17
|
+
def __str__(self) -> str:
|
|
18
|
+
return str(self.value)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Enumeration for assignment statuses (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AssignmentStatusEnum(str, Enum):
|
|
7
|
+
"""The status of an assignment."""
|
|
8
|
+
|
|
9
|
+
AUTOCHECKED = "AutoChecked"
|
|
10
|
+
DONE = "Done"
|
|
11
|
+
NEW = "New"
|
|
12
|
+
REDO = "Redo"
|
|
13
|
+
SUBMITTED = "Submitted"
|
|
14
|
+
WORK_IN_PROGRESS = "Work In Progress"
|
|
15
|
+
|
|
16
|
+
def __str__(self) -> str:
|
|
17
|
+
return str(self.value)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Enumeration for user clearance levels."""
|
|
2
|
+
|
|
3
|
+
from enum import IntEnum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ClearanceEnum(IntEnum):
|
|
7
|
+
"""Enumeration of user clearance levels in the Hive system."""
|
|
8
|
+
|
|
9
|
+
# TODO: Replace VALUE_X with actual clearance level names
|
|
10
|
+
VALUE_1 = 1
|
|
11
|
+
VALUE_2 = 2
|
|
12
|
+
VALUE_3 = 3
|
|
13
|
+
VALUE_5 = 5
|
|
14
|
+
|
|
15
|
+
def __str__(self) -> str:
|
|
16
|
+
return str(self.value)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Enumeration for event types (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class EventTypeEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible event types in the Hive system."""
|
|
8
|
+
|
|
9
|
+
הרצאה = "הרצאה" # pylint: disable=non-ascii-name
|
|
10
|
+
עע = "עע" # pylint: disable=non-ascii-name
|
|
11
|
+
פתבס = "פתבס" # pylint: disable=non-ascii-name
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Enumeration for PATBAS settings (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PatbasEnum(str, Enum):
|
|
7
|
+
"""PATBAS settings."""
|
|
8
|
+
|
|
9
|
+
ALWAYS = "Always"
|
|
10
|
+
NEVER = "Never"
|
|
11
|
+
ON_DONE = "On Done"
|
|
12
|
+
STAFF_ONLY = "Staff Only"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Enumeration for exercise preview types.
|
|
2
|
+
This is the document type of the instructions for an exercise (auto-generated)."""
|
|
3
|
+
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ExercisePreviewTypes(str, Enum):
|
|
8
|
+
"""Exercise preview types."""
|
|
9
|
+
|
|
10
|
+
DISABLED = "Disabled"
|
|
11
|
+
MARKDOWN = "Markdown"
|
|
12
|
+
PDF = "PDF"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Enumeration for form field types (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class FormFieldTypeEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible form field types."""
|
|
8
|
+
|
|
9
|
+
MULTIPLE = "multiple"
|
|
10
|
+
MULTIRESPONSE = "multiResponse"
|
|
11
|
+
NUMBER = "number"
|
|
12
|
+
TEXT = "text"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Enumeration for gender types."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class GenderEnum(str, Enum):
|
|
7
|
+
"""Enumeration of gender types."""
|
|
8
|
+
|
|
9
|
+
FEMALE = "Female"
|
|
10
|
+
MALE = "Male"
|
|
11
|
+
NONBINARY = "NonBinary"
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Enumeration for help response types (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class HelpResponseTypeEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible help response types."""
|
|
8
|
+
|
|
9
|
+
COMMENT = "Comment"
|
|
10
|
+
OPEN = "Open"
|
|
11
|
+
RESOLVE = "Resolve"
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Enumeration for help request types (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class HelpTypeEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible help request types."""
|
|
8
|
+
|
|
9
|
+
CHAT = "Chat"
|
|
10
|
+
ERROR = "Error"
|
|
11
|
+
EXERCISE = "Exercise"
|
|
12
|
+
MEDICAL = "Medical"
|
|
13
|
+
MUSIC = "Music"
|
|
14
|
+
OTHER = "Other"
|
|
15
|
+
REQUEST = "Request"
|
|
16
|
+
|
|
17
|
+
def __str__(self) -> str:
|
|
18
|
+
return str(self.value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Enumeration for exercise Queue Rules."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class QueueRuleEnum(str, Enum):
|
|
7
|
+
"""Enumeration for exercise Queue Rules."""
|
|
8
|
+
|
|
9
|
+
CHOOSE = "Choose"
|
|
10
|
+
WAIT_FOR_AUTOCHECKS = "Wait For AutoChecks"
|
|
11
|
+
WAIT_FOR_DONE = "Wait For Done"
|
|
12
|
+
WAIT_FOR_SUBMITTED = "Wait For Submitted"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""StatusEnum class representing various user statuses."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class StatusEnum(str, Enum):
|
|
7
|
+
"""Enumeration of user statuses."""
|
|
8
|
+
|
|
9
|
+
HOME = "Home"
|
|
10
|
+
MEDICAL = "Medical"
|
|
11
|
+
PERSONAL_TALK = "Personal Talk"
|
|
12
|
+
PRAYER = "Prayer"
|
|
13
|
+
PRESENT = "Present"
|
|
14
|
+
RAISED_HAND = "Raised Hand"
|
|
15
|
+
ROOM = "Room"
|
|
16
|
+
TOILET = "Toilet"
|
|
17
|
+
TOILET_REQUEST = "Toilet Request"
|
|
18
|
+
WORK_TALK = "Work Talk"
|
|
19
|
+
|
|
20
|
+
def __str__(self) -> str:
|
|
21
|
+
return str(self.value)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Enumeration for synchronization status (auto-generated)."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SyncStatusEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible synchronization statuses."""
|
|
8
|
+
|
|
9
|
+
CREATING = "Creating"
|
|
10
|
+
DELETING = "Deleting"
|
|
11
|
+
ERROR = "Error"
|
|
12
|
+
NORMAL = "Normal"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Enumeration for visibility levels of help requests."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class VisibilityEnum(str, Enum):
|
|
7
|
+
"""Enumeration of visibility levels for help requests."""
|
|
8
|
+
|
|
9
|
+
ALL_STAFF = "All Staff"
|
|
10
|
+
ALL_STAFF_AND_CHECKERS = "All Staff And Checkers"
|
|
11
|
+
AUTHOR_ONLY = "Author Only"
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|