maleo-identity 0.0.90__py3-none-any.whl → 0.0.92__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.
Potentially problematic release.
This version of maleo-identity might be problematic. Click here for more details.
- maleo/identity/constants/organization.py +15 -8
- maleo/identity/constants/organization_registration_code.py +10 -7
- maleo/identity/constants/user.py +11 -13
- maleo/identity/constants/user_profile.py +9 -12
- maleo/identity/enums/organization.py +4 -4
- maleo/identity/enums/organization_registration_code.py +5 -0
- maleo/identity/enums/user.py +4 -8
- maleo/identity/enums/user_profile.py +4 -10
- maleo/identity/mixins/organization.py +10 -8
- maleo/identity/mixins/organization_registration_code.py +8 -11
- maleo/identity/mixins/user.py +17 -31
- maleo/identity/mixins/user_profile.py +37 -67
- maleo/identity/models.py +313 -0
- maleo/identity/schemas/common.py +257 -0
- maleo/identity/schemas/organization.py +162 -0
- maleo/identity/schemas/organization_registration_code.py +162 -0
- maleo/identity/schemas/user.py +181 -0
- maleo/identity/schemas/user_profile.py +212 -0
- maleo/identity/types/{base/organization_registration_code.py → user_profile.py} +2 -1
- maleo_identity-0.0.92.dist-info/METADATA +118 -0
- maleo_identity-0.0.92.dist-info/RECORD +33 -0
- maleo_identity-0.0.92.dist-info/licenses/LICENSE +57 -0
- maleo/identity/client/__init__.py +0 -0
- maleo/identity/client/manager.py +0 -157
- maleo/identity/client/services/__init__.py +0 -0
- maleo/identity/client/services/organization.py +0 -1944
- maleo/identity/client/services/organization_registration_code.py +0 -470
- maleo/identity/client/services/organization_role.py +0 -276
- maleo/identity/client/services/user.py +0 -1559
- maleo/identity/client/services/user_organization.py +0 -276
- maleo/identity/client/services/user_organization_role.py +0 -278
- maleo/identity/client/services/user_profile.py +0 -276
- maleo/identity/client/services/user_system_role.py +0 -276
- maleo/identity/constants/organization_role.py +0 -35
- maleo/identity/constants/user_organization.py +0 -58
- maleo/identity/constants/user_organization_role.py +0 -47
- maleo/identity/constants/user_system_role.py +0 -16
- maleo/identity/db.py +0 -4
- maleo/identity/dtos/__init__.py +0 -0
- maleo/identity/dtos/configuration.py +0 -15
- maleo/identity/dtos/data/__init__.py +0 -0
- maleo/identity/dtos/data/organization_registration_code.py +0 -15
- maleo/identity/dtos/data/user_profile.py +0 -29
- maleo/identity/dtos/settings.py +0 -17
- maleo/identity/enums/general.py +0 -5
- maleo/identity/enums/organization_role.py +0 -7
- maleo/identity/enums/user_organization.py +0 -14
- maleo/identity/enums/user_organization_role.py +0 -15
- maleo/identity/enums/user_system_role.py +0 -5
- maleo/identity/mixins/organization_role.py +0 -15
- maleo/identity/mixins/user_organization.py +0 -6
- maleo/identity/mixins/user_organization_role.py +0 -6
- maleo/identity/mixins/user_system_role.py +0 -6
- maleo/identity/models/__init__.py +0 -0
- maleo/identity/models/organization.py +0 -62
- maleo/identity/models/organization_registration_code.py +0 -33
- maleo/identity/models/organization_role.py +0 -37
- maleo/identity/models/user.py +0 -39
- maleo/identity/models/user_organization.py +0 -48
- maleo/identity/models/user_organization_role.py +0 -61
- maleo/identity/models/user_profile.py +0 -33
- maleo/identity/models/user_system_role.py +0 -26
- maleo/identity/schemas/data/__init__.py +0 -0
- maleo/identity/schemas/data/organization.py +0 -36
- maleo/identity/schemas/data/organization_registration_code.py +0 -27
- maleo/identity/schemas/data/organization_role.py +0 -32
- maleo/identity/schemas/data/user.py +0 -33
- maleo/identity/schemas/data/user_organization.py +0 -23
- maleo/identity/schemas/data/user_organization_role.py +0 -13
- maleo/identity/schemas/data/user_profile.py +0 -59
- maleo/identity/schemas/data/user_system_role.py +0 -25
- maleo/identity/schemas/metadata/__init__.py +0 -0
- maleo/identity/schemas/metadata/user.py +0 -6
- maleo/identity/schemas/parameter/__init__.py +0 -0
- maleo/identity/schemas/parameter/client/__init__.py +0 -0
- maleo/identity/schemas/parameter/client/organization.py +0 -74
- maleo/identity/schemas/parameter/client/organization_registration_code.py +0 -24
- maleo/identity/schemas/parameter/client/organization_role.py +0 -42
- maleo/identity/schemas/parameter/client/user.py +0 -44
- maleo/identity/schemas/parameter/client/user_organization.py +0 -62
- maleo/identity/schemas/parameter/client/user_organization_role.py +0 -49
- maleo/identity/schemas/parameter/client/user_profile.py +0 -28
- maleo/identity/schemas/parameter/client/user_system_role.py +0 -43
- maleo/identity/schemas/parameter/general/__init__.py +0 -0
- maleo/identity/schemas/parameter/general/organization.py +0 -92
- maleo/identity/schemas/parameter/general/organization_registration_code.py +0 -86
- maleo/identity/schemas/parameter/general/organization_role.py +0 -14
- maleo/identity/schemas/parameter/general/user.py +0 -150
- maleo/identity/schemas/parameter/general/user_organization.py +0 -18
- maleo/identity/schemas/parameter/general/user_organization_role.py +0 -15
- maleo/identity/schemas/parameter/general/user_profile.py +0 -119
- maleo/identity/schemas/parameter/general/user_system_role.py +0 -30
- maleo/identity/schemas/parameter/service/__init__.py +0 -0
- maleo/identity/schemas/parameter/service/organization.py +0 -60
- maleo/identity/schemas/parameter/service/organization_registration_code.py +0 -24
- maleo/identity/schemas/parameter/service/organization_role.py +0 -35
- maleo/identity/schemas/parameter/service/user.py +0 -47
- maleo/identity/schemas/parameter/service/user_organization_role.py +0 -36
- maleo/identity/schemas/parameter/service/user_profile.py +0 -28
- maleo/identity/schemas/parameter/service/user_system_role.py +0 -31
- maleo/identity/types/base/__init__.py +0 -0
- maleo_identity-0.0.90.dist-info/METADATA +0 -40
- maleo_identity-0.0.90.dist-info/RECORD +0 -105
- /maleo/identity/types/{base/organization.py → organization.py} +0 -0
- /maleo/identity/types/{base/user.py → organization_registration_code.py} +0 -0
- /maleo/identity/types/{base/user_profile.py → user.py} +0 -0
- {maleo_identity-0.0.90.dist-info → maleo_identity-0.0.92.dist-info}/WHEEL +0 -0
- {maleo_identity-0.0.90.dist-info → maleo_identity-0.0.92.dist-info}/top_level.txt +0 -0
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
from typing import Callable, Dict
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from maleo.
|
|
4
|
-
from
|
|
5
|
-
from
|
|
3
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
4
|
+
from ..enums.organization import IdentifierType
|
|
5
|
+
from ..types.organization import IdentifierValueType
|
|
6
6
|
|
|
7
|
-
IDENTIFIER_TYPE_VALUE_TYPE_MAP: Dict[
|
|
8
|
-
IdentifierType, Callable[..., IdentifierValueType]
|
|
9
|
-
] = {IdentifierType.ID: int, IdentifierType.UUID: UUID, IdentifierType.KEY: str}
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
IDENTIFIER_VALUE_TYPE_MAP: Dict[
|
|
9
|
+
IdentifierType,
|
|
10
|
+
Callable[..., IdentifierValueType],
|
|
11
|
+
] = {
|
|
12
|
+
IdentifierType.ID: int,
|
|
13
|
+
IdentifierType.UUID: UUID,
|
|
14
|
+
IdentifierType.KEY: str,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ORGANIZATION_RESOURCE = Resource(
|
|
12
19
|
identifiers=[
|
|
13
20
|
ResourceIdentifier(
|
|
14
|
-
key="organizations", name="Organizations",
|
|
21
|
+
key="organizations", name="Organizations", slug="organizations"
|
|
15
22
|
)
|
|
16
23
|
],
|
|
17
24
|
details=None,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
from typing import Callable, Dict
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from maleo.
|
|
4
|
-
from
|
|
5
|
-
from
|
|
3
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
4
|
+
from ..enums.organization_registration_code import IdentifierType
|
|
5
|
+
from ..types.organization_registration_code import IdentifierValueType
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
IDENTIFIER_VALUE_TYPE_MAP: Dict[
|
|
9
|
+
IdentifierType,
|
|
10
|
+
Callable[..., IdentifierValueType],
|
|
9
11
|
] = {
|
|
10
12
|
IdentifierType.ID: int,
|
|
11
13
|
IdentifierType.UUID: UUID,
|
|
@@ -13,12 +15,13 @@ IDENTIFIER_TYPE_VALUE_TYPE_MAP: Dict[
|
|
|
13
15
|
IdentifierType.CODE: UUID,
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
|
|
19
|
+
ORGANIZATION_REGISTRATION_CODE_RESOURCE = Resource(
|
|
17
20
|
identifiers=[
|
|
18
21
|
ResourceIdentifier(
|
|
19
22
|
key="organization_registration_codes",
|
|
20
23
|
name="Organization Registration Codes",
|
|
21
|
-
|
|
24
|
+
slug="organization-registration-codes",
|
|
22
25
|
)
|
|
23
26
|
],
|
|
24
27
|
details=None,
|
maleo/identity/constants/user.py
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
from typing import Callable, Dict
|
|
1
|
+
from typing import Callable, Dict
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from maleo.
|
|
4
|
-
from
|
|
5
|
-
from
|
|
3
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
4
|
+
from ..enums.user import IdentifierType
|
|
5
|
+
from ..types.user import IdentifierValueType
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
IDENTIFIER_VALUE_TYPE_MAP: Dict[
|
|
9
|
+
IdentifierType,
|
|
10
|
+
Callable[..., IdentifierValueType],
|
|
9
11
|
] = {
|
|
10
12
|
IdentifierType.ID: int,
|
|
11
13
|
IdentifierType.UUID: UUID,
|
|
12
|
-
IdentifierType.USERNAME: str,
|
|
13
14
|
IdentifierType.EMAIL: str,
|
|
15
|
+
IdentifierType.USERNAME: str,
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
EXPANDABLE_FIELDS_DEPENDENCIES_MAP: Dict[ExpandableField, List[ExpandableField]] = {
|
|
17
|
-
ExpandableField.PROFILE: [ExpandableField.GENDER, ExpandableField.BLOOD_TYPE],
|
|
18
|
-
ExpandableField.SYSTEM_ROLES: [ExpandableField.SYSTEM_ROLE_DETAILS],
|
|
19
|
-
}
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
identifiers=[ResourceIdentifier(key="users", name="Users",
|
|
19
|
+
USER_RESOURCE = Resource(
|
|
20
|
+
identifiers=[ResourceIdentifier(key="users", name="Users", slug="users")],
|
|
23
21
|
details=None,
|
|
24
22
|
)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
from typing import Callable, Dict
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from maleo.
|
|
4
|
-
from
|
|
5
|
-
from
|
|
3
|
+
from maleo.schemas.resource import Resource, ResourceIdentifier
|
|
4
|
+
from ..enums.user_profile import IdentifierType
|
|
5
|
+
from ..types.user_profile import IdentifierValueType
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
IDENTIFIER_VALUE_TYPE_MAP: Dict[
|
|
9
|
+
IdentifierType,
|
|
10
|
+
Callable[..., IdentifierValueType],
|
|
9
11
|
] = {
|
|
10
12
|
IdentifierType.ID: int,
|
|
11
13
|
IdentifierType.UUID: UUID,
|
|
@@ -13,16 +15,11 @@ IDENTIFIER_TYPE_VALUE_TYPE_MAP: Dict[
|
|
|
13
15
|
IdentifierType.ID_CARD: str,
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
MIME_TYPE_EXTENSION_MAP: Dict[ValidImageMimeType, str] = {
|
|
17
|
-
ValidImageMimeType.JPEG: ".jpeg",
|
|
18
|
-
ValidImageMimeType.JPG: ".jpg",
|
|
19
|
-
ValidImageMimeType.PNG: ".png",
|
|
20
|
-
}
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
USER_PROFILE_RESOURCE = Resource(
|
|
23
20
|
identifiers=[
|
|
24
21
|
ResourceIdentifier(
|
|
25
|
-
key="user_profiles", name="User Profiles",
|
|
22
|
+
key="user_profiles", name="User Profiles", slug="user-profiles"
|
|
26
23
|
)
|
|
27
24
|
],
|
|
28
25
|
details=None,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class IdentifierType(StrEnum):
|
|
@@ -6,7 +7,6 @@ class IdentifierType(StrEnum):
|
|
|
6
7
|
UUID = "uuid"
|
|
7
8
|
KEY = "key"
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
REGISTRATION_CODE = "registration_code"
|
|
10
|
+
@classmethod
|
|
11
|
+
def choices(cls) -> ListOfStrs:
|
|
12
|
+
return [e.value for e in cls]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class IdentifierType(StrEnum):
|
|
@@ -6,3 +7,7 @@ class IdentifierType(StrEnum):
|
|
|
6
7
|
UUID = "uuid"
|
|
7
8
|
ORGANIZATION_ID = "organization_id"
|
|
8
9
|
CODE = "code"
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
maleo/identity/enums/user.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class IdentifierType(StrEnum):
|
|
@@ -7,11 +8,6 @@ class IdentifierType(StrEnum):
|
|
|
7
8
|
USERNAME = "username"
|
|
8
9
|
EMAIL = "email"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
SYSTEM_ROLES = "system_roles"
|
|
14
|
-
SYSTEM_ROLE_DETAILS = "system_roles.system_role_details"
|
|
15
|
-
PROFILE = "profile"
|
|
16
|
-
GENDER = "profile.gender"
|
|
17
|
-
BLOOD_TYPE = "profile.blood_type"
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
+
from maleo.types.string import ListOfStrs
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class IdentifierType(StrEnum):
|
|
@@ -7,13 +8,6 @@ class IdentifierType(StrEnum):
|
|
|
7
8
|
USER_ID = "user_id"
|
|
8
9
|
ID_CARD = "id_card"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
JPG = "image/jpg"
|
|
14
|
-
PNG = "image/png"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ExpandableField(StrEnum):
|
|
18
|
-
GENDER = "gender_details"
|
|
19
|
-
BLOOD_TYPE = "blood_type_details"
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from
|
|
3
|
-
from maleo.
|
|
2
|
+
from typing import Annotated, Generic
|
|
3
|
+
from maleo.schemas.mixins.identity import Key as BaseKey, Name as BaseName
|
|
4
|
+
from maleo.types.string import OptStrT
|
|
5
|
+
from maleo.types.uuid import OptUUIDT
|
|
4
6
|
|
|
5
7
|
|
|
6
|
-
class
|
|
7
|
-
|
|
8
|
+
class Key(BaseKey, Generic[OptStrT]):
|
|
9
|
+
key: Annotated[OptStrT, Field(..., description="Key", max_length=255)]
|
|
8
10
|
|
|
9
11
|
|
|
10
|
-
class
|
|
11
|
-
|
|
12
|
+
class Name(BaseName, Generic[OptStrT]):
|
|
13
|
+
name: Annotated[OptStrT, Field(..., description="Name", max_length=255)]
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
+
class Secret(BaseModel, Generic[OptUUIDT]):
|
|
17
|
+
secret: Annotated[OptUUIDT, Field(..., description="Secret")]
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from
|
|
3
|
-
from maleo.
|
|
2
|
+
from typing import Annotated, Generic
|
|
3
|
+
from maleo.types.integer import OptIntT
|
|
4
|
+
from maleo.types.string import OptStrT
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
class Code(BaseModel):
|
|
7
|
-
code:
|
|
7
|
+
class Code(BaseModel, Generic[OptStrT]):
|
|
8
|
+
code: Annotated[OptStrT, Field(..., description="Code", max_length=36)]
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
class MaxUses(BaseModel):
|
|
11
|
-
max_uses:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class OptionalMaxUses(BaseModel):
|
|
15
|
-
max_uses: OptionalInteger = Field(None, ge=1, description="Max code uses")
|
|
11
|
+
class MaxUses(BaseModel, Generic[OptIntT]):
|
|
12
|
+
max_uses: Annotated[OptIntT, Field(..., description="Max Uses", ge=1)]
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
class CurrentUses(BaseModel):
|
|
19
|
-
current_uses: int
|
|
16
|
+
current_uses: Annotated[int, Field(0, description="Current Uses", ge=0)] = 0
|
maleo/identity/mixins/user.py
CHANGED
|
@@ -1,47 +1,33 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from
|
|
3
|
-
from maleo.
|
|
4
|
-
from maleo.soma.types.base import OptionalListOfStrings
|
|
5
|
-
from maleo.identity.enums.user import ExpandableField
|
|
2
|
+
from typing import Annotated, Generic
|
|
3
|
+
from maleo.types.string import OptStrT, OptListOfStrsT
|
|
6
4
|
|
|
7
5
|
|
|
8
|
-
class
|
|
9
|
-
|
|
6
|
+
class Username(BaseModel, Generic[OptStrT]):
|
|
7
|
+
username: Annotated[
|
|
8
|
+
OptStrT, Field(..., description="User's username", max_length=50)
|
|
9
|
+
]
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
|
|
12
|
+
class Usernames(BaseModel, Generic[OptListOfStrsT]):
|
|
13
|
+
usernames: Annotated[OptListOfStrsT, Field(..., description="User's Usernames")]
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
17
|
-
|
|
16
|
+
class Email(BaseModel, Generic[OptStrT]):
|
|
17
|
+
email: Annotated[OptStrT, Field(..., description="User's email", max_length=255)]
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class
|
|
21
|
-
|
|
20
|
+
class Emails(BaseModel, Generic[OptListOfStrsT]):
|
|
21
|
+
emais: Annotated[OptListOfStrsT, Field(..., description="User's Emails")]
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
25
|
-
|
|
24
|
+
class Phone(BaseModel, Generic[OptStrT]):
|
|
25
|
+
phone: Annotated[OptStrT, Field(..., description="User's phone", max_length=15)]
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class OptionalListOfPhones(BaseModel):
|
|
33
|
-
phones: OptionalListOfStrings = Field(None, description="Specific phones")
|
|
28
|
+
class Phones(BaseModel, Generic[OptListOfStrsT]):
|
|
29
|
+
phones: Annotated[OptListOfStrsT, Field(..., description="User's Phones")]
|
|
34
30
|
|
|
35
31
|
|
|
36
32
|
class Password(BaseModel):
|
|
37
|
-
password: str
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class PasswordConfirmation(BaseModel):
|
|
41
|
-
password_confirmation: str = Field(
|
|
42
|
-
..., max_length=255, description="User's password confirmation"
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class RegistrationCode(BaseModel):
|
|
47
|
-
registration_code: UUID = Field(..., description="Registration code")
|
|
33
|
+
password: Annotated[str, Field(..., description="Password", max_length=255)]
|
|
@@ -1,88 +1,58 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import
|
|
3
|
-
from maleo.
|
|
4
|
-
from maleo.
|
|
5
|
-
from maleo.identity.enums.user_profile import ExpandableField
|
|
2
|
+
from typing import Annotated, Generic
|
|
3
|
+
from maleo.types.datetime import OptDateT
|
|
4
|
+
from maleo.types.string import OptStrT
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
class
|
|
9
|
-
|
|
7
|
+
class IdCard(BaseModel, Generic[OptStrT]):
|
|
8
|
+
id_card: Annotated[OptStrT, Field(..., description="User's Id Card", max_length=16)]
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
class
|
|
13
|
-
|
|
11
|
+
class LeadingTitle(BaseModel, Generic[OptStrT]):
|
|
12
|
+
leading_title: Annotated[
|
|
13
|
+
OptStrT, Field(..., description="User's Leading Title", max_length=25)
|
|
14
|
+
]
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
class
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
class FirstName(BaseModel, Generic[OptStrT]):
|
|
18
|
+
first_name: Annotated[
|
|
19
|
+
OptStrT, Field(..., description="User's First Name", max_length=50)
|
|
20
|
+
]
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
class
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
class MiddleName(BaseModel, Generic[OptStrT]):
|
|
24
|
+
middle_name: Annotated[
|
|
25
|
+
OptStrT, Field(..., description="User's Middle Name", max_length=50)
|
|
26
|
+
]
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
class
|
|
29
|
-
|
|
29
|
+
class LastName(BaseModel, Generic[OptStrT]):
|
|
30
|
+
last_name: Annotated[
|
|
31
|
+
OptStrT, Field(..., description="User's Last Name", max_length=50)
|
|
32
|
+
]
|
|
30
33
|
|
|
31
34
|
|
|
32
|
-
class
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
class EndingTitle(BaseModel, Generic[OptStrT]):
|
|
36
|
+
ending_title: Annotated[
|
|
37
|
+
OptStrT, Field(..., description="User's Ending Title", max_length=25)
|
|
38
|
+
]
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
class
|
|
39
|
-
|
|
41
|
+
class FullName(BaseModel, Generic[OptStrT]):
|
|
42
|
+
full_name: Annotated[
|
|
43
|
+
OptStrT, Field(..., description="User's Full Name", max_length=200)
|
|
44
|
+
]
|
|
40
45
|
|
|
41
46
|
|
|
42
|
-
class
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
class BirthPlace(BaseModel, Generic[OptStrT]):
|
|
48
|
+
birth_place: Annotated[
|
|
49
|
+
OptStrT, Field(..., description="User's Birth Place", max_length=50)
|
|
50
|
+
]
|
|
46
51
|
|
|
47
52
|
|
|
48
|
-
class
|
|
49
|
-
|
|
53
|
+
class BirthDate(BaseModel, Generic[OptDateT]):
|
|
54
|
+
birth_date: Annotated[OptDateT, Field(..., description="User's birth date")]
|
|
50
55
|
|
|
51
56
|
|
|
52
|
-
class
|
|
53
|
-
|
|
54
|
-
None, max_length=50, description="User's birth place"
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class BirthDate(BaseModel):
|
|
59
|
-
birth_date: OptionalDate = Field(None, description="User's birth date")
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class AvatarName(BaseModel):
|
|
63
|
-
avatar_name: str = Field(..., description="User's avatar's name")
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
class OptionalAvatarUrl(BaseModel):
|
|
67
|
-
avatar_url: OptionalString = Field(None, description="Avatar's URL")
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
class OptionalAvatar(BaseModel):
|
|
71
|
-
avatar: Optional[bytes] = Field(None, description="Optional Avatar")
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class OptionalAvatarName(BaseModel):
|
|
75
|
-
avatar_name: OptionalString = Field(None, description="Optional avatar's name")
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class OptionalAvatarContentType(BaseModel):
|
|
79
|
-
content_type: OptionalString = Field(
|
|
80
|
-
None, description="Optional avatar's content type"
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class AvatarData(
|
|
85
|
-
OptionalAvatarContentType,
|
|
86
|
-
OptionalAvatar,
|
|
87
|
-
):
|
|
88
|
-
pass
|
|
57
|
+
class AvatarName(BaseModel, Generic[OptStrT]):
|
|
58
|
+
avatar_name: Annotated[OptStrT, Field(..., description="User's Avatar Name")]
|