maleo-enums 0.0.28__tar.gz → 0.0.32__tar.gz

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.
Files changed (34) hide show
  1. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/PKG-INFO +7 -2
  2. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/maleo_enums.egg-info/PKG-INFO +7 -2
  3. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/maleo_enums.egg-info/requires.txt +6 -1
  4. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/pyproject.toml +7 -2
  5. maleo_enums-0.0.32/src/cardinality.py +98 -0
  6. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/src/connection.py +96 -40
  7. maleo_enums-0.0.32/src/environment.py +41 -0
  8. maleo_enums-0.0.32/src/expiration.py +51 -0
  9. maleo_enums-0.0.32/src/identity.py +75 -0
  10. maleo_enums-0.0.32/src/medical.py +166 -0
  11. maleo_enums-0.0.32/src/order.py +38 -0
  12. maleo_enums-0.0.32/src/organization.py +216 -0
  13. maleo_enums-0.0.32/src/service.py +354 -0
  14. maleo_enums-0.0.32/src/status.py +59 -0
  15. maleo_enums-0.0.32/src/system.py +57 -0
  16. maleo_enums-0.0.32/src/user.py +47 -0
  17. maleo_enums-0.0.28/src/cardinality.py +0 -77
  18. maleo_enums-0.0.28/src/environment.py +0 -32
  19. maleo_enums-0.0.28/src/expiration.py +0 -42
  20. maleo_enums-0.0.28/src/identity.py +0 -56
  21. maleo_enums-0.0.28/src/medical.py +0 -119
  22. maleo_enums-0.0.28/src/order.py +0 -27
  23. maleo_enums-0.0.28/src/organization.py +0 -119
  24. maleo_enums-0.0.28/src/service.py +0 -213
  25. maleo_enums-0.0.28/src/status.py +0 -44
  26. maleo_enums-0.0.28/src/system.py +0 -36
  27. maleo_enums-0.0.28/src/user.py +0 -30
  28. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/LICENSE +0 -0
  29. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/README.md +0 -0
  30. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/maleo_enums.egg-info/SOURCES.txt +0 -0
  31. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/maleo_enums.egg-info/dependency_links.txt +0 -0
  32. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/maleo_enums.egg-info/top_level.txt +0 -0
  33. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/setup.cfg +0 -0
  34. {maleo_enums-0.0.28 → maleo_enums-0.0.32}/src/__init__.py +0 -0
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-enums
3
- Version: 0.0.28
3
+ Version: 0.0.32
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.8
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
 
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-enums
3
- Version: 0.0.28
3
+ Version: 0.0.32
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.8
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
 
@@ -1,3 +1,4 @@
1
+ annotated-types>=0.7.0
1
2
  black>=25.1.0
2
3
  cfgv>=3.4.0
3
4
  click>=8.2.1
@@ -5,12 +6,16 @@ colorama>=0.4.6
5
6
  distlib>=0.4.0
6
7
  filelock>=3.19.1
7
8
  identify>=2.6.13
8
- maleo-types>=0.0.8
9
+ maleo-types>=0.0.12
9
10
  mypy_extensions>=1.1.0
10
11
  nodeenv>=1.9.1
11
12
  packaging>=25.0
12
13
  pathspec>=0.12.1
13
14
  platformdirs>=4.4.0
14
15
  pre_commit>=4.3.0
16
+ pydantic>=2.12.2
17
+ pydantic_core>=2.41.4
15
18
  PyYAML>=6.0.2
19
+ typing-inspection>=0.4.2
20
+ typing_extensions>=4.15.0
16
21
  virtualenv>=20.34.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo-enums"
7
- version = "0.0.28"
7
+ version = "0.0.32"
8
8
  description = "Enums package for MaleoSuite"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -13,6 +13,7 @@ license = { text = "Proprietary" }
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.12"
15
15
  dependencies = [
16
+ "annotated-types>=0.7.0",
16
17
  "black>=25.1.0",
17
18
  "cfgv>=3.4.0",
18
19
  "click>=8.2.1",
@@ -20,14 +21,18 @@ dependencies = [
20
21
  "distlib>=0.4.0",
21
22
  "filelock>=3.19.1",
22
23
  "identify>=2.6.13",
23
- "maleo-types>=0.0.8",
24
+ "maleo-types>=0.0.12",
24
25
  "mypy_extensions>=1.1.0",
25
26
  "nodeenv>=1.9.1",
26
27
  "packaging>=25.0",
27
28
  "pathspec>=0.12.1",
28
29
  "platformdirs>=4.4.0",
29
30
  "pre_commit>=4.3.0",
31
+ "pydantic>=2.12.2",
32
+ "pydantic_core>=2.41.4",
30
33
  "PyYAML>=6.0.2",
34
+ "typing-inspection>=0.4.2",
35
+ "typing_extensions>=4.15.0",
31
36
  "virtualenv>=20.34.0",
32
37
  ]
33
38
 
@@ -0,0 +1,98 @@
1
+ from enum import StrEnum
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
5
+
6
+
7
+ class Cardinality(StrEnum):
8
+ MULTIPLE = "multiple"
9
+ SINGLE = "single"
10
+
11
+ @classmethod
12
+ def choices(cls) -> ListOfStrs:
13
+ return [e.value for e in cls]
14
+
15
+
16
+ CardinalityT = TypeVar("CardinalityT", bound=Cardinality)
17
+ OptCardinality = Cardinality | None
18
+ OptCardinalityT = TypeVar("OptCardinalityT", bound=OptCardinality)
19
+
20
+
21
+ class CardinalityMixin(BaseModel, Generic[OptCardinalityT]):
22
+ cardinality: Annotated[OptCardinalityT, Field(..., description="Cardinality")]
23
+
24
+
25
+ ListOfCardinalities = list[Cardinality]
26
+ ListOfCardinalitiesT = TypeVar("ListOfCardinalitiesT", bound=ListOfCardinalities)
27
+ OptListOfCardinalities = ListOfCardinalities | None
28
+ OptListOfCardinalitiesT = TypeVar(
29
+ "OptListOfCardinalitiesT", bound=OptListOfCardinalities
30
+ )
31
+
32
+
33
+ class CardinalitiesMixin(BaseModel, Generic[OptListOfCardinalitiesT]):
34
+ cardinalities: Annotated[
35
+ OptListOfCardinalitiesT, Field(..., description="Cardinalities")
36
+ ]
37
+
38
+
39
+ SeqOfCardinalities = Sequence[Cardinality]
40
+ SeqOfCardinalitiesT = TypeVar("SeqOfCardinalitiesT", bound=SeqOfCardinalities)
41
+ OptSeqOfCardinalities = SeqOfCardinalities | None
42
+ OptSeqOfCardinalitiesT = TypeVar("OptSeqOfCardinalitiesT", bound=OptSeqOfCardinalities)
43
+
44
+
45
+ class Relationship(StrEnum):
46
+ # One origin
47
+ ONE_TO_ONE = "one_to_one"
48
+ ONE_TO_OPTIONAL_ONE = "one_to_optional_one"
49
+ ONE_TO_MANY = "one_to_many"
50
+ ONE_TO_OPTIONAL_MANY = "one_to_optional_many"
51
+ # Opt one origin
52
+ OPTIONAL_ONE_TO_ONE = "optional_one_to_one"
53
+ OPTIONAL_ONE_TO_OPTIONAL_ONE = "optional_one_to_optional_one"
54
+ OPTIONAL_ONE_TO_MANY = "optional_one_to_many"
55
+ OPTIONAL_ONE_TO_OPTIONAL_MANY = "optional_one_to_optional_many"
56
+ # Many origin
57
+ MANY_TO_ONE = "many_to_one"
58
+ MANY_TO_OPTIONAL_ONE = "many_to_optional_one"
59
+ MANY_TO_MANY = "many_to_many"
60
+ MANY_TO_OPTIONAL_MANY = "many_to_optional_many"
61
+ # Opt many origin
62
+ OPTIONAL_MANY_TO_ONE = "optional_many_to_one"
63
+ OPTIONAL_MANY_TO_OPTIONAL_ONE = "optional_many_to_optional_one"
64
+ OPTIONAL_MANY_TO_MANY = "optional_many_to_many"
65
+ OPTIONAL_MANY_TO_OPTIONAL_MANY = "optional_many_to_optional_many"
66
+
67
+ @classmethod
68
+ def choices(cls) -> ListOfStrs:
69
+ return [e.value for e in cls]
70
+
71
+
72
+ RelationshipT = TypeVar("RelationshipT", bound=Relationship)
73
+ OptRelationship = Relationship | None
74
+ OptRelationshipT = TypeVar("OptRelationshipT", bound=OptRelationship)
75
+
76
+
77
+ class RelationshipMixin(BaseModel, Generic[OptRelationshipT]):
78
+ relationship: Annotated[OptRelationshipT, Field(..., description="Relationship")]
79
+
80
+
81
+ ListOfRelationships = list[Relationship]
82
+ ListOfRelationshipsT = TypeVar("ListOfRelationshipsT", bound=ListOfRelationships)
83
+ OptListOfRelationships = ListOfRelationships | None
84
+ OptListOfRelationshipsT = TypeVar(
85
+ "OptListOfRelationshipsT", bound=OptListOfRelationships
86
+ )
87
+
88
+
89
+ class RelationshipsMixin(BaseModel, Generic[OptListOfRelationshipsT]):
90
+ relationships: Annotated[
91
+ OptListOfRelationshipsT, Field(..., description="Relationships")
92
+ ]
93
+
94
+
95
+ SeqOfRelationships = Sequence[Relationship]
96
+ SeqOfRelationshipsT = TypeVar("SeqOfRelationshipsT", bound=SeqOfRelationships)
97
+ OptSeqOfRelationships = SeqOfRelationships | None
98
+ OptSeqOfRelationshipsT = TypeVar("OptSeqOfRelationshipsT", bound=OptSeqOfRelationships)
@@ -1,6 +1,7 @@
1
1
  from enum import StrEnum
2
- from typing import List, Optional, Sequence, TypeVar, Union
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 Scheme(StrEnum):
@@ -10,23 +11,33 @@ class Scheme(StrEnum):
10
11
  WSS = "wss"
11
12
 
12
13
  @classmethod
13
- def choices(cls) -> ListOfStrings:
14
+ def choices(cls) -> ListOfStrs:
14
15
  return [e.value for e in cls]
15
16
 
16
17
 
17
18
  SchemeT = TypeVar("SchemeT", bound=Scheme)
18
- OptionalScheme = Optional[Scheme]
19
- OptionalSchemeT = TypeVar("OptionalSchemeT", bound=OptionalScheme)
20
- ListOfSchemes = List[Scheme]
19
+ OptScheme = Scheme | None
20
+ OptSchemeT = TypeVar("OptSchemeT", bound=OptScheme)
21
+
22
+
23
+ class SchemeMixin(BaseModel, Generic[OptSchemeT]):
24
+ scheme: Annotated[OptSchemeT, Field(..., description="Scheme")]
25
+
26
+
27
+ ListOfSchemes = list[Scheme]
21
28
  ListOfSchemesT = TypeVar("ListOfSchemesT", bound=ListOfSchemes)
22
- OptionalListOfSchemes = Optional[ListOfSchemes]
23
- OptionalListOfSchemesT = TypeVar("OptionalListOfSchemesT", bound=OptionalListOfSchemes)
24
- SequenceOfSchemes = Sequence[Scheme]
25
- SequenceOfSchemesT = TypeVar("SequenceOfSchemesT", bound=SequenceOfSchemes)
26
- OptionalSequenceOfSchemes = Optional[SequenceOfSchemes]
27
- OptionalSequenceOfSchemesT = TypeVar(
28
- "OptionalSequenceOfSchemesT", bound=OptionalSequenceOfSchemes
29
- )
29
+ OptListOfSchemes = ListOfSchemes | None
30
+ OptListOfSchemesT = TypeVar("OptListOfSchemesT", bound=OptListOfSchemes)
31
+
32
+
33
+ class SchemesMixin(BaseModel, Generic[OptListOfSchemesT]):
34
+ schemes: Annotated[OptListOfSchemesT, Field(..., description="Schemes")]
35
+
36
+
37
+ SeqOfSchemes = Sequence[Scheme]
38
+ SeqOfSchemesT = TypeVar("SeqOfSchemesT", bound=SeqOfSchemes)
39
+ OptSeqOfSchemes = SeqOfSchemes | None
40
+ OptSeqOfSchemesT = TypeVar("OptSeqOfSchemesT", bound=OptSeqOfSchemes)
30
41
 
31
42
 
32
43
  class Protocol(StrEnum):
@@ -34,11 +45,11 @@ class Protocol(StrEnum):
34
45
  WEBSOCKET = "websocket"
35
46
 
36
47
  @classmethod
37
- def choices(cls) -> ListOfStrings:
48
+ def choices(cls) -> ListOfStrs:
38
49
  return [e.value for e in cls]
39
50
 
40
51
  @classmethod
41
- def from_scheme(cls, scheme: Union[Scheme, str]) -> "Protocol":
52
+ def from_scheme(cls, scheme: Scheme | str) -> "Protocol":
42
53
  # Normalize to Scheme if it's a string
43
54
  if isinstance(scheme, str):
44
55
  try:
@@ -53,6 +64,31 @@ class Protocol(StrEnum):
53
64
  raise ValueError(f"Unknown scheme: {scheme}")
54
65
 
55
66
 
67
+ ProtocolT = TypeVar("ProtocolT", bound=Protocol)
68
+ OptProtocol = Protocol | None
69
+ OptProtocolT = TypeVar("OptProtocolT", bound=OptProtocol)
70
+
71
+
72
+ class ProtocolMixin(BaseModel, Generic[OptProtocolT]):
73
+ method: Annotated[OptProtocolT, Field(..., description="Protocol")]
74
+
75
+
76
+ ListOfProtocols = list[Protocol]
77
+ ListOfProtocolsT = TypeVar("ListOfProtocolsT", bound=ListOfProtocols)
78
+ OptListOfProtocols = ListOfProtocols | None
79
+ OptListOfProtocolsT = TypeVar("OptListOfProtocolsT", bound=OptListOfProtocols)
80
+
81
+
82
+ class ProtocolsMixin(BaseModel, Generic[OptListOfProtocolsT]):
83
+ methods: Annotated[OptListOfProtocolsT, Field(..., description="Protocols")]
84
+
85
+
86
+ SeqOfProtocols = Sequence[Protocol]
87
+ SeqOfProtocolsT = TypeVar("SeqOfProtocolsT", bound=SeqOfProtocols)
88
+ OptSeqOfProtocols = SeqOfProtocols | None
89
+ OptSeqOfProtocolsT = TypeVar("OptSeqOfProtocolsT", bound=OptSeqOfProtocols)
90
+
91
+
56
92
  class Method(StrEnum):
57
93
  GET = "GET"
58
94
  POST = "POST"
@@ -62,23 +98,33 @@ class Method(StrEnum):
62
98
  OPTIONS = "OPTIONS"
63
99
 
64
100
  @classmethod
65
- def choices(cls) -> ListOfStrings:
101
+ def choices(cls) -> ListOfStrs:
66
102
  return [e.value for e in cls]
67
103
 
68
104
 
69
105
  MethodT = TypeVar("MethodT", bound=Method)
70
- OptionalMethod = Optional[Method]
71
- OptionalMethodT = TypeVar("OptionalMethodT", bound=OptionalMethod)
72
- ListOfMethods = List[Method]
106
+ OptMethod = Method | None
107
+ OptMethodT = TypeVar("OptMethodT", bound=OptMethod)
108
+
109
+
110
+ class MethodMixin(BaseModel, Generic[OptMethodT]):
111
+ method: Annotated[OptMethodT, Field(..., description="Method")]
112
+
113
+
114
+ ListOfMethods = list[Method]
73
115
  ListOfMethodsT = TypeVar("ListOfMethodsT", bound=ListOfMethods)
74
- OptionalListOfMethods = Optional[ListOfMethods]
75
- OptionalListOfMethodsT = TypeVar("OptionalListOfMethodsT", bound=OptionalListOfMethods)
76
- SequenceOfMethods = Sequence[Method]
77
- SequenceOfMethodsT = TypeVar("SequenceOfMethodsT", bound=SequenceOfMethods)
78
- OptionalSequenceOfMethods = Optional[SequenceOfMethods]
79
- OptionalSequenceOfMethodsT = TypeVar(
80
- "OptionalSequenceOfMethodsT", bound=OptionalSequenceOfMethods
81
- )
116
+ OptListOfMethods = ListOfMethods | None
117
+ OptListOfMethodsT = TypeVar("OptListOfMethodsT", bound=OptListOfMethods)
118
+
119
+
120
+ class MethodsMixin(BaseModel, Generic[OptListOfMethodsT]):
121
+ methods: Annotated[OptListOfMethodsT, Field(..., description="Methods")]
122
+
123
+
124
+ SeqOfMethods = Sequence[Method]
125
+ SeqOfMethodsT = TypeVar("SeqOfMethodsT", bound=SeqOfMethods)
126
+ OptSeqOfMethods = SeqOfMethods | None
127
+ OptSeqOfMethodsT = TypeVar("OptSeqOfMethodsT", bound=OptSeqOfMethods)
82
128
 
83
129
 
84
130
  class Header(StrEnum):
@@ -165,20 +211,30 @@ class Header(StrEnum):
165
211
  X_NEW_AUTHORIZATION = "x-new-authorization"
166
212
 
167
213
  @classmethod
168
- def choices(cls) -> ListOfStrings:
214
+ def choices(cls) -> ListOfStrs:
169
215
  return [e.value for e in cls]
170
216
 
171
217
 
172
218
  HeaderT = TypeVar("HeaderT", bound=Header)
173
- OptionalHeader = Optional[Header]
174
- OptionalHeaderT = TypeVar("OptionalHeaderT", bound=OptionalHeader)
175
- ListOfHeaders = List[Header]
219
+ OptHeader = Header | None
220
+ OptHeaderT = TypeVar("OptHeaderT", bound=OptHeader)
221
+
222
+
223
+ class HeaderMixin(BaseModel, Generic[OptHeaderT]):
224
+ header: Annotated[OptHeaderT, Field(..., description="Header")]
225
+
226
+
227
+ ListOfHeaders = list[Header]
176
228
  ListOfHeadersT = TypeVar("ListOfHeadersT", bound=ListOfHeaders)
177
- OptionalListOfHeaders = Optional[ListOfHeaders]
178
- OptionalListOfHeadersT = TypeVar("OptionalListOfHeadersT", bound=OptionalListOfHeaders)
179
- SequenceOfHeaders = Sequence[Header]
180
- SequenceOfHeadersT = TypeVar("SequenceOfHeadersT", bound=SequenceOfHeaders)
181
- OptionalSequenceOfHeaders = Optional[SequenceOfHeaders]
182
- OptionalSequenceOfHeadersT = TypeVar(
183
- "OptionalSequenceOfHeadersT", bound=OptionalSequenceOfHeaders
184
- )
229
+ OptListOfHeaders = ListOfHeaders | None
230
+ OptListOfHeadersT = TypeVar("OptListOfHeadersT", bound=OptListOfHeaders)
231
+
232
+
233
+ class HeadersMixin(BaseModel, Generic[OptListOfHeadersT]):
234
+ headers: Annotated[OptListOfHeadersT, Field(..., description="Headers")]
235
+
236
+
237
+ SeqOfHeaders = Sequence[Header]
238
+ SeqOfHeadersT = TypeVar("SeqOfHeadersT", bound=SeqOfHeaders)
239
+ OptSeqOfHeaders = SeqOfHeaders | None
240
+ OptSeqOfHeadersT = TypeVar("OptSeqOfHeadersT", bound=OptSeqOfHeaders)
@@ -0,0 +1,41 @@
1
+ from enum import StrEnum
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
5
+
6
+
7
+ class Environment(StrEnum):
8
+ LOCAL = "local"
9
+ STAGING = "staging"
10
+ PRODUCTION = "production"
11
+
12
+ @classmethod
13
+ def choices(cls) -> ListOfStrs:
14
+ return [e.value for e in cls]
15
+
16
+
17
+ EnvironmentT = TypeVar("EnvironmentT", bound=Environment)
18
+ OptEnvironment = Environment | None
19
+ OptEnvironmentT = TypeVar("OptEnvironmentT", bound=OptEnvironment)
20
+
21
+
22
+ class EnvironmentMixin(BaseModel, Generic[OptEnvironmentT]):
23
+ environment: Annotated[OptEnvironmentT, Field(..., description="Environment")]
24
+
25
+
26
+ ListOfEnvironments = list[Environment]
27
+ ListOfEnvironmentsT = TypeVar("ListOfEnvironmentsT", bound=ListOfEnvironments)
28
+ OptListOfEnvironments = ListOfEnvironments | None
29
+ OptListOfEnvironmentsT = TypeVar("OptListOfEnvironmentsT", bound=OptListOfEnvironments)
30
+
31
+
32
+ class EnvironmentsMixin(BaseModel, Generic[OptListOfEnvironmentsT]):
33
+ environments: Annotated[
34
+ OptListOfEnvironmentsT, Field(..., description="Environments")
35
+ ]
36
+
37
+
38
+ SeqOfEnvironments = Sequence[Environment]
39
+ SeqOfEnvironmentsT = TypeVar("SeqOfEnvironmentsT", bound=SeqOfEnvironments)
40
+ OptSeqOfEnvironments = SeqOfEnvironments | None
41
+ OptSeqOfEnvironmentsT = TypeVar("OptSeqOfEnvironmentsT", bound=OptSeqOfEnvironments)
@@ -0,0 +1,51 @@
1
+ from enum import IntEnum
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.integer import ListOfInts
5
+
6
+
7
+ class Expiration(IntEnum):
8
+ EXP_15SC = int(15)
9
+ EXP_30SC = int(30)
10
+ EXP_1MN = int(1 * 60)
11
+ EXP_5MN = int(5 * 60)
12
+ EXP_10MN = int(10 * 60)
13
+ EXP_15MN = int(15 * 60)
14
+ EXP_30MN = int(30 * 60)
15
+ EXP_1HR = int(1 * 60 * 60)
16
+ EXP_6HR = int(6 * 60 * 60)
17
+ EXP_12HR = int(12 * 60 * 60)
18
+ EXP_1DY = int(1 * 24 * 60 * 60)
19
+ EXP_3DY = int(3 * 24 * 60 * 60)
20
+ EXP_1WK = int(1 * 7 * 24 * 60 * 60)
21
+ EXP_2WK = int(2 * 7 * 24 * 60 * 60)
22
+ EXP_1MO = int(1 * 30 * 24 * 60 * 60)
23
+
24
+ @classmethod
25
+ def choices(cls) -> ListOfInts:
26
+ return [e.value for e in cls]
27
+
28
+
29
+ ExpirationT = TypeVar("ExpirationT", bound=Expiration)
30
+ OptExpiration = Expiration | None
31
+ OptExpirationT = TypeVar("OptExpirationT", bound=OptExpiration)
32
+
33
+
34
+ class ExpirationMixin(BaseModel, Generic[OptExpirationT]):
35
+ expiration: Annotated[OptExpirationT, Field(..., description="Expiration")]
36
+
37
+
38
+ ListOfExpirations = list[Expiration]
39
+ ListOfExpirationsT = TypeVar("ListOfExpirationsT", bound=ListOfExpirations)
40
+ OptListOfExpirations = ListOfExpirations | None
41
+ OptListOfExpirationsT = TypeVar("OptListOfExpirationsT", bound=OptListOfExpirations)
42
+
43
+
44
+ class ExpirationsMixin(BaseModel, Generic[OptListOfExpirationsT]):
45
+ expirations: Annotated[OptListOfExpirationsT, Field(..., description="Expirations")]
46
+
47
+
48
+ SeqOfExpirations = Sequence[Expiration]
49
+ SeqOfExpirationsT = TypeVar("SeqOfExpirationsT", bound=SeqOfExpirations)
50
+ OptSeqOfExpirations = SeqOfExpirations | None
51
+ OptSeqOfExpirationsT = TypeVar("OptSeqOfExpirationsT", bound=OptSeqOfExpirations)
@@ -0,0 +1,75 @@
1
+ from enum import StrEnum
2
+ from pydantic import BaseModel, Field
3
+ from typing import Annotated, Generic, Sequence, TypeVar
4
+ from maleo.types.string import ListOfStrs
5
+
6
+
7
+ class BloodType(StrEnum):
8
+ A = "a"
9
+ B = "b"
10
+ AB = "ab"
11
+ O = "o" # noqa: E741
12
+
13
+ @classmethod
14
+ def choices(cls) -> ListOfStrs:
15
+ return [e.value for e in cls]
16
+
17
+
18
+ BloodTypeT = TypeVar("BloodTypeT", bound=BloodType)
19
+ OptBloodType = BloodType | None
20
+ OptBloodTypeT = TypeVar("OptBloodTypeT", bound=OptBloodType)
21
+
22
+
23
+ class BloodTypeMixin(BaseModel, Generic[OptBloodTypeT]):
24
+ blood_type: Annotated[OptBloodTypeT, Field(..., description="Blood Type")]
25
+
26
+
27
+ ListOfBloodTypes = list[BloodType]
28
+ ListOfBloodTypesT = TypeVar("ListOfBloodTypesT", bound=ListOfBloodTypes)
29
+ OptListOfBloodTypes = ListOfBloodTypes | None
30
+ OptListOfBloodTypesT = TypeVar("OptListOfBloodTypesT", bound=OptListOfBloodTypes)
31
+
32
+
33
+ class BloodTypesMixin(BaseModel, Generic[OptListOfBloodTypesT]):
34
+ blood_types: Annotated[OptListOfBloodTypesT, Field(..., description="Blood Types")]
35
+
36
+
37
+ SeqOfBloodTypes = Sequence[BloodType]
38
+ SeqOfBloodTypesT = TypeVar("SeqOfBloodTypesT", bound=SeqOfBloodTypes)
39
+ OptSeqOfBloodTypes = SeqOfBloodTypes | None
40
+ OptSeqOfBloodTypesT = TypeVar("OptSeqOfBloodTypesT", bound=OptSeqOfBloodTypes)
41
+
42
+
43
+ class Gender(StrEnum):
44
+ UNDISCLOSED = "undisclosed"
45
+ FEMALE = "female"
46
+ MALE = "male"
47
+
48
+ @classmethod
49
+ def choices(cls) -> ListOfStrs:
50
+ return [e.value for e in cls]
51
+
52
+
53
+ GenderT = TypeVar("GenderT", bound=Gender)
54
+ OptGender = Gender | None
55
+ OptGenderT = TypeVar("OptGenderT", bound=OptGender)
56
+
57
+
58
+ class GenderMixin(BaseModel, Generic[OptGenderT]):
59
+ gender: Annotated[OptGenderT, Field(..., description="Gender")]
60
+
61
+
62
+ ListOfGenders = list[Gender]
63
+ ListOfGendersT = TypeVar("ListOfGendersT", bound=ListOfGenders)
64
+ OptListOfGenders = ListOfGenders | None
65
+ OptListOfGendersT = TypeVar("OptListOfGendersT", bound=OptListOfGenders)
66
+
67
+
68
+ class GendersMixin(BaseModel, Generic[OptListOfGendersT]):
69
+ genders: Annotated[OptListOfGendersT, Field(..., description="Genders")]
70
+
71
+
72
+ SeqOfGenders = Sequence[Gender]
73
+ SeqOfGendersT = TypeVar("SeqOfGendersT", bound=SeqOfGenders)
74
+ OptSeqOfGenders = SeqOfGenders | None
75
+ OptSeqOfGendersT = TypeVar("OptSeqOfGendersT", bound=OptSeqOfGenders)