maleo-enums 0.0.28__tar.gz → 0.0.30__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.
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/PKG-INFO +7 -2
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/maleo_enums.egg-info/PKG-INFO +7 -2
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/maleo_enums.egg-info/requires.txt +6 -1
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/pyproject.toml +7 -2
- maleo_enums-0.0.30/src/cardinality.py +98 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/src/connection.py +71 -40
- maleo_enums-0.0.30/src/environment.py +41 -0
- maleo_enums-0.0.30/src/expiration.py +51 -0
- maleo_enums-0.0.30/src/identity.py +75 -0
- maleo_enums-0.0.30/src/medical.py +166 -0
- maleo_enums-0.0.30/src/order.py +38 -0
- maleo_enums-0.0.30/src/organization.py +216 -0
- maleo_enums-0.0.30/src/service.py +354 -0
- maleo_enums-0.0.30/src/status.py +59 -0
- maleo_enums-0.0.30/src/system.py +57 -0
- maleo_enums-0.0.30/src/user.py +47 -0
- maleo_enums-0.0.28/src/cardinality.py +0 -77
- maleo_enums-0.0.28/src/environment.py +0 -32
- maleo_enums-0.0.28/src/expiration.py +0 -42
- maleo_enums-0.0.28/src/identity.py +0 -56
- maleo_enums-0.0.28/src/medical.py +0 -119
- maleo_enums-0.0.28/src/order.py +0 -27
- maleo_enums-0.0.28/src/organization.py +0 -119
- maleo_enums-0.0.28/src/service.py +0 -213
- maleo_enums-0.0.28/src/status.py +0 -44
- maleo_enums-0.0.28/src/system.py +0 -36
- maleo_enums-0.0.28/src/user.py +0 -30
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/LICENSE +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/README.md +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/maleo_enums.egg-info/SOURCES.txt +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/maleo_enums.egg-info/dependency_links.txt +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/maleo_enums.egg-info/top_level.txt +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/setup.cfg +0 -0
- {maleo_enums-0.0.28 → maleo_enums-0.0.30}/src/__init__.py +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-enums
|
|
3
|
-
Version: 0.0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
7
|
+
version = "0.0.30"
|
|
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.
|
|
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
|
|
3
|
-
from
|
|
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) ->
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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) ->
|
|
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:
|
|
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:
|
|
@@ -62,23 +73,33 @@ class Method(StrEnum):
|
|
|
62
73
|
OPTIONS = "OPTIONS"
|
|
63
74
|
|
|
64
75
|
@classmethod
|
|
65
|
-
def choices(cls) ->
|
|
76
|
+
def choices(cls) -> ListOfStrs:
|
|
66
77
|
return [e.value for e in cls]
|
|
67
78
|
|
|
68
79
|
|
|
69
80
|
MethodT = TypeVar("MethodT", bound=Method)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
OptMethod = Method | None
|
|
82
|
+
OptMethodT = TypeVar("OptMethodT", bound=OptMethod)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class MethodMixin(BaseModel, Generic[OptMethodT]):
|
|
86
|
+
method: Annotated[OptMethodT, Field(..., description="Method")]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
ListOfMethods = list[Method]
|
|
73
90
|
ListOfMethodsT = TypeVar("ListOfMethodsT", bound=ListOfMethods)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
OptListOfMethods = ListOfMethods | None
|
|
92
|
+
OptListOfMethodsT = TypeVar("OptListOfMethodsT", bound=OptListOfMethods)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class MethodsMixin(BaseModel, Generic[OptListOfMethodsT]):
|
|
96
|
+
methods: Annotated[OptListOfMethodsT, Field(..., description="Methods")]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
SeqOfMethods = Sequence[Method]
|
|
100
|
+
SeqOfMethodsT = TypeVar("SeqOfMethodsT", bound=SeqOfMethods)
|
|
101
|
+
OptSeqOfMethods = SeqOfMethods | None
|
|
102
|
+
OptSeqOfMethodsT = TypeVar("OptSeqOfMethodsT", bound=OptSeqOfMethods)
|
|
82
103
|
|
|
83
104
|
|
|
84
105
|
class Header(StrEnum):
|
|
@@ -165,20 +186,30 @@ class Header(StrEnum):
|
|
|
165
186
|
X_NEW_AUTHORIZATION = "x-new-authorization"
|
|
166
187
|
|
|
167
188
|
@classmethod
|
|
168
|
-
def choices(cls) ->
|
|
189
|
+
def choices(cls) -> ListOfStrs:
|
|
169
190
|
return [e.value for e in cls]
|
|
170
191
|
|
|
171
192
|
|
|
172
193
|
HeaderT = TypeVar("HeaderT", bound=Header)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
194
|
+
OptHeader = Header | None
|
|
195
|
+
OptHeaderT = TypeVar("OptHeaderT", bound=OptHeader)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class HeaderMixin(BaseModel, Generic[OptHeaderT]):
|
|
199
|
+
header: Annotated[OptHeaderT, Field(..., description="Header")]
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
ListOfHeaders = list[Header]
|
|
176
203
|
ListOfHeadersT = TypeVar("ListOfHeadersT", bound=ListOfHeaders)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
204
|
+
OptListOfHeaders = ListOfHeaders | None
|
|
205
|
+
OptListOfHeadersT = TypeVar("OptListOfHeadersT", bound=OptListOfHeaders)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class HeadersMixin(BaseModel, Generic[OptListOfHeadersT]):
|
|
209
|
+
headers: Annotated[OptListOfHeadersT, Field(..., description="Headers")]
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
SeqOfHeaders = Sequence[Header]
|
|
213
|
+
SeqOfHeadersT = TypeVar("SeqOfHeadersT", bound=SeqOfHeaders)
|
|
214
|
+
OptSeqOfHeaders = SeqOfHeaders | None
|
|
215
|
+
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)
|