PyHiveLMS 1.0.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/cli/__init__.py +0 -0
- pyhive/cli/main.py +30 -0
- pyhive/client.py +570 -0
- pyhive/src/__init__.py +0 -0
- pyhive/src/_generated_versions.py +3 -0
- pyhive/src/api_versions.py +6 -0
- pyhive/src/authenticated_hive_client.py +250 -0
- pyhive/src/types/__init__.py +0 -0
- pyhive/src/types/assignment.py +210 -0
- pyhive/src/types/assignment_response.py +205 -0
- pyhive/src/types/assignment_response_content.py +131 -0
- pyhive/src/types/autocheck_status.py +94 -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_response_type_enum.py +17 -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 +216 -0
- pyhive/src/types/form_field.py +152 -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 +141 -0
- pyhive/src/types/notification_nested.py +80 -0
- pyhive/src/types/program.py +180 -0
- pyhive/src/types/queue.py +150 -0
- pyhive/src/types/queue_item.py +88 -0
- pyhive/src/types/subject.py +156 -0
- pyhive/src/types/tag.py +62 -0
- pyhive/src/types/user.py +450 -0
- pyhive/types.py +23 -0
- pyhivelms-1.0.0.dist-info/METADATA +156 -0
- pyhivelms-1.0.0.dist-info/RECORD +55 -0
- pyhivelms-1.0.0.dist-info/WHEEL +4 -0
- pyhivelms-1.0.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""AssignmentResponseContent type definition."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, TYPE_CHECKING
|
|
5
|
+
from attrs import define, field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from .core_item import HiveCoreItem
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ...client import HiveClient
|
|
11
|
+
from .form_field import FormField
|
|
12
|
+
from .assignment import Assignment
|
|
13
|
+
from .assignment import AssignmentLike
|
|
14
|
+
from .assignment_response import AssignmentResponse
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="AssignmentResponseContent")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@define
|
|
20
|
+
class AssignmentResponseContent(HiveCoreItem):
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
content (str):
|
|
24
|
+
field_id (int):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
hive_client: "HiveClient"
|
|
28
|
+
assignment_id: int
|
|
29
|
+
assignment_response_id: int
|
|
30
|
+
raw_content: str
|
|
31
|
+
field_id: int
|
|
32
|
+
|
|
33
|
+
# Lazy-loaded objects
|
|
34
|
+
_content: "str | int | list[str | int] | None" = _attrs_field(
|
|
35
|
+
init=False, default=None
|
|
36
|
+
)
|
|
37
|
+
_field: "FormField | None" = _attrs_field(init=False, default=None)
|
|
38
|
+
_assignment: "Assignment | None" = _attrs_field(init=False, default=None)
|
|
39
|
+
_assignment_response: "AssignmentResponse | None" = _attrs_field(
|
|
40
|
+
init=False, default=None
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
raw_content = self.raw_content
|
|
45
|
+
|
|
46
|
+
field_id = self.field_id
|
|
47
|
+
|
|
48
|
+
field_dict: dict[str, Any] = {}
|
|
49
|
+
field_dict.update(
|
|
50
|
+
{
|
|
51
|
+
"content": raw_content,
|
|
52
|
+
"field": field_id,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
return field_dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict( # pylint: disable=arguments-differ
|
|
60
|
+
cls: type[T],
|
|
61
|
+
src_dict: Mapping[str, Any],
|
|
62
|
+
assignment: "AssignmentLike",
|
|
63
|
+
assignment_response_id: int,
|
|
64
|
+
hive_client: "HiveClient",
|
|
65
|
+
) -> T:
|
|
66
|
+
d = dict(src_dict)
|
|
67
|
+
raw_content = d.pop("content")
|
|
68
|
+
field_id = d.pop("field")
|
|
69
|
+
|
|
70
|
+
return cls(
|
|
71
|
+
hive_client=hive_client,
|
|
72
|
+
assignment_id=(
|
|
73
|
+
assignment.id if isinstance(assignment, HiveCoreItem) else assignment
|
|
74
|
+
),
|
|
75
|
+
assignment_response_id=assignment_response_id,
|
|
76
|
+
raw_content=raw_content,
|
|
77
|
+
field_id=field_id,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def field(self) -> "FormField":
|
|
82
|
+
"""Lazily load and return the field this assignment belongs to."""
|
|
83
|
+
if self._field is None:
|
|
84
|
+
self._field = self.hive_client.get_exercise_field(
|
|
85
|
+
exercise=self.assignment.exercise_id, field_id=self.field_id
|
|
86
|
+
)
|
|
87
|
+
return self._field
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def assignment(self) -> "Assignment":
|
|
91
|
+
"""Lazily load and return the assignment this content belongs to."""
|
|
92
|
+
if self._assignment is None:
|
|
93
|
+
self._assignment = self.hive_client.get_assignment(
|
|
94
|
+
assignment_id=self.assignment_id
|
|
95
|
+
)
|
|
96
|
+
return self._assignment
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def assignment_response(self) -> "AssignmentResponse":
|
|
100
|
+
"""Lazily load and return the assignment response this content belongs to."""
|
|
101
|
+
if self._assignment_response is None:
|
|
102
|
+
self._assignment_response = self.hive_client.get_assignment_response(
|
|
103
|
+
assignment=self.assignment_id,
|
|
104
|
+
response_id=self.assignment_response_id,
|
|
105
|
+
)
|
|
106
|
+
return self._assignment_response
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def content(self) -> "str | int | list[str | int]":
|
|
110
|
+
"""Lazily parse and return the content based on the field type."""
|
|
111
|
+
from .enums.form_field_type_enum import (
|
|
112
|
+
FormFieldTypeEnum,
|
|
113
|
+
) # pylint: disable=import-outside-toplevel
|
|
114
|
+
|
|
115
|
+
if self._content is None:
|
|
116
|
+
if self.field.type_ is FormFieldTypeEnum.NUMBER:
|
|
117
|
+
self._content = int(self.raw_content)
|
|
118
|
+
elif self.field.type_ is FormFieldTypeEnum.TEXT:
|
|
119
|
+
self._content = str(self.raw_content)
|
|
120
|
+
elif self.field.type_ is FormFieldTypeEnum.MULTIPLE:
|
|
121
|
+
self._content = self.field.choices[int(self.raw_content)]
|
|
122
|
+
elif self.field.type_ is FormFieldTypeEnum.MULTIRESPONSE:
|
|
123
|
+
self._content = list(
|
|
124
|
+
self.field.choices[int(i)] for i in self.raw_content.split(",")
|
|
125
|
+
)
|
|
126
|
+
else:
|
|
127
|
+
raise ValueError(f"Unsupported form field type: {self.field.type_}")
|
|
128
|
+
return self._content
|
|
129
|
+
|
|
130
|
+
def __str__(self):
|
|
131
|
+
return str(self.content)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""AutoCheckStatus type definition."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar, Union, cast, TYPE_CHECKING
|
|
6
|
+
from attrs import define
|
|
7
|
+
from dateutil.parser import isoparse
|
|
8
|
+
|
|
9
|
+
from .core_item import HiveCoreItem
|
|
10
|
+
from .enums.action_enum import ActionEnum
|
|
11
|
+
from .common import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ...client import HiveClient
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="AutoCheckStatus")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@define
|
|
20
|
+
class AutoCheckStatus(HiveCoreItem):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
id (int):
|
|
25
|
+
time (datetime.datetime):
|
|
26
|
+
action (ActionEnum):
|
|
27
|
+
* `Handling` - Handling
|
|
28
|
+
* `No Check` - Nocheck
|
|
29
|
+
* `Built` - Built
|
|
30
|
+
* `Finished` - Finished
|
|
31
|
+
* `Sending` - Sending
|
|
32
|
+
* `Error` - Error
|
|
33
|
+
* `Success` - Success
|
|
34
|
+
payload (Union[None, Unset, str]):
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
hive_client: "HiveClient"
|
|
39
|
+
id: int
|
|
40
|
+
time: datetime.datetime
|
|
41
|
+
action: ActionEnum
|
|
42
|
+
payload: Union[None, Unset, str] = UNSET
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
id = self.id
|
|
46
|
+
time = self.time.isoformat()
|
|
47
|
+
action = self.action.value
|
|
48
|
+
payload: Union[None, Unset, str]
|
|
49
|
+
|
|
50
|
+
if isinstance(self.payload, Unset):
|
|
51
|
+
payload = UNSET
|
|
52
|
+
else:
|
|
53
|
+
payload = self.payload
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
field_dict.update(
|
|
56
|
+
{
|
|
57
|
+
"id": id,
|
|
58
|
+
"time": time,
|
|
59
|
+
"action": action,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
if payload is not UNSET:
|
|
64
|
+
field_dict["payload"] = payload
|
|
65
|
+
|
|
66
|
+
return field_dict
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_dict(
|
|
70
|
+
cls: type[T],
|
|
71
|
+
src_dict: Mapping[str, Any],
|
|
72
|
+
hive_client: "HiveClient",
|
|
73
|
+
) -> T:
|
|
74
|
+
d = dict(src_dict)
|
|
75
|
+
id = d.pop("id")
|
|
76
|
+
time = isoparse(d.pop("time"))
|
|
77
|
+
action = ActionEnum(d.pop("action"))
|
|
78
|
+
|
|
79
|
+
def _parse_payload(data: object) -> Union[None, Unset, str]:
|
|
80
|
+
if data is None:
|
|
81
|
+
return data
|
|
82
|
+
if isinstance(data, Unset):
|
|
83
|
+
return data
|
|
84
|
+
return cast(Union[None, Unset, str], data)
|
|
85
|
+
|
|
86
|
+
payload = _parse_payload(d.pop("payload", UNSET))
|
|
87
|
+
|
|
88
|
+
return cls(
|
|
89
|
+
hive_client=hive_client,
|
|
90
|
+
id=id,
|
|
91
|
+
time=time,
|
|
92
|
+
action=action,
|
|
93
|
+
payload=payload,
|
|
94
|
+
)
|
|
@@ -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 .common import UNSET, Unset
|
|
11
|
+
from .core_item import HiveCoreItem
|
|
12
|
+
from .enums.class_type_enum import ClassTypeEnum
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ...client import HiveClient
|
|
16
|
+
from .program import Program
|
|
17
|
+
from .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 Response Types."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AssignmentResponseTypeEnum(str, Enum):
|
|
7
|
+
"""Enumeration of possible assignment response types."""
|
|
8
|
+
|
|
9
|
+
AUTOCHECK = "AutoCheck"
|
|
10
|
+
COMMENT = "Comment"
|
|
11
|
+
DONE = "Done"
|
|
12
|
+
REDO = "Redo"
|
|
13
|
+
SUBMISSION = "Submission"
|
|
14
|
+
WORK_IN_PROGRESS = "Work In Progress"
|
|
15
|
+
|
|
16
|
+
def __str__(self) -> str:
|
|
17
|
+
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)
|