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
|
@@ -2,8 +2,8 @@ from pydantic import BaseModel, Field
|
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.schemas.mixins.identity import Identifier
|
|
5
|
-
from maleo.types.string import OptStrT
|
|
6
|
-
from ..enums.user_profile import IdentifierType
|
|
5
|
+
from maleo.types.string import OptStr, OptStrT
|
|
6
|
+
from ..enums.user_profile import IdentifierType, OptListOfExpandableFields
|
|
7
7
|
from ..types.user_profile import IdentifierValueType
|
|
8
8
|
|
|
9
9
|
|
|
@@ -37,6 +37,21 @@ class EndingTitle(BaseModel, Generic[OptStrT]):
|
|
|
37
37
|
]
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
class Avatar(BaseModel):
|
|
41
|
+
content: Annotated[bytes, Field(..., description="Avatar's content")]
|
|
42
|
+
content_type: Annotated[
|
|
43
|
+
OptStr, Field(None, description="Avatar's content type")
|
|
44
|
+
] = None
|
|
45
|
+
filename: Annotated[str, Field(..., description="Avatar's filename")]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
OptAvatar = Avatar | None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class AvatarMixin(BaseModel):
|
|
52
|
+
avatar: Annotated[OptAvatar, Field(None, description="Avatar")]
|
|
53
|
+
|
|
54
|
+
|
|
40
55
|
class AvatarName(BaseModel, Generic[OptStrT]):
|
|
41
56
|
avatar_name: Annotated[OptStrT, Field(..., description="User's Avatar Name")]
|
|
42
57
|
|
|
@@ -45,8 +60,16 @@ class AvatarUrl(BaseModel, Generic[OptStrT]):
|
|
|
45
60
|
avatar_url: Annotated[OptStrT, Field(..., description="User's Avatar URL")]
|
|
46
61
|
|
|
47
62
|
|
|
63
|
+
class Expand(BaseModel):
|
|
64
|
+
expand: Annotated[
|
|
65
|
+
OptListOfExpandableFields, Field(None, description="Expanded field(s)")
|
|
66
|
+
] = None
|
|
67
|
+
|
|
68
|
+
|
|
48
69
|
class UserProfileIdentifier(Identifier[IdentifierType, IdentifierValueType]):
|
|
49
|
-
|
|
70
|
+
@property
|
|
71
|
+
def column_and_value(self) -> tuple[str, IdentifierValueType]:
|
|
72
|
+
return self.type.column, self.value
|
|
50
73
|
|
|
51
74
|
|
|
52
75
|
class IdUserProfileIdentifier(Identifier[Literal[IdentifierType.ID], int]):
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
from pydantic import Field
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Literal, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from maleo.schemas.mixins.identity import Identifier
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from maleo.types.any import ManyAny
|
|
6
|
+
from maleo.types.string import ManyStrs
|
|
7
|
+
from ..enums.user_system_role import IdentifierType, OptListOfExpandableFields
|
|
8
|
+
from ..types.user_system_role import CompositeIdentifierType, IdentifierValueType
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Expand(BaseModel):
|
|
12
|
+
expand: Annotated[
|
|
13
|
+
OptListOfExpandableFields, Field(None, description="Expanded field(s)")
|
|
14
|
+
] = None
|
|
7
15
|
|
|
8
16
|
|
|
9
17
|
class UserSystemRoleIdentifier(Identifier[IdentifierType, IdentifierValueType]):
|
|
10
|
-
|
|
18
|
+
@property
|
|
19
|
+
def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
|
|
20
|
+
values = self.value if isinstance(self.value, tuple) else (self.value,)
|
|
21
|
+
return self.type.columns, values
|
|
11
22
|
|
|
12
23
|
|
|
13
24
|
class IdUserSystemRoleIdentifier(Identifier[Literal[IdentifierType.ID], int]):
|
|
@@ -26,13 +37,15 @@ class UUIDUserSystemRoleIdentifier(Identifier[Literal[IdentifierType.UUID], UUID
|
|
|
26
37
|
|
|
27
38
|
|
|
28
39
|
class CompositeUserSystemRoleIdentifier(
|
|
29
|
-
Identifier[Literal[IdentifierType.COMPOSITE],
|
|
40
|
+
Identifier[Literal[IdentifierType.COMPOSITE], CompositeIdentifierType]
|
|
30
41
|
):
|
|
31
42
|
type: Annotated[
|
|
32
43
|
Literal[IdentifierType.COMPOSITE],
|
|
33
44
|
Field(IdentifierType.COMPOSITE, description="Identifier's type"),
|
|
34
45
|
] = IdentifierType.COMPOSITE
|
|
35
|
-
value: Annotated[
|
|
46
|
+
value: Annotated[
|
|
47
|
+
CompositeIdentifierType, Field(..., description="Identifier's value")
|
|
48
|
+
]
|
|
36
49
|
|
|
37
50
|
|
|
38
51
|
AnyUserSystemRoleIdentifier = (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
from typing import Annotated, Literal, overload
|
|
2
3
|
from uuid import UUID
|
|
3
4
|
from maleo.enums.status import (
|
|
4
5
|
ListOfDataStatuses,
|
|
@@ -24,7 +25,7 @@ from maleo.types.integer import OptInt, OptListOfInts
|
|
|
24
25
|
from maleo.types.uuid import OptListOfUUIDs
|
|
25
26
|
from ..enums.api_key import IdentifierType
|
|
26
27
|
from ..mixins.api_key import APIKeyIdentifier
|
|
27
|
-
from ..types.api_key import
|
|
28
|
+
from ..types.api_key import CompositeIdentifierType, IdentifierValueType
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class CreateParameter(
|
|
@@ -41,6 +42,13 @@ class ReadMultipleParameter(
|
|
|
41
42
|
UUIDs[OptListOfUUIDs],
|
|
42
43
|
Ids[OptListOfInts],
|
|
43
44
|
):
|
|
45
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
46
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
47
|
+
user_ids: Annotated[OptListOfInts, Field(None, description="User's IDs")] = None
|
|
48
|
+
organization_ids: Annotated[
|
|
49
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
50
|
+
] = None
|
|
51
|
+
|
|
44
52
|
@property
|
|
45
53
|
def _query_param_fields(self) -> set[str]:
|
|
46
54
|
return {
|
|
@@ -66,6 +74,15 @@ class ReadMultipleParameter(
|
|
|
66
74
|
|
|
67
75
|
|
|
68
76
|
class ReadSingleParameter(BaseReadSingleParameter[APIKeyIdentifier]):
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_identifier(
|
|
79
|
+
cls,
|
|
80
|
+
identifier: APIKeyIdentifier,
|
|
81
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
82
|
+
use_cache: bool = True,
|
|
83
|
+
) -> "ReadSingleParameter":
|
|
84
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
85
|
+
|
|
69
86
|
@overload
|
|
70
87
|
@classmethod
|
|
71
88
|
def new(
|
|
@@ -89,7 +106,7 @@ class ReadSingleParameter(BaseReadSingleParameter[APIKeyIdentifier]):
|
|
|
89
106
|
def new(
|
|
90
107
|
cls,
|
|
91
108
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
92
|
-
identifier_value:
|
|
109
|
+
identifier_value: CompositeIdentifierType,
|
|
93
110
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
94
111
|
use_cache: bool = True,
|
|
95
112
|
) -> "ReadSingleParameter": ...
|
|
@@ -138,7 +155,7 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[APIKeyIdentifier]):
|
|
|
138
155
|
def new(
|
|
139
156
|
cls,
|
|
140
157
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
141
|
-
identifier_value:
|
|
158
|
+
identifier_value: CompositeIdentifierType,
|
|
142
159
|
) -> "DeleteSingleParameter": ...
|
|
143
160
|
@overload
|
|
144
161
|
@classmethod
|
maleo/identity/schemas/common.py
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
from datetime import date
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from typing import Annotated, Generic, TypeVar, Type
|
|
4
|
-
from maleo.enums.identity import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
from maleo.enums.identity import OptRhesus, RhesusMixin
|
|
5
|
+
from maleo.enums.status import DataStatus as DataStatusEnum, SimpleDataStatusMixin
|
|
6
|
+
from maleo.metadata.schemas.blood_type import (
|
|
7
|
+
OptKeyOrStandardSchema as BloodTypeOptKeyOrStandardSchema,
|
|
8
|
+
FullBloodTypeMixin,
|
|
9
|
+
)
|
|
10
|
+
from maleo.metadata.schemas.gender import (
|
|
11
|
+
OptKeyOrStandardSchema as GenderOptKeyOrStandardSchema,
|
|
12
|
+
KeyOrStandardSchema as GenderKeyOrStandardSchema,
|
|
13
|
+
FullGenderMixin,
|
|
14
|
+
)
|
|
15
|
+
from maleo.metadata.schemas.medical_role import (
|
|
16
|
+
KeyOrStandardSchema as MedicalRoleKeyOrStandardSchema,
|
|
17
|
+
FullMedicalRoleMixin,
|
|
12
18
|
)
|
|
13
|
-
from maleo.
|
|
14
|
-
|
|
15
|
-
OrganizationRole,
|
|
19
|
+
from maleo.metadata.schemas.organization_role import (
|
|
20
|
+
KeyOrStandardSchema as OrganizationRoleKeyOrStandardSchema,
|
|
16
21
|
FullOrganizationRoleMixin,
|
|
17
|
-
|
|
22
|
+
)
|
|
23
|
+
from maleo.metadata.schemas.organization_type import (
|
|
24
|
+
KeyOrStandardSchema as OrganizationTypeKeyOrStandardSchema,
|
|
18
25
|
FullOrganizationTypeMixin,
|
|
19
26
|
)
|
|
20
|
-
from maleo.
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
from maleo.metadata.schemas.system_role import (
|
|
28
|
+
KeyOrStandardSchema as SystemRoleKeyOrStandardSchema,
|
|
29
|
+
FullSystemRoleMixin,
|
|
30
|
+
)
|
|
31
|
+
from maleo.metadata.schemas.user_type import (
|
|
32
|
+
KeyOrStandardSchema as UserTypeKeyOrStandardSchema,
|
|
33
|
+
FullUserTypeMixin,
|
|
34
|
+
)
|
|
23
35
|
from maleo.schemas.mixins.identity import (
|
|
24
36
|
DataIdentifier,
|
|
25
37
|
IntOrganizationId,
|
|
@@ -62,12 +74,14 @@ class APIKeySchema(
|
|
|
62
74
|
|
|
63
75
|
class PatientSchema(
|
|
64
76
|
RhesusMixin[OptRhesus],
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
FullBloodTypeMixin[BloodTypeOptKeyOrStandardSchema],
|
|
78
|
+
FullGenderMixin[GenderKeyOrStandardSchema],
|
|
67
79
|
DateOfBirth[date],
|
|
68
80
|
PlaceOfBirth[OptStr],
|
|
69
81
|
FullName[str],
|
|
70
82
|
PatientIdentity,
|
|
83
|
+
IntOrganizationId[int],
|
|
84
|
+
IntUserId[int],
|
|
71
85
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
72
86
|
LifecycleTimestamp,
|
|
73
87
|
DataIdentifier,
|
|
@@ -99,7 +113,7 @@ class OrganizationRegistrationCodeSchemaMixin(BaseModel):
|
|
|
99
113
|
class StandardOrganizationSchema(
|
|
100
114
|
OrganizationName[str],
|
|
101
115
|
OrganizationKey[str],
|
|
102
|
-
FullOrganizationTypeMixin[
|
|
116
|
+
FullOrganizationTypeMixin[OrganizationTypeKeyOrStandardSchema],
|
|
103
117
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
104
118
|
LifecycleTimestamp,
|
|
105
119
|
DataIdentifier,
|
|
@@ -178,7 +192,7 @@ class OrganizationSchemaMixin(BaseModel, Generic[AnyOrganizationSchemaT]):
|
|
|
178
192
|
|
|
179
193
|
|
|
180
194
|
class UserMedicalRoleSchema(
|
|
181
|
-
FullMedicalRoleMixin[
|
|
195
|
+
FullMedicalRoleMixin[MedicalRoleKeyOrStandardSchema],
|
|
182
196
|
IntOrganizationId[int],
|
|
183
197
|
IntUserId[int],
|
|
184
198
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
@@ -196,7 +210,7 @@ class UserMedicalRolesSchemaMixin(BaseModel):
|
|
|
196
210
|
|
|
197
211
|
|
|
198
212
|
class UserOrganizationRoleSchema(
|
|
199
|
-
FullOrganizationRoleMixin[
|
|
213
|
+
FullOrganizationRoleMixin[OrganizationRoleKeyOrStandardSchema],
|
|
200
214
|
IntOrganizationId[int],
|
|
201
215
|
IntUserId[int],
|
|
202
216
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
@@ -216,8 +230,8 @@ class UserOrganizationRolesSchemaMixin(BaseModel):
|
|
|
216
230
|
class UserProfileSchema(
|
|
217
231
|
AvatarUrl[OptStr],
|
|
218
232
|
AvatarName[str],
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
FullBloodTypeMixin[BloodTypeOptKeyOrStandardSchema],
|
|
234
|
+
FullGenderMixin[GenderOptKeyOrStandardSchema],
|
|
221
235
|
BirthDate[OptDate],
|
|
222
236
|
BirthPlace[OptStr],
|
|
223
237
|
FullName[str],
|
|
@@ -232,7 +246,7 @@ class UserProfileSchema(
|
|
|
232
246
|
LifecycleTimestamp,
|
|
233
247
|
DataIdentifier,
|
|
234
248
|
):
|
|
235
|
-
|
|
249
|
+
avatar_url: Annotated[OptStr, Field(None, description="Avatar URL")]
|
|
236
250
|
|
|
237
251
|
|
|
238
252
|
OptUserProfileSchema = UserProfileSchema | None
|
|
@@ -245,7 +259,7 @@ class UserProfileSchemaMixin(BaseModel):
|
|
|
245
259
|
|
|
246
260
|
|
|
247
261
|
class UserSystemRoleSchema(
|
|
248
|
-
FullSystemRoleMixin[
|
|
262
|
+
FullSystemRoleMixin[SystemRoleKeyOrStandardSchema],
|
|
249
263
|
IntUserId[int],
|
|
250
264
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
251
265
|
LifecycleTimestamp,
|
|
@@ -270,7 +284,7 @@ class StandardUserSchema(
|
|
|
270
284
|
Phone[str],
|
|
271
285
|
Email[str],
|
|
272
286
|
Username[str],
|
|
273
|
-
FullUserTypeMixin[
|
|
287
|
+
FullUserTypeMixin[UserTypeKeyOrStandardSchema],
|
|
274
288
|
SimpleDataStatusMixin[DataStatusEnum],
|
|
275
289
|
LifecycleTimestamp,
|
|
276
290
|
DataIdentifier,
|
|
@@ -57,6 +57,14 @@ class ReadMultipleParameter(
|
|
|
57
57
|
UUIDs[OptListOfUUIDs],
|
|
58
58
|
Ids[OptListOfInts],
|
|
59
59
|
):
|
|
60
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
61
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
62
|
+
organization_types: Annotated[
|
|
63
|
+
OptListOfOrganizationTypes, Field(None, description="Organization Types")
|
|
64
|
+
] = None
|
|
65
|
+
keys: Annotated[OptListOfStrs, Field(None, description="Keys")] = None
|
|
66
|
+
names: Annotated[OptListOfStrs, Field(None, description="Names")] = None
|
|
67
|
+
|
|
60
68
|
@property
|
|
61
69
|
def _query_param_fields(self) -> set[str]:
|
|
62
70
|
return {
|
|
@@ -83,6 +91,15 @@ class ReadMultipleParameter(
|
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_identifier(
|
|
96
|
+
cls,
|
|
97
|
+
identifier: OrganizationIdentifier,
|
|
98
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
99
|
+
use_cache: bool = True,
|
|
100
|
+
) -> "ReadSingleParameter":
|
|
101
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
102
|
+
|
|
86
103
|
@overload
|
|
87
104
|
@classmethod
|
|
88
105
|
def new(
|
|
@@ -110,6 +127,15 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
|
|
|
110
127
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
111
128
|
use_cache: bool = True,
|
|
112
129
|
) -> "ReadSingleParameter": ...
|
|
130
|
+
@overload
|
|
131
|
+
@classmethod
|
|
132
|
+
def new(
|
|
133
|
+
cls,
|
|
134
|
+
identifier_type: IdentifierType,
|
|
135
|
+
identifier_value: IdentifierValueType,
|
|
136
|
+
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
137
|
+
use_cache: bool = True,
|
|
138
|
+
) -> "ReadSingleParameter": ...
|
|
113
139
|
@classmethod
|
|
114
140
|
def new(
|
|
115
141
|
cls,
|
|
@@ -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.status import (
|
|
5
5
|
ListOfDataStatuses,
|
|
@@ -28,6 +28,7 @@ from maleo.types.string import OptStr, OptListOfStrs
|
|
|
28
28
|
from maleo.types.uuid import OptListOfUUIDs
|
|
29
29
|
from ..enums.organization_registration_code import IdentifierType
|
|
30
30
|
from ..mixins.organization_registration_code import (
|
|
31
|
+
CodeOrLength,
|
|
31
32
|
Code,
|
|
32
33
|
MaxUses,
|
|
33
34
|
OrganizationRegistrationCodeIdentifier,
|
|
@@ -35,7 +36,7 @@ from ..mixins.organization_registration_code import (
|
|
|
35
36
|
from ..types.organization_registration_code import IdentifierValueType
|
|
36
37
|
|
|
37
38
|
|
|
38
|
-
class StandardCreateData(
|
|
39
|
+
class StandardCreateData(CodeOrLength):
|
|
39
40
|
pass
|
|
40
41
|
|
|
41
42
|
|
|
@@ -57,6 +58,13 @@ class ReadMultipleParameter(
|
|
|
57
58
|
UUIDs[OptListOfUUIDs],
|
|
58
59
|
Ids[OptListOfInts],
|
|
59
60
|
):
|
|
61
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
62
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
63
|
+
organization_ids: Annotated[
|
|
64
|
+
OptListOfInts, Field(None, description="Organization's IDs")
|
|
65
|
+
] = None
|
|
66
|
+
codes: Annotated[OptListOfStrs, Field(None, description="Codes")] = None
|
|
67
|
+
|
|
60
68
|
@property
|
|
61
69
|
def _query_param_fields(self) -> set[str]:
|
|
62
70
|
return {
|
|
@@ -84,6 +92,15 @@ class ReadMultipleParameter(
|
|
|
84
92
|
class ReadSingleParameter(
|
|
85
93
|
BaseReadSingleParameter[OrganizationRegistrationCodeIdentifier]
|
|
86
94
|
):
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_identifier(
|
|
97
|
+
cls,
|
|
98
|
+
identifier: OrganizationRegistrationCodeIdentifier,
|
|
99
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
100
|
+
use_cache: bool = True,
|
|
101
|
+
) -> "ReadSingleParameter":
|
|
102
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
103
|
+
|
|
87
104
|
@overload
|
|
88
105
|
@classmethod
|
|
89
106
|
def new(
|
|
@@ -39,7 +39,7 @@ from ..mixins.organization_relation import (
|
|
|
39
39
|
Meta,
|
|
40
40
|
OrganizationRelationIdentifier,
|
|
41
41
|
)
|
|
42
|
-
from ..types.organization_relation import
|
|
42
|
+
from ..types.organization_relation import CompositeIdentifierType, IdentifierValueType
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
class CreateParameter(
|
|
@@ -62,6 +62,15 @@ class ReadMultipleParameter(
|
|
|
62
62
|
UUIDs[OptListOfUUIDs],
|
|
63
63
|
Ids[OptListOfInts],
|
|
64
64
|
):
|
|
65
|
+
ids: Annotated[OptListOfInts, Field(None, description="Ids")] = None
|
|
66
|
+
uuids: Annotated[OptListOfUUIDs, Field(None, description="UUIDs")] = None
|
|
67
|
+
source_ids: Annotated[OptListOfInts, Field(None, description="Source's IDs")] = None
|
|
68
|
+
target_ids: Annotated[OptListOfInts, Field(None, description="Target's IDs")] = None
|
|
69
|
+
relations: Annotated[
|
|
70
|
+
OptListOfOrganizationRelations,
|
|
71
|
+
Field(None, description="Organization Relations"),
|
|
72
|
+
] = None
|
|
73
|
+
|
|
65
74
|
@property
|
|
66
75
|
def _query_param_fields(self) -> set[str]:
|
|
67
76
|
return {
|
|
@@ -88,6 +97,15 @@ class ReadMultipleParameter(
|
|
|
88
97
|
|
|
89
98
|
|
|
90
99
|
class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier]):
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_identifier(
|
|
102
|
+
cls,
|
|
103
|
+
identifier: OrganizationRelationIdentifier,
|
|
104
|
+
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
105
|
+
use_cache: bool = True,
|
|
106
|
+
) -> "ReadSingleParameter":
|
|
107
|
+
return cls(identifier=identifier, statuses=statuses, use_cache=use_cache)
|
|
108
|
+
|
|
91
109
|
@overload
|
|
92
110
|
@classmethod
|
|
93
111
|
def new(
|
|
@@ -111,7 +129,7 @@ class ReadSingleParameter(BaseReadSingleParameter[OrganizationRelationIdentifier
|
|
|
111
129
|
def new(
|
|
112
130
|
cls,
|
|
113
131
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
114
|
-
identifier_value:
|
|
132
|
+
identifier_value: CompositeIdentifierType,
|
|
115
133
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
116
134
|
use_cache: bool = True,
|
|
117
135
|
) -> "ReadSingleParameter": ...
|
|
@@ -187,7 +205,7 @@ class UpdateParameter(
|
|
|
187
205
|
def new(
|
|
188
206
|
cls,
|
|
189
207
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
190
|
-
identifier_value:
|
|
208
|
+
identifier_value: CompositeIdentifierType,
|
|
191
209
|
data: UpdateDataT,
|
|
192
210
|
) -> "UpdateParameter": ...
|
|
193
211
|
@overload
|
|
@@ -237,7 +255,7 @@ class StatusUpdateParameter(
|
|
|
237
255
|
def new(
|
|
238
256
|
cls,
|
|
239
257
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
240
|
-
identifier_value:
|
|
258
|
+
identifier_value: CompositeIdentifierType,
|
|
241
259
|
type: ResourceOperationStatusUpdateType,
|
|
242
260
|
) -> "StatusUpdateParameter": ...
|
|
243
261
|
@overload
|
|
@@ -279,7 +297,7 @@ class DeleteSingleParameter(BaseDeleteSingleParameter[OrganizationRelationIdenti
|
|
|
279
297
|
def new(
|
|
280
298
|
cls,
|
|
281
299
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
282
|
-
identifier_value:
|
|
300
|
+
identifier_value: CompositeIdentifierType,
|
|
283
301
|
) -> "DeleteSingleParameter": ...
|
|
284
302
|
@overload
|
|
285
303
|
@classmethod
|