schemas.users#

Module Contents#

Classes#

UserSchema

Pydantic model for validating incoming user registration data.

UserResponse

Pydantic model for serializing user data in responses.

UserUpdate

Pydantic model for validating incoming user update data.

AnotherUsers

Pydantic model for serializing simplified user data in responses.

TokenSchema

Pydantic model for serializing JWT tokens.

API#

class schemas.users.UserSchema(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for validating incoming user registration data.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

full_name: str = 'Field(...)'#
email: pydantic.EmailStr = None#
password: str = 'Field(...)'#
class schemas.users.UserResponse(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for serializing user data in responses.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

id: int = 1#
full_name: str = None#
email: pydantic.EmailStr = None#
avatar: str | None = None#
role: src.entity.models.Role = None#
picture_count: Optional[int] = None#
created_at: datetime.datetime = None#
class Config#
from_attributes = True#
class schemas.users.UserUpdate(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for validating incoming user update data.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

full_name: str = None#
email: pydantic.EmailStr = None#
password: str = None#
class schemas.users.AnotherUsers(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for serializing simplified user data in responses.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

full_name: str = None#
email: pydantic.EmailStr = None#
avatar: str = None#
picture_count: Optional[int] = None#
created_at: datetime.datetime = None#
class schemas.users.TokenSchema(**data: Any)#

Bases: pydantic.BaseModel

Pydantic model for serializing JWT tokens.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

access_token: str = None#
refresh_token: str = None#
token_type: str = 'bearer'#