maleo-identity 0.1.11__py3-none-any.whl → 0.1.27__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/identity/constants/api_key.py +2 -2
- maleo/identity/constants/organization.py +1 -1
- maleo/identity/constants/organization_registration_code.py +2 -2
- maleo/identity/constants/organization_relation.py +2 -2
- maleo/identity/constants/patient.py +1 -1
- maleo/identity/constants/user.py +1 -1
- maleo/identity/constants/user_medical_role.py +2 -2
- maleo/identity/constants/user_organization_role.py +2 -2
- maleo/identity/constants/user_profile.py +1 -1
- maleo/identity/constants/user_system_role.py +6 -2
- maleo/identity/enums/api_key.py +13 -1
- maleo/identity/enums/organization.py +4 -0
- maleo/identity/enums/organization_registration_code.py +4 -0
- maleo/identity/enums/organization_relation.py +11 -1
- maleo/identity/enums/patient.py +18 -2
- maleo/identity/enums/user.py +4 -0
- maleo/identity/enums/user_medical_role.py +11 -1
- maleo/identity/enums/user_organization_role.py +11 -1
- maleo/identity/enums/user_profile.py +18 -0
- maleo/identity/enums/user_system_role.py +24 -1
- maleo/identity/mixins/api_key.py +11 -4
- maleo/identity/mixins/organization.py +3 -1
- maleo/identity/mixins/organization_registration_code.py +40 -4
- maleo/identity/mixins/organization_relation.py +11 -4
- maleo/identity/mixins/patient.py +13 -44
- maleo/identity/mixins/user.py +3 -1
- maleo/identity/mixins/user_medical_role.py +11 -4
- maleo/identity/mixins/user_organization_role.py +11 -4
- maleo/identity/mixins/user_profile.py +26 -3
- maleo/identity/mixins/user_system_role.py +19 -6
- maleo/identity/schemas/api_key.py +21 -4
- maleo/identity/schemas/common.py +39 -25
- maleo/identity/schemas/organization.py +26 -0
- maleo/identity/schemas/organization_registration_code.py +19 -2
- maleo/identity/schemas/organization_relation.py +23 -5
- maleo/identity/schemas/patient.py +56 -31
- maleo/identity/schemas/user.py +23 -0
- maleo/identity/schemas/user_medical_role.py +25 -6
- maleo/identity/schemas/user_organization_role.py +25 -6
- maleo/identity/schemas/user_profile.py +73 -7
- maleo/identity/schemas/user_system_role.py +52 -11
- maleo/identity/types/api_key.py +2 -2
- maleo/identity/types/organization_relation.py +2 -2
- maleo/identity/types/patient.py +1 -1
- maleo/identity/types/user_medical_role.py +2 -2
- maleo/identity/types/user_organization_role.py +2 -2
- maleo/identity/types/user_system_role.py +3 -2
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/METADATA +6 -5
- maleo_identity-0.1.27.dist-info/RECORD +66 -0
- maleo/identity/models.py +0 -337
- maleo_identity-0.1.11.dist-info/RECORD +0 -67
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.11.dist-info → maleo_identity-0.1.27.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import date
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import Generic, Literal, TypeVar, overload
|
|
3
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
4
4
|
from uuid import UUID
|
|
5
5
|
from maleo.enums.identity import (
|
|
6
6
|
OptBloodType,
|
|
@@ -28,6 +28,8 @@ from maleo.schemas.mixins.identity import (
|
|
|
28
28
|
UUIDs,
|
|
29
29
|
FullNames,
|
|
30
30
|
DateOfBirth,
|
|
31
|
+
IntUserId,
|
|
32
|
+
IntUserIds,
|
|
31
33
|
IntOrganizationId,
|
|
32
34
|
IntOrganizationIds,
|
|
33
35
|
)
|
|
@@ -44,9 +46,9 @@ from maleo.types.dict import StrToAnyDict
|
|
|
44
46
|
from maleo.types.integer import OptListOfInts
|
|
45
47
|
from maleo.types.string import OptStr, OptListOfStrs
|
|
46
48
|
from maleo.types.uuid import OptListOfUUIDs
|
|
47
|
-
from ..enums.patient import IdentifierType
|
|
49
|
+
from ..enums.patient import IdentifierType, OptListOfExpandableFields
|
|
48
50
|
from ..mixins.common import IdCard, FullName, PlaceOfBirth
|
|
49
|
-
from ..mixins.patient import PatientIdentity, PatientIdentifier
|
|
51
|
+
from ..mixins.patient import PatientIdentity, PatientIdentifier, Expand
|
|
50
52
|
from ..types.patient import IdentifierValueType
|
|
51
53
|
|
|
52
54
|
|
|
@@ -69,26 +71,42 @@ class FullCreateData(
|
|
|
69
71
|
pass
|
|
70
72
|
|
|
71
73
|
|
|
72
|
-
class CreateParameter(FullCreateData):
|
|
74
|
+
class CreateParameter(Expand, FullCreateData, IntUserId[int]):
|
|
73
75
|
pass
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
class ReadMultipleParameter(
|
|
79
|
+
Expand,
|
|
77
80
|
ReadPaginatedMultipleParameter,
|
|
78
81
|
RhesusesMixin[OptListOfRhesuses],
|
|
79
82
|
BloodTypesMixin[OptListOfBloodTypes],
|
|
80
83
|
GendersMixin[OptListOfGenders],
|
|
81
84
|
FullNames[OptListOfStrs],
|
|
82
85
|
IntOrganizationIds[OptListOfInts],
|
|
86
|
+
IntUserIds[OptListOfInts],
|
|
83
87
|
UUIDs[OptListOfUUIDs],
|
|
84
88
|
Ids[OptListOfInts],
|
|
85
89
|
):
|
|
90
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
91
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
92
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
93
|
+
organization_ids: Annotated[
|
|
94
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
95
|
+
] = None
|
|
96
|
+
full_names: Annotated[OptListOfStrs, Field(None, description="Full Names")] = None
|
|
97
|
+
genders: Annotated[OptListOfGenders, Field(None, description="Genders")] = None
|
|
98
|
+
blood_types: Annotated[
|
|
99
|
+
OptListOfBloodTypes, Field(None, description="Blood Types")
|
|
100
|
+
] = None
|
|
101
|
+
rhesuses: Annotated[OptListOfRhesuses, Field(None, description="Rhesuses")] = None
|
|
102
|
+
|
|
86
103
|
@property
|
|
87
104
|
def _query_param_fields(self) -> set[str]:
|
|
88
105
|
return {
|
|
89
106
|
"ids",
|
|
90
107
|
"uuids",
|
|
91
108
|
"statuses",
|
|
109
|
+
"user_ids",
|
|
92
110
|
"organization_ids",
|
|
93
111
|
"full_names",
|
|
94
112
|
"genders",
|
|
@@ -98,6 +116,7 @@ class ReadMultipleParameter(
|
|
|
98
116
|
"page",
|
|
99
117
|
"limit",
|
|
100
118
|
"use_cache",
|
|
119
|
+
"expand",
|
|
101
120
|
}
|
|
102
121
|
|
|
103
122
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -110,7 +129,19 @@ class ReadMultipleParameter(
|
|
|
110
129
|
return params
|
|
111
130
|
|
|
112
131
|
|
|
113
|
-
class ReadSingleParameter(BaseReadSingleParameter[PatientIdentifier]):
|
|
132
|
+
class ReadSingleParameter(Expand, BaseReadSingleParameter[PatientIdentifier]):
|
|
133
|
+
@classmethod
|
|
134
|
+
def from_identifier(
|
|
135
|
+
cls,
|
|
136
|
+
identifier: PatientIdentifier,
|
|
137
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
138
|
+
use_cache: bool = True,
|
|
139
|
+
expand: OptListOfExpandableFields = None,
|
|
140
|
+
) -> "ReadSingleParameter":
|
|
141
|
+
return cls(
|
|
142
|
+
identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
|
|
143
|
+
)
|
|
144
|
+
|
|
114
145
|
@overload
|
|
115
146
|
@classmethod
|
|
116
147
|
def new(
|
|
@@ -119,6 +150,7 @@ class ReadSingleParameter(BaseReadSingleParameter[PatientIdentifier]):
|
|
|
119
150
|
identifier_value: int,
|
|
120
151
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
121
152
|
use_cache: bool = True,
|
|
153
|
+
expand: OptListOfExpandableFields = None,
|
|
122
154
|
) -> "ReadSingleParameter": ...
|
|
123
155
|
@overload
|
|
124
156
|
@classmethod
|
|
@@ -128,15 +160,17 @@ class ReadSingleParameter(BaseReadSingleParameter[PatientIdentifier]):
|
|
|
128
160
|
identifier_value: UUID,
|
|
129
161
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
130
162
|
use_cache: bool = True,
|
|
163
|
+
expand: OptListOfExpandableFields = None,
|
|
131
164
|
) -> "ReadSingleParameter": ...
|
|
132
165
|
@overload
|
|
133
166
|
@classmethod
|
|
134
167
|
def new(
|
|
135
168
|
cls,
|
|
136
|
-
identifier_type:
|
|
137
|
-
identifier_value:
|
|
169
|
+
identifier_type: IdentifierType,
|
|
170
|
+
identifier_value: IdentifierValueType,
|
|
138
171
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
139
172
|
use_cache: bool = True,
|
|
173
|
+
expand: OptListOfExpandableFields = None,
|
|
140
174
|
) -> "ReadSingleParameter": ...
|
|
141
175
|
@classmethod
|
|
142
176
|
def new(
|
|
@@ -145,6 +179,7 @@ class ReadSingleParameter(BaseReadSingleParameter[PatientIdentifier]):
|
|
|
145
179
|
identifier_value: IdentifierValueType,
|
|
146
180
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
147
181
|
use_cache: bool = True,
|
|
182
|
+
expand: OptListOfExpandableFields = None,
|
|
148
183
|
) -> "ReadSingleParameter":
|
|
149
184
|
return cls(
|
|
150
185
|
identifier=PatientIdentifier(
|
|
@@ -153,11 +188,12 @@ class ReadSingleParameter(BaseReadSingleParameter[PatientIdentifier]):
|
|
|
153
188
|
),
|
|
154
189
|
statuses=statuses,
|
|
155
190
|
use_cache=use_cache,
|
|
191
|
+
expand=expand,
|
|
156
192
|
)
|
|
157
193
|
|
|
158
194
|
def to_query_params(self) -> StrToAnyDict:
|
|
159
195
|
return self.model_dump(
|
|
160
|
-
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
196
|
+
mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
|
|
161
197
|
)
|
|
162
198
|
|
|
163
199
|
|
|
@@ -195,6 +231,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
195
231
|
|
|
196
232
|
|
|
197
233
|
class UpdateParameter(
|
|
234
|
+
Expand,
|
|
198
235
|
UpdateDataMixin[UpdateDataT],
|
|
199
236
|
IdentifierMixin[PatientIdentifier],
|
|
200
237
|
Generic[UpdateDataT],
|
|
@@ -206,6 +243,7 @@ class UpdateParameter(
|
|
|
206
243
|
identifier_type: Literal[IdentifierType.ID],
|
|
207
244
|
identifier_value: int,
|
|
208
245
|
data: UpdateDataT,
|
|
246
|
+
expand: OptListOfExpandableFields = None,
|
|
209
247
|
) -> "UpdateParameter": ...
|
|
210
248
|
@overload
|
|
211
249
|
@classmethod
|
|
@@ -214,14 +252,7 @@ class UpdateParameter(
|
|
|
214
252
|
identifier_type: Literal[IdentifierType.UUID],
|
|
215
253
|
identifier_value: UUID,
|
|
216
254
|
data: UpdateDataT,
|
|
217
|
-
|
|
218
|
-
@overload
|
|
219
|
-
@classmethod
|
|
220
|
-
def new(
|
|
221
|
-
cls,
|
|
222
|
-
identifier_type: Literal[IdentifierType.ID_CARD, IdentifierType.PASSPORT],
|
|
223
|
-
identifier_value: str,
|
|
224
|
-
data: UpdateDataT,
|
|
255
|
+
expand: OptListOfExpandableFields = None,
|
|
225
256
|
) -> "UpdateParameter": ...
|
|
226
257
|
@overload
|
|
227
258
|
@classmethod
|
|
@@ -230,6 +261,7 @@ class UpdateParameter(
|
|
|
230
261
|
identifier_type: IdentifierType,
|
|
231
262
|
identifier_value: IdentifierValueType,
|
|
232
263
|
data: UpdateDataT,
|
|
264
|
+
expand: OptListOfExpandableFields = None,
|
|
233
265
|
) -> "UpdateParameter": ...
|
|
234
266
|
@classmethod
|
|
235
267
|
def new(
|
|
@@ -237,14 +269,17 @@ class UpdateParameter(
|
|
|
237
269
|
identifier_type: IdentifierType,
|
|
238
270
|
identifier_value: IdentifierValueType,
|
|
239
271
|
data: UpdateDataT,
|
|
272
|
+
expand: OptListOfExpandableFields = None,
|
|
240
273
|
) -> "UpdateParameter":
|
|
241
274
|
return cls(
|
|
242
275
|
identifier=PatientIdentifier(type=identifier_type, value=identifier_value),
|
|
243
276
|
data=data,
|
|
277
|
+
expand=expand,
|
|
244
278
|
)
|
|
245
279
|
|
|
246
280
|
|
|
247
281
|
class StatusUpdateParameter(
|
|
282
|
+
Expand,
|
|
248
283
|
BaseStatusUpdateParameter[PatientIdentifier],
|
|
249
284
|
):
|
|
250
285
|
@overload
|
|
@@ -254,6 +289,7 @@ class StatusUpdateParameter(
|
|
|
254
289
|
identifier_type: Literal[IdentifierType.ID],
|
|
255
290
|
identifier_value: int,
|
|
256
291
|
type: ResourceOperationStatusUpdateType,
|
|
292
|
+
expand: OptListOfExpandableFields = None,
|
|
257
293
|
) -> "StatusUpdateParameter": ...
|
|
258
294
|
@overload
|
|
259
295
|
@classmethod
|
|
@@ -262,14 +298,7 @@ class StatusUpdateParameter(
|
|
|
262
298
|
identifier_type: Literal[IdentifierType.UUID],
|
|
263
299
|
identifier_value: UUID,
|
|
264
300
|
type: ResourceOperationStatusUpdateType,
|
|
265
|
-
|
|
266
|
-
@overload
|
|
267
|
-
@classmethod
|
|
268
|
-
def new(
|
|
269
|
-
cls,
|
|
270
|
-
identifier_type: Literal[IdentifierType.ID_CARD, IdentifierType.PASSPORT],
|
|
271
|
-
identifier_value: str,
|
|
272
|
-
type: ResourceOperationStatusUpdateType,
|
|
301
|
+
expand: OptListOfExpandableFields = None,
|
|
273
302
|
) -> "StatusUpdateParameter": ...
|
|
274
303
|
@overload
|
|
275
304
|
@classmethod
|
|
@@ -278,6 +307,7 @@ class StatusUpdateParameter(
|
|
|
278
307
|
identifier_type: IdentifierType,
|
|
279
308
|
identifier_value: IdentifierValueType,
|
|
280
309
|
type: ResourceOperationStatusUpdateType,
|
|
310
|
+
expand: OptListOfExpandableFields = None,
|
|
281
311
|
) -> "StatusUpdateParameter": ...
|
|
282
312
|
@classmethod
|
|
283
313
|
def new(
|
|
@@ -285,10 +315,12 @@ class StatusUpdateParameter(
|
|
|
285
315
|
identifier_type: IdentifierType,
|
|
286
316
|
identifier_value: IdentifierValueType,
|
|
287
317
|
type: ResourceOperationStatusUpdateType,
|
|
318
|
+
expand: OptListOfExpandableFields = None,
|
|
288
319
|
) -> "StatusUpdateParameter":
|
|
289
320
|
return cls(
|
|
290
321
|
identifier=PatientIdentifier(type=identifier_type, value=identifier_value),
|
|
291
322
|
type=type,
|
|
323
|
+
expand=expand,
|
|
292
324
|
)
|
|
293
325
|
|
|
294
326
|
|
|
@@ -305,13 +337,6 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[PatientIdentifier]):
|
|
|
305
337
|
) -> "DeleteSingleParameter": ...
|
|
306
338
|
@overload
|
|
307
339
|
@classmethod
|
|
308
|
-
def new(
|
|
309
|
-
cls,
|
|
310
|
-
identifier_type: Literal[IdentifierType.ID_CARD, IdentifierType.PASSPORT],
|
|
311
|
-
identifier_value: str,
|
|
312
|
-
) -> "DeleteSingleParameter": ...
|
|
313
|
-
@overload
|
|
314
|
-
@classmethod
|
|
315
340
|
def new(
|
|
316
341
|
cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
|
|
317
342
|
) -> "DeleteSingleParameter": ...
|
maleo/identity/schemas/user.py
CHANGED
|
@@ -60,6 +60,20 @@ class ReadMultipleParameter(
|
|
|
60
60
|
Ids[OptListOfInts],
|
|
61
61
|
IntOrganizationIds[OptListOfInts],
|
|
62
62
|
):
|
|
63
|
+
organization_ids: Annotated[
|
|
64
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
65
|
+
] = None
|
|
66
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
67
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
68
|
+
user_types: Annotated[OptListOfUserTypes, Field(None, description="User Types")] = (
|
|
69
|
+
None
|
|
70
|
+
)
|
|
71
|
+
usernames: Annotated[OptListOfStrs, Field(None, description="User's Usernames")] = (
|
|
72
|
+
None
|
|
73
|
+
)
|
|
74
|
+
emails: Annotated[OptListOfStrs, Field(None, description="User's Emails")] = None
|
|
75
|
+
phones: Annotated[OptListOfStrs, Field(None, description="User's Phones")] = None
|
|
76
|
+
|
|
63
77
|
@property
|
|
64
78
|
def _query_param_fields(self) -> set[str]:
|
|
65
79
|
return {
|
|
@@ -88,6 +102,15 @@ class ReadMultipleParameter(
|
|
|
88
102
|
|
|
89
103
|
|
|
90
104
|
class ReadSingleParameter(BaseReadSingleParameter[UserIdentifier]):
|
|
105
|
+
@classmethod
|
|
106
|
+
def from_identifier(
|
|
107
|
+
cls,
|
|
108
|
+
identifier: UserIdentifier,
|
|
109
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
110
|
+
use_cache: bool = True,
|
|
111
|
+
) -> "ReadSingleParameter":
|
|
112
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
113
|
+
|
|
91
114
|
@overload
|
|
92
115
|
@classmethod
|
|
93
116
|
def new(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Generic, Literal, TypeVar, overload
|
|
2
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.enums.medical import (
|
|
5
5
|
MedicalRole,
|
|
@@ -35,7 +35,7 @@ from maleo.types.integer import OptInt, OptListOfInts
|
|
|
35
35
|
from maleo.types.uuid import OptListOfUUIDs
|
|
36
36
|
from ..enums.user_medical_role import IdentifierType
|
|
37
37
|
from ..mixins.user_medical_role import UserMedicalRoleIdentifier
|
|
38
|
-
from ..types.user_medical_role import
|
|
38
|
+
from ..types.user_medical_role import CompositeIdentifierType, IdentifierValueType
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class CreateParameter(
|
|
@@ -54,6 +54,16 @@ class ReadMultipleParameter(
|
|
|
54
54
|
UUIDs[OptListOfUUIDs],
|
|
55
55
|
Ids[OptListOfInts],
|
|
56
56
|
):
|
|
57
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
58
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
59
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
60
|
+
organization_ids: Annotated[
|
|
61
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
62
|
+
] = None
|
|
63
|
+
medical_roles: Annotated[
|
|
64
|
+
OptListOfMedicalRoles, Field(None, description="Medical Roles")
|
|
65
|
+
] = None
|
|
66
|
+
|
|
57
67
|
@property
|
|
58
68
|
def _query_param_fields(self) -> set[str]:
|
|
59
69
|
return {
|
|
@@ -80,6 +90,15 @@ class ReadMultipleParameter(
|
|
|
80
90
|
|
|
81
91
|
|
|
82
92
|
class ReadSingleParameter(BaseReadSingleParameter[UserMedicalRoleIdentifier]):
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_identifier(
|
|
95
|
+
cls,
|
|
96
|
+
identifier: UserMedicalRoleIdentifier,
|
|
97
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
98
|
+
use_cache: bool = True,
|
|
99
|
+
) -> "ReadSingleParameter":
|
|
100
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
101
|
+
|
|
83
102
|
@overload
|
|
84
103
|
@classmethod
|
|
85
104
|
def new(
|
|
@@ -103,7 +122,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserMedicalRoleIdentifier]):
|
|
|
103
122
|
def new(
|
|
104
123
|
cls,
|
|
105
124
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
106
|
-
identifier_value:
|
|
125
|
+
identifier_value: CompositeIdentifierType,
|
|
107
126
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
108
127
|
use_cache: bool = True,
|
|
109
128
|
) -> "ReadSingleParameter": ...
|
|
@@ -187,7 +206,7 @@ class UpdateParameter(
|
|
|
187
206
|
def new(
|
|
188
207
|
cls,
|
|
189
208
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
190
|
-
identifier_value:
|
|
209
|
+
identifier_value: CompositeIdentifierType,
|
|
191
210
|
data: UpdateDataT,
|
|
192
211
|
) -> "UpdateParameter": ...
|
|
193
212
|
@overload
|
|
@@ -237,7 +256,7 @@ class StatusUpdateParameter(
|
|
|
237
256
|
def new(
|
|
238
257
|
cls,
|
|
239
258
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
240
|
-
identifier_value:
|
|
259
|
+
identifier_value: CompositeIdentifierType,
|
|
241
260
|
type: ResourceOperationStatusUpdateType,
|
|
242
261
|
) -> "StatusUpdateParameter": ...
|
|
243
262
|
@overload
|
|
@@ -279,7 +298,7 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[UserMedicalRoleIdentifier]
|
|
|
279
298
|
def new(
|
|
280
299
|
cls,
|
|
281
300
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
282
|
-
identifier_value:
|
|
301
|
+
identifier_value: CompositeIdentifierType,
|
|
283
302
|
) -> "DeleteSingleParameter": ...
|
|
284
303
|
@overload
|
|
285
304
|
@classmethod
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Generic, Literal, TypeVar, overload
|
|
2
|
+
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.enums.organization import (
|
|
5
5
|
OrganizationRole,
|
|
@@ -35,7 +35,7 @@ from maleo.types.integer import OptInt, OptListOfInts
|
|
|
35
35
|
from maleo.types.uuid import OptListOfUUIDs
|
|
36
36
|
from ..enums.user_organization_role import IdentifierType
|
|
37
37
|
from ..mixins.user_organization_role import UserOrganizationRoleIdentifier
|
|
38
|
-
from ..types.user_organization_role import
|
|
38
|
+
from ..types.user_organization_role import CompositeIdentifierType, IdentifierValueType
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class CreateParameter(
|
|
@@ -54,6 +54,16 @@ class ReadMultipleParameter(
|
|
|
54
54
|
UUIDs[OptListOfUUIDs],
|
|
55
55
|
Ids[OptListOfInts],
|
|
56
56
|
):
|
|
57
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
58
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
59
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
60
|
+
organization_ids: Annotated[
|
|
61
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
62
|
+
] = None
|
|
63
|
+
organization_roles: Annotated[
|
|
64
|
+
OptListOfOrganizationRoles, Field(None, description="Organization Roles")
|
|
65
|
+
] = None
|
|
66
|
+
|
|
57
67
|
@property
|
|
58
68
|
def _query_param_fields(self) -> set[str]:
|
|
59
69
|
return {
|
|
@@ -80,6 +90,15 @@ class ReadMultipleParameter(
|
|
|
80
90
|
|
|
81
91
|
|
|
82
92
|
class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier]):
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_identifier(
|
|
95
|
+
cls,
|
|
96
|
+
identifier: UserOrganizationRoleIdentifier,
|
|
97
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
98
|
+
use_cache: bool = True,
|
|
99
|
+
) -> "ReadSingleParameter":
|
|
100
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
101
|
+
|
|
83
102
|
@overload
|
|
84
103
|
@classmethod
|
|
85
104
|
def new(
|
|
@@ -103,7 +122,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
103
122
|
def new(
|
|
104
123
|
cls,
|
|
105
124
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
106
|
-
identifier_value:
|
|
125
|
+
identifier_value: CompositeIdentifierType,
|
|
107
126
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
108
127
|
use_cache: bool = True,
|
|
109
128
|
) -> "ReadSingleParameter": ...
|
|
@@ -188,7 +207,7 @@ class UpdateParameter(
|
|
|
188
207
|
def new(
|
|
189
208
|
cls,
|
|
190
209
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
191
|
-
identifier_value:
|
|
210
|
+
identifier_value: CompositeIdentifierType,
|
|
192
211
|
data: UpdateDataT,
|
|
193
212
|
) -> "UpdateParameter": ...
|
|
194
213
|
@overload
|
|
@@ -238,7 +257,7 @@ class StatusUpdateParameter(
|
|
|
238
257
|
def new(
|
|
239
258
|
cls,
|
|
240
259
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
241
|
-
identifier_value:
|
|
260
|
+
identifier_value: CompositeIdentifierType,
|
|
242
261
|
type: ResourceOperationStatusUpdateType,
|
|
243
262
|
) -> "StatusUpdateParameter": ...
|
|
244
263
|
@overload
|
|
@@ -280,7 +299,7 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[UserOrganizationRoleIdenti
|
|
|
280
299
|
def new(
|
|
281
300
|
cls,
|
|
282
301
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
283
|
-
identifier_value:
|
|
302
|
+
identifier_value: CompositeIdentifierType,
|
|
284
303
|
) -> "DeleteSingleParameter": ...
|
|
285
304
|
@overload
|
|
286
305
|
@classmethod
|