maleo-enums 0.0.28__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/cardinality.py +55 -34
- maleo/enums/connection.py +71 -40
- maleo/enums/environment.py +27 -18
- maleo/enums/expiration.py +25 -16
- maleo/enums/identity.py +47 -28
- maleo/enums/medical.py +79 -32
- maleo/enums/order.py +25 -14
- maleo/enums/organization.py +144 -47
- maleo/enums/service.py +234 -93
- maleo/enums/status.py +39 -24
- maleo/enums/system.py +38 -17
- maleo/enums/user.py +33 -16
- {maleo_enums-0.0.28.dist-info → maleo_enums-0.0.30.dist-info}/METADATA +7 -2
- maleo_enums-0.0.30.dist-info/RECORD +18 -0
- maleo_enums-0.0.28.dist-info/RECORD +0 -18
- {maleo_enums-0.0.28.dist-info → maleo_enums-0.0.30.dist-info}/WHEEL +0 -0
- {maleo_enums-0.0.28.dist-info → maleo_enums-0.0.30.dist-info}/licenses/LICENSE +0 -0
- {maleo_enums-0.0.28.dist-info → maleo_enums-0.0.30.dist-info}/top_level.txt +0 -0
maleo/enums/service.py
CHANGED
|
@@ -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 ServiceType(StrEnum):
|
|
@@ -8,56 +9,102 @@ class ServiceType(StrEnum):
|
|
|
8
9
|
FRONTEND = "frontend"
|
|
9
10
|
|
|
10
11
|
@classmethod
|
|
11
|
-
def choices(cls) ->
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
12
13
|
return [e.value for e in cls]
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
ServiceTypeT = TypeVar("ServiceTypeT", bound=ServiceType)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
OptServiceType = ServiceType | None
|
|
18
|
+
OptServiceTypeT = TypeVar("OptServiceTypeT", bound=OptServiceType)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SimpleServiceTypeMixin(BaseModel, Generic[OptServiceTypeT]):
|
|
22
|
+
type: Annotated[OptServiceTypeT, Field(..., description="Service Type")]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class FullServiceTypeMixin(BaseModel, Generic[OptServiceTypeT]):
|
|
26
|
+
service_type: Annotated[OptServiceTypeT, Field(..., description="Service Type")]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
ListOfServiceTypes = list[ServiceType]
|
|
19
30
|
ListOfServiceTypesT = TypeVar("ListOfServiceTypesT", bound=ListOfServiceTypes)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"SequenceOfServiceTypesT", bound=SequenceOfServiceTypes
|
|
27
|
-
)
|
|
28
|
-
OptionalSequenceOfServiceTypes = Optional[SequenceOfServiceTypes]
|
|
29
|
-
OptionalSequenceOfServiceTypesT = TypeVar(
|
|
30
|
-
"OptionalSequenceOfServiceTypesT", bound=OptionalSequenceOfServiceTypes
|
|
31
|
-
)
|
|
31
|
+
OptListOfServiceTypes = ListOfServiceTypes | None
|
|
32
|
+
OptListOfServiceTypesT = TypeVar("OptListOfServiceTypesT", bound=OptListOfServiceTypes)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class SimpleServiceTypesMixin(BaseModel, Generic[OptListOfServiceTypesT]):
|
|
36
|
+
types: Annotated[OptListOfServiceTypesT, Field(..., description="Service Types")]
|
|
32
37
|
|
|
33
38
|
|
|
34
|
-
class
|
|
39
|
+
class FullServiceTypesMixin(BaseModel, Generic[OptListOfServiceTypesT]):
|
|
40
|
+
service_types: Annotated[
|
|
41
|
+
OptListOfServiceTypesT, Field(..., description="Service Types")
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
SeqOfServiceTypes = Sequence[ServiceType]
|
|
46
|
+
SeqOfServiceTypesT = TypeVar("SeqOfServiceTypesT", bound=SeqOfServiceTypes)
|
|
47
|
+
OptSeqOfServiceTypes = SeqOfServiceTypes | None
|
|
48
|
+
OptSeqOfServiceTypesT = TypeVar("OptSeqOfServiceTypesT", bound=OptSeqOfServiceTypes)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class ServiceCategory(StrEnum):
|
|
35
52
|
CORE = "core"
|
|
36
53
|
AI = "ai"
|
|
37
54
|
|
|
38
55
|
@classmethod
|
|
39
|
-
def choices(cls) ->
|
|
56
|
+
def choices(cls) -> ListOfStrs:
|
|
40
57
|
return [e.value for e in cls]
|
|
41
58
|
|
|
42
59
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
ServiceCategoryT = TypeVar("ServiceCategoryT", bound=ServiceCategory)
|
|
61
|
+
OptServiceCategory = ServiceCategory | None
|
|
62
|
+
OptServiceCategoryT = TypeVar("OptServiceCategoryT", bound=OptServiceCategory)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class SimpleServiceCategoryMixin(BaseModel, Generic[OptServiceCategoryT]):
|
|
66
|
+
category: Annotated[OptServiceCategoryT, Field(..., description="Service Category")]
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class FullServiceCategoryMixin(BaseModel, Generic[OptServiceCategoryT]):
|
|
70
|
+
service_category: Annotated[
|
|
71
|
+
OptServiceCategoryT, Field(..., description="Service Category")
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
ListOfServiceCategories = list[ServiceCategory]
|
|
76
|
+
ListOfServiceCategoriesT = TypeVar(
|
|
77
|
+
"ListOfServiceCategoriesT", bound=ListOfServiceCategories
|
|
51
78
|
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
OptionalSequenceOfCategoriesT = TypeVar(
|
|
56
|
-
"OptionalSequenceOfCategoriesT", bound=OptionalSequenceOfCategories
|
|
79
|
+
OptListOfServiceCategories = ListOfServiceCategories | None
|
|
80
|
+
OptListOfServiceCategoriesT = TypeVar(
|
|
81
|
+
"OptListOfServiceCategoriesT", bound=OptListOfServiceCategories
|
|
57
82
|
)
|
|
58
83
|
|
|
59
84
|
|
|
60
|
-
class
|
|
85
|
+
class SimpleServiceCategoriesMixin(BaseModel, Generic[OptListOfServiceCategoriesT]):
|
|
86
|
+
categories: Annotated[
|
|
87
|
+
OptListOfServiceCategoriesT, Field(..., description="Service Categories")
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class FullServiceCategoriesMixin(BaseModel, Generic[OptListOfServiceCategoriesT]):
|
|
92
|
+
service_categories: Annotated[
|
|
93
|
+
OptListOfServiceCategoriesT, Field(..., description="Service Categories")
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
SeqOfServiceCategories = Sequence[ServiceCategory]
|
|
98
|
+
SeqOfServiceCategoriesT = TypeVar(
|
|
99
|
+
"SeqOfServiceCategoriesT", bound=SeqOfServiceCategories
|
|
100
|
+
)
|
|
101
|
+
OptSeqOfServiceCategories = SeqOfServiceCategories | None
|
|
102
|
+
OptSeqOfServiceCategoriesT = TypeVar(
|
|
103
|
+
"OptSeqOfServiceCategoriesT", bound=OptSeqOfServiceCategories
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class ShortServiceKey(StrEnum):
|
|
61
108
|
STUDIO = "studio"
|
|
62
109
|
NEXUS = "nexus"
|
|
63
110
|
TELEMETRY = "telemetry"
|
|
@@ -76,28 +123,52 @@ class ShortKey(StrEnum):
|
|
|
76
123
|
MCU = "mcu"
|
|
77
124
|
|
|
78
125
|
@classmethod
|
|
79
|
-
def choices(cls) ->
|
|
126
|
+
def choices(cls) -> ListOfStrs:
|
|
80
127
|
return [e.value for e in cls]
|
|
81
128
|
|
|
82
129
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
130
|
+
ShortServiceKeyT = TypeVar("ShortServiceKeyT", bound=ShortServiceKey)
|
|
131
|
+
OptShortServiceKey = ShortServiceKey | None
|
|
132
|
+
OptShortServiceKeyT = TypeVar("OptShortServiceKeyT", bound=OptShortServiceKey)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class SimpleShortServiceKeyMixin(BaseModel, Generic[OptShortServiceKeyT]):
|
|
136
|
+
key: Annotated[OptShortServiceKeyT, Field(..., description="Service Key")]
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class FullShortServiceKeyMixin(BaseModel, Generic[OptShortServiceKeyT]):
|
|
140
|
+
service_key: Annotated[OptShortServiceKeyT, Field(..., description="Service Key")]
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
ListOfShortServiceKeys = list[ShortServiceKey]
|
|
144
|
+
ListOfShortServiceKeysT = TypeVar(
|
|
145
|
+
"ListOfShortServiceKeysT", bound=ListOfShortServiceKeys
|
|
146
|
+
)
|
|
147
|
+
OptListOfShortServiceKeys = ListOfShortServiceKeys | None
|
|
148
|
+
OptListOfShortServiceKeysT = TypeVar(
|
|
149
|
+
"OptListOfShortServiceKeysT", bound=OptListOfShortServiceKeys
|
|
91
150
|
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class SimpleShortServiceKeysMixin(BaseModel, Generic[OptListOfShortServiceKeysT]):
|
|
154
|
+
keys: Annotated[OptListOfShortServiceKeysT, Field(..., description="Service Keys")]
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class FullShortServiceKeysMixin(BaseModel, Generic[OptListOfShortServiceKeysT]):
|
|
158
|
+
service_keys: Annotated[
|
|
159
|
+
OptListOfShortServiceKeysT, Field(..., description="Service Keys")
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
SeqOfShortServiceKeys = Sequence[ShortServiceKey]
|
|
164
|
+
SeqOfShortServiceKeysT = TypeVar("SeqOfShortServiceKeysT", bound=SeqOfShortServiceKeys)
|
|
165
|
+
OptSeqOfShortServiceKeys = SeqOfShortServiceKeys | None
|
|
166
|
+
OptSeqOfShortServiceKeysT = TypeVar(
|
|
167
|
+
"OptSeqOfShortServiceKeysT", bound=OptSeqOfShortServiceKeys
|
|
97
168
|
)
|
|
98
169
|
|
|
99
170
|
|
|
100
|
-
class
|
|
171
|
+
class ServiceKey(StrEnum):
|
|
101
172
|
STUDIO = "maleo-studio"
|
|
102
173
|
NEXUS = "maleo-nexus"
|
|
103
174
|
TELEMETRY = "maleo-telemetry"
|
|
@@ -116,26 +187,46 @@ class Key(StrEnum):
|
|
|
116
187
|
MCU = "maleo-mcu"
|
|
117
188
|
|
|
118
189
|
@classmethod
|
|
119
|
-
def choices(cls) ->
|
|
190
|
+
def choices(cls) -> ListOfStrs:
|
|
120
191
|
return [e.value for e in cls]
|
|
121
192
|
|
|
122
193
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
194
|
+
ServiceKeyT = TypeVar("ServiceKeyT", bound=ServiceKey)
|
|
195
|
+
OptServiceKey = ServiceKey | None
|
|
196
|
+
OptServiceKeyT = TypeVar("OptServiceKeyT", bound=OptServiceKey)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class SimpleServiceKeyMixin(BaseModel, Generic[OptServiceKeyT]):
|
|
200
|
+
key: Annotated[OptServiceKeyT, Field(..., description="Service Key")]
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class FullServiceKeyMixin(BaseModel, Generic[OptServiceKeyT]):
|
|
204
|
+
service_key: Annotated[OptServiceKeyT, Field(..., description="Service Key")]
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
ListOfServiceKeys = list[ServiceKey]
|
|
208
|
+
ListOfServiceKeysT = TypeVar("ListOfServiceKeysT", bound=ListOfServiceKeys)
|
|
209
|
+
OptListOfServiceKeys = ListOfServiceKeys | None
|
|
210
|
+
OptListOfServiceKeysT = TypeVar("OptListOfServiceKeysT", bound=OptListOfServiceKeys)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class SimpleServiceKeysMixin(BaseModel, Generic[OptListOfServiceKeysT]):
|
|
214
|
+
keys: Annotated[OptListOfServiceKeysT, Field(..., description="Service Keys")]
|
|
215
|
+
|
|
136
216
|
|
|
217
|
+
class FullServiceKeysMixin(BaseModel, Generic[OptListOfServiceKeysT]):
|
|
218
|
+
service_keys: Annotated[
|
|
219
|
+
OptListOfServiceKeysT, Field(..., description="Service Keys")
|
|
220
|
+
]
|
|
137
221
|
|
|
138
|
-
|
|
222
|
+
|
|
223
|
+
SeqOfServiceKeys = Sequence[ServiceKey]
|
|
224
|
+
SeqOfServiceKeysT = TypeVar("SeqOfServiceKeysT", bound=SeqOfServiceKeys)
|
|
225
|
+
OptSeqOfServiceKeys = SeqOfServiceKeys | None
|
|
226
|
+
OptSeqOfServiceKeysT = TypeVar("OptSeqOfServiceKeysT", bound=OptSeqOfServiceKeys)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class ShortServiceName(StrEnum):
|
|
139
230
|
STUDIO = "Studio"
|
|
140
231
|
NEXUS = "Nexus"
|
|
141
232
|
TELEMETRY = "Telemetry"
|
|
@@ -154,28 +245,58 @@ class ShortName(StrEnum):
|
|
|
154
245
|
MCU = "MCU"
|
|
155
246
|
|
|
156
247
|
@classmethod
|
|
157
|
-
def choices(cls) ->
|
|
248
|
+
def choices(cls) -> ListOfStrs:
|
|
158
249
|
return [e.value for e in cls]
|
|
159
250
|
|
|
160
251
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
252
|
+
ShortServiceNameT = TypeVar("ShortServiceNameT", bound=ShortServiceName)
|
|
253
|
+
OptShortServiceName = ShortServiceName | None
|
|
254
|
+
OptShortServiceNameT = TypeVar("OptShortServiceNameT", bound=OptShortServiceName)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class SimpleShortServiceNameMixin(BaseModel, Generic[OptShortServiceNameT]):
|
|
258
|
+
name: Annotated[OptShortServiceNameT, Field(..., description="Service Name")]
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class FullShortServiceNameMixin(BaseModel, Generic[OptShortServiceNameT]):
|
|
262
|
+
service_name: Annotated[
|
|
263
|
+
OptShortServiceNameT, Field(..., description="Service Name")
|
|
264
|
+
]
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
ListOfShortServiceNames = list[ShortServiceName]
|
|
268
|
+
ListOfShortServiceNamesT = TypeVar(
|
|
269
|
+
"ListOfShortServiceNamesT", bound=ListOfShortServiceNames
|
|
169
270
|
)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
OptionalSequenceOfShortNamesT = TypeVar(
|
|
174
|
-
"OptionalSequenceOfShortNamesT", bound=OptionalSequenceOfShortNames
|
|
271
|
+
OptListOfShortServiceNames = ListOfShortServiceNames | None
|
|
272
|
+
OptListOfShortServiceNamesT = TypeVar(
|
|
273
|
+
"OptListOfShortServiceNamesT", bound=OptListOfShortServiceNames
|
|
175
274
|
)
|
|
176
275
|
|
|
177
276
|
|
|
178
|
-
class
|
|
277
|
+
class SimpleShortServiceNamesMixin(BaseModel, Generic[OptListOfShortServiceNamesT]):
|
|
278
|
+
names: Annotated[
|
|
279
|
+
OptListOfShortServiceNamesT, Field(..., description="Service Names")
|
|
280
|
+
]
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class FullShortServiceNamesMixin(BaseModel, Generic[OptListOfShortServiceNamesT]):
|
|
284
|
+
service_names: Annotated[
|
|
285
|
+
OptListOfShortServiceNamesT, Field(..., description="Service Names")
|
|
286
|
+
]
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
SeqOfShortServiceNames = Sequence[ShortServiceName]
|
|
290
|
+
SeqOfShortServiceNamesT = TypeVar(
|
|
291
|
+
"SeqOfShortServiceNamesT", bound=SeqOfShortServiceNames
|
|
292
|
+
)
|
|
293
|
+
OptSeqOfShortServiceNames = SeqOfShortServiceNames | None
|
|
294
|
+
OptSeqOfShortServiceNamesT = TypeVar(
|
|
295
|
+
"OptSeqOfShortServiceNamesT", bound=OptSeqOfShortServiceNames
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
class ServiceName(StrEnum):
|
|
179
300
|
STUDIO = "MaleoStudio"
|
|
180
301
|
NEXUS = "MaleoNexus"
|
|
181
302
|
TELEMETRY = "MaleoTelemetry"
|
|
@@ -194,20 +315,40 @@ class Name(StrEnum):
|
|
|
194
315
|
MCU = "MaleoMCU"
|
|
195
316
|
|
|
196
317
|
@classmethod
|
|
197
|
-
def choices(cls) ->
|
|
318
|
+
def choices(cls) -> ListOfStrs:
|
|
198
319
|
return [e.value for e in cls]
|
|
199
320
|
|
|
200
321
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
322
|
+
ServiceNameT = TypeVar("ServiceNameT", bound=ServiceName)
|
|
323
|
+
OptServiceName = ServiceName | None
|
|
324
|
+
OptServiceNameT = TypeVar("OptServiceNameT", bound=OptServiceName)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
class SimpleServiceNameMixin(BaseModel, Generic[OptServiceNameT]):
|
|
328
|
+
name: Annotated[OptServiceNameT, Field(..., description="Service Name")]
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class FullServiceNameMixin(BaseModel, Generic[OptServiceNameT]):
|
|
332
|
+
service_name: Annotated[OptServiceNameT, Field(..., description="Service Name")]
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
ListOfServiceNames = list[ServiceName]
|
|
336
|
+
ListOfServiceNamesT = TypeVar("ListOfServiceNamesT", bound=ListOfServiceNames)
|
|
337
|
+
OptListOfServiceNames = ListOfServiceNames | None
|
|
338
|
+
OptListOfServiceNamesT = TypeVar("OptListOfServiceNamesT", bound=OptListOfServiceNames)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
class SimpleServiceNamesMixin(BaseModel, Generic[OptListOfServiceNamesT]):
|
|
342
|
+
names: Annotated[OptListOfServiceNamesT, Field(..., description="Service Names")]
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
class FullServiceNamesMixin(BaseModel, Generic[OptListOfServiceNamesT]):
|
|
346
|
+
service_names: Annotated[
|
|
347
|
+
OptListOfServiceNamesT, Field(..., description="Service Names")
|
|
348
|
+
]
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
SeqOfServiceNames = Sequence[ServiceName]
|
|
352
|
+
SeqOfServiceNamesT = TypeVar("SeqOfServiceNamesT", bound=SeqOfServiceNames)
|
|
353
|
+
OptSeqOfServiceNames = SeqOfServiceNames | None
|
|
354
|
+
OptSeqOfServiceNamesT = TypeVar("OptSeqOfServiceNamesT", bound=OptSeqOfServiceNames)
|
maleo/enums/status.py
CHANGED
|
@@ -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 DataStatus(StrEnum):
|
|
@@ -9,36 +10,50 @@ class DataStatus(StrEnum):
|
|
|
9
10
|
ACTIVE = "active"
|
|
10
11
|
|
|
11
12
|
@classmethod
|
|
12
|
-
def choices(cls) ->
|
|
13
|
+
def choices(cls) -> ListOfStrs:
|
|
13
14
|
return [e.value for e in cls]
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
DataStatusT = TypeVar("DataStatusT", bound=DataStatus)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
OptDataStatus = DataStatus | None
|
|
19
|
+
OptDataStatusT = TypeVar("OptDataStatusT", bound=OptDataStatus)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class SimpleDataStatusMixin(BaseModel, Generic[OptDataStatusT]):
|
|
23
|
+
status: Annotated[OptDataStatusT, Field(..., description="Status")]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FullDataStatusMixin(BaseModel, Generic[OptDataStatusT]):
|
|
27
|
+
data_status: Annotated[OptDataStatusT, Field(..., description="Status")]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
ListOfDataStatuses = list[DataStatus]
|
|
20
31
|
ListOfDataStatusesT = TypeVar("ListOfDataStatusesT", bound=ListOfDataStatuses)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
OptListOfDataStatuses = ListOfDataStatuses | None
|
|
33
|
+
OptListOfDataStatusesT = TypeVar("OptListOfDataStatusesT", bound=OptListOfDataStatuses)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class SimpleDataStatusesMixin(BaseModel, Generic[OptListOfDataStatusesT]):
|
|
37
|
+
statuses: Annotated[OptListOfDataStatusesT, Field(..., description="Statuses")]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class FullDataStatusesMixin(BaseModel, Generic[OptListOfDataStatusesT]):
|
|
41
|
+
data_statuses: Annotated[OptListOfDataStatusesT, Field(..., description="Statuses")]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
SeqOfDataStatuses = Sequence[DataStatus]
|
|
45
|
+
SeqOfDataStatusesT = TypeVar("SeqOfDataStatusesT", bound=SeqOfDataStatuses)
|
|
46
|
+
OptSeqOfDataStatuses = SeqOfDataStatuses | None
|
|
47
|
+
OptSeqOfDataStatusesT = TypeVar("OptSeqOfDataStatusesT", bound=OptSeqOfDataStatuses)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
FULL_DATA_STATUSES: ListOfDataStatuses = [
|
|
36
51
|
DataStatus.ACTIVE,
|
|
37
52
|
DataStatus.INACTIVE,
|
|
38
53
|
DataStatus.DELETED,
|
|
39
|
-
|
|
54
|
+
]
|
|
40
55
|
|
|
41
|
-
BASIC_DATA_STATUSES:
|
|
56
|
+
BASIC_DATA_STATUSES: ListOfDataStatuses = [
|
|
42
57
|
DataStatus.ACTIVE,
|
|
43
58
|
DataStatus.INACTIVE,
|
|
44
|
-
|
|
59
|
+
]
|
maleo/enums/system.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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
|
-
class
|
|
7
|
+
class SystemRole(StrEnum):
|
|
7
8
|
ADMINISTRATOR = "administrator"
|
|
8
9
|
ANALYST = "analyst"
|
|
9
10
|
ENGINEER = "engineer"
|
|
@@ -17,20 +18,40 @@ class Role(StrEnum):
|
|
|
17
18
|
USER = "user"
|
|
18
19
|
|
|
19
20
|
@classmethod
|
|
20
|
-
def choices(cls) ->
|
|
21
|
+
def choices(cls) -> ListOfStrs:
|
|
21
22
|
return [e.value for e in cls]
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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 UserType(StrEnum):
|
|
@@ -9,22 +10,38 @@ class UserType(StrEnum):
|
|
|
9
10
|
SERVICE = "service"
|
|
10
11
|
|
|
11
12
|
@classmethod
|
|
12
|
-
def choices(cls) ->
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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]
|
|
20
31
|
ListOfUserTypesT = TypeVar("ListOfUserTypesT", bound=ListOfUserTypes)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
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.
|
|
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
|
|