maleo-enums 0.0.27__py3-none-any.whl → 0.0.30__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.
maleo/enums/system.py CHANGED
@@ -1,9 +1,10 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar
3
- from maleo.types.string import ListOfStrings
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
4
5
 
5
6
 
6
- class Role(StrEnum):
7
+ class SystemRole(StrEnum):
7
8
  ADMINISTRATOR = "administrator"
8
9
  ANALYST = "analyst"
9
10
  ENGINEER = "engineer"
@@ -17,14 +18,40 @@ class Role(StrEnum):
17
18
  USER = "user"
18
19
 
19
20
  @classmethod
20
- def choices(cls) -> ListOfStrings:
21
+ def choices(cls) -> ListOfStrs:
21
22
  return [e.value for e in cls]
22
23
 
23
24
 
24
- RoleT = TypeVar("RoleT", bound=Role)
25
- OptionalRole = Optional[Role]
26
- OptionalRoleT = TypeVar("OptionalRoleT", bound=OptionalRole)
27
- ListOfRoles = List[Role]
28
- OptionalListOfRoles = Optional[ListOfRoles]
29
- SequenceOfRoles = Sequence[Role]
30
- OptionalSequenceOfRoles = Optional[SequenceOfRoles]
25
+ SystemRoleT = TypeVar("SystemRoleT", bound=SystemRole)
26
+ OptSystemRole = SystemRole | None
27
+ OptSystemRoleT = TypeVar("OptSystemRoleT", bound=OptSystemRole)
28
+
29
+
30
+ class SimpleSystemRoleMixin(BaseModel, Generic[OptSystemRoleT]):
31
+ role: Annotated[OptSystemRoleT, Field(..., description="System Role")]
32
+
33
+
34
+ class FullSystemRoleMixin(BaseModel, Generic[OptSystemRoleT]):
35
+ system_role: Annotated[OptSystemRoleT, Field(..., description="System Role")]
36
+
37
+
38
+ ListOfSystemRoles = list[SystemRole]
39
+ ListOfSystemRolesT = TypeVar("ListOfSystemRolesT", bound=ListOfSystemRoles)
40
+ OptListOfSystemRoles = ListOfSystemRoles | None
41
+ OptListOfSystemRolesT = TypeVar("OptListOfSystemRolesT", bound=OptListOfSystemRoles)
42
+
43
+
44
+ class SimpleSystemRolesMixin(BaseModel, Generic[OptListOfSystemRolesT]):
45
+ roles: Annotated[OptListOfSystemRolesT, Field(..., description="System Roles")]
46
+
47
+
48
+ class FullSystemRolesMixin(BaseModel, Generic[OptListOfSystemRolesT]):
49
+ system_roles: Annotated[
50
+ OptListOfSystemRolesT, Field(..., description="System Roles")
51
+ ]
52
+
53
+
54
+ SeqOfSystemRoles = Sequence[SystemRole]
55
+ SeqOfSystemRolesT = TypeVar("SeqOfSystemRolesT", bound=SeqOfSystemRoles)
56
+ OptSeqOfSystemRoles = SeqOfSystemRoles | None
57
+ OptSeqOfSystemRolesT = TypeVar("OptSeqOfSystemRolesT", bound=OptSeqOfSystemRoles)
maleo/enums/user.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar
3
- from maleo.types.string import ListOfStrings
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
4
5
 
5
6
 
6
7
  class UserType(StrEnum):
@@ -9,14 +10,38 @@ class UserType(StrEnum):
9
10
  SERVICE = "service"
10
11
 
11
12
  @classmethod
12
- def choices(cls) -> ListOfStrings:
13
+ def choices(cls) -> ListOfStrs:
13
14
  return [e.value for e in cls]
14
15
 
15
16
 
16
17
  UserTypeT = TypeVar("UserTypeT", bound=UserType)
17
- OptionalUserType = Optional[UserType]
18
- OptionalUserTypeT = TypeVar("OptionalUserTypeT", bound=OptionalUserType)
19
- ListOfUserTypes = List[UserType]
20
- OptionalListOfUserTypes = Optional[ListOfUserTypes]
21
- SequenceOfUserTypes = Sequence[UserType]
22
- OptionalSequenceOfUserTypes = Optional[SequenceOfUserTypes]
18
+ OptUserType = UserType | None
19
+ OptUserTypeT = TypeVar("OptUserTypeT", bound=OptUserType)
20
+
21
+
22
+ class SimpleUserTypeMixin(BaseModel, Generic[OptUserTypeT]):
23
+ type: Annotated[OptUserTypeT, Field(..., description="User Type")]
24
+
25
+
26
+ class FullUserTypeMixin(BaseModel, Generic[OptUserTypeT]):
27
+ user_type: Annotated[OptUserTypeT, Field(..., description="User Type")]
28
+
29
+
30
+ ListOfUserTypes = list[UserType]
31
+ ListOfUserTypesT = TypeVar("ListOfUserTypesT", bound=ListOfUserTypes)
32
+ OptListOfUserTypes = ListOfUserTypes | None
33
+ OptListOfUserTypesT = TypeVar("OptListOfUserTypesT", bound=OptListOfUserTypes)
34
+
35
+
36
+ class SimpleUserTypesMixin(BaseModel, Generic[OptListOfUserTypesT]):
37
+ types: Annotated[OptListOfUserTypesT, Field(..., description="User Types")]
38
+
39
+
40
+ class FullUserTypesMixin(BaseModel, Generic[OptListOfUserTypesT]):
41
+ user_types: Annotated[OptListOfUserTypesT, Field(..., description="User Types")]
42
+
43
+
44
+ SeqOfUserTypes = Sequence[UserType]
45
+ SeqOfUserTypesT = TypeVar("SeqOfUserTypesT", bound=SeqOfUserTypes)
46
+ OptSeqOfUserTypes = SeqOfUserTypes | None
47
+ OptSeqOfUserTypesT = TypeVar("OptSeqOfUserTypesT", bound=OptSeqOfUserTypes)
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-enums
3
- Version: 0.0.27
3
+ Version: 0.0.30
4
4
  Summary: Enums package for MaleoSuite
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
7
7
  Requires-Python: >=3.12
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
+ Requires-Dist: annotated-types>=0.7.0
10
11
  Requires-Dist: black>=25.1.0
11
12
  Requires-Dist: cfgv>=3.4.0
12
13
  Requires-Dist: click>=8.2.1
@@ -14,14 +15,18 @@ Requires-Dist: colorama>=0.4.6
14
15
  Requires-Dist: distlib>=0.4.0
15
16
  Requires-Dist: filelock>=3.19.1
16
17
  Requires-Dist: identify>=2.6.13
17
- Requires-Dist: maleo-types>=0.0.7
18
+ Requires-Dist: maleo-types>=0.0.12
18
19
  Requires-Dist: mypy_extensions>=1.1.0
19
20
  Requires-Dist: nodeenv>=1.9.1
20
21
  Requires-Dist: packaging>=25.0
21
22
  Requires-Dist: pathspec>=0.12.1
22
23
  Requires-Dist: platformdirs>=4.4.0
23
24
  Requires-Dist: pre_commit>=4.3.0
25
+ Requires-Dist: pydantic>=2.12.2
26
+ Requires-Dist: pydantic_core>=2.41.4
24
27
  Requires-Dist: PyYAML>=6.0.2
28
+ Requires-Dist: typing-inspection>=0.4.2
29
+ Requires-Dist: typing_extensions>=4.15.0
25
30
  Requires-Dist: virtualenv>=20.34.0
26
31
  Dynamic: license-file
27
32
 
@@ -0,0 +1,18 @@
1
+ maleo/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ maleo/enums/cardinality.py,sha256=c5mexKtxlEAI7vGBsqxYLrOrogvXm1Eh2okI34FRXdU,3400
3
+ maleo/enums/connection.py,sha256=q8-_AFJ9BTzL6QrdwcNwH4FDiBAjWoXg4WAk8MKn3YY,6238
4
+ maleo/enums/environment.py,sha256=mcue5JXB4bJ_t8oJUk2919cVlXd3KH9FARB9vPnHrj8,1355
5
+ maleo/enums/expiration.py,sha256=Tqx3cl4nsStR6o5qNnSGd1_ULgmlJVszmJZq-aZ5okc,1699
6
+ maleo/enums/identity.py,sha256=WR2Sm3FvMxV4lQ8nYre52CuxAeQoh2g7eXG1mI6uGP4,2239
7
+ maleo/enums/medical.py,sha256=ivdt3lOQZCxA4npUekwBnFbCUFGN-_pE_csKWO4yyko,5459
8
+ maleo/enums/order.py,sha256=i0_HY3yAbUQ2HkVz2A46J332N9Bg0wh0oQuNHD6CkMw,1067
9
+ maleo/enums/organization.py,sha256=VxbvVcxwSSzHlo4uZLLTgTHV776M6Zb8bpdjTwJsjhI,6796
10
+ maleo/enums/service.py,sha256=1_blRQaaZKqZBctoV9WRcqGxmkRZ9Kl1isx0a6Y0t6s,11166
11
+ maleo/enums/status.py,sha256=hlfecps-OOvBqLxAj80XFRUmZL4JaEbQIjeJm2LScFA,1839
12
+ maleo/enums/system.py,sha256=IwfG9mlNqw2G2jQp4SuD5g-qENqKUaxdbzEGm423lgw,1829
13
+ maleo/enums/user.py,sha256=mTAExTMlkhdWbVXo_WZHaj_Hmp55ps9luAuyEW-iWFY,1515
14
+ maleo_enums-0.0.30.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
15
+ maleo_enums-0.0.30.dist-info/METADATA,sha256=hk_rsUSLXDbtjmhOBmBOjx_GiCjBnZi0ISXOJyZlb_Q,1534
16
+ maleo_enums-0.0.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ maleo_enums-0.0.30.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
18
+ maleo_enums-0.0.30.dist-info/RECORD,,
@@ -1,18 +0,0 @@
1
- maleo/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- maleo/enums/cardinality.py,sha256=f2MmIWvDhxgGG2toDts8n-nrOIDaclwHi_YEgYRtv_E,2124
3
- maleo/enums/connection.py,sha256=jXww92ACMyvVPn1fGte7tbpj64LuyjzWKCeu835x2o0,4793
4
- maleo/enums/environment.py,sha256=Km1RwRphegMfhb-afF-s12bBymZZY8Iwn-p0ytbXnLA,718
5
- maleo/enums/expiration.py,sha256=YJaokiGGGVBBd8snwenxC-JoLOFRDySfRaZqazb9Ik0,1100
6
- maleo/enums/identity.py,sha256=ERKqOH_9Fpq8SO4RGC642QqVB9a5ni99NFnwOa4pNEs,1182
7
- maleo/enums/medical.py,sha256=pU2jZHZH8zxznlwdW9e3aYHOGXzyE1xrvLu2_8MDvYc,3208
8
- maleo/enums/order.py,sha256=PCc_eKjzqWbA4oFEezwejo8GwAs0vC6LB385c9tRGig,576
9
- maleo/enums/organization.py,sha256=rMnrRCV6-b8IFUrYaStUWeYX-VVytgpyoF7gUJEed8M,2809
10
- maleo/enums/service.py,sha256=hEzI3m8Ytp2BN0zzWlyqZUQ88toDWWl9tnNDAYlwWF4,4570
11
- maleo/enums/status.py,sha256=JB6rG8I5ATZ0h8jTZKQ3fKsGNGum2GYfggvINIsV6ro,927
12
- maleo/enums/system.py,sha256=5SG6Z6lcEFqq03jgjh60FPVB3UdXYP4XcqH5qSG6W3Y,799
13
- maleo/enums/user.py,sha256=hcmylbZxXE6-qdLMXqV-zzrVVNgNy3kFC0v-EsD3vkE,661
14
- maleo_enums-0.0.27.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
15
- maleo_enums-0.0.27.dist-info/METADATA,sha256=g_Bp7yGMndjpmoOJkq7WGBW-MRiAzc-shFqqF34NiQc,1345
16
- maleo_enums-0.0.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- maleo_enums-0.0.27.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
18
- maleo_enums-0.0.27.dist-info/RECORD,,