Skip to content

DTO

DTO (atlas.dto) is the package containing all foundational components for defining both request and response Data Transfer Objects, used to structure and validate data exchanged between the API consumer and the controller layer, and between the controller layer and the service layer.

Below are the descriptions of each resource.

DTO

Bases: BaseModel

DTO is the base class for all Data Transfer Objects used for data handling at the controller layer. It provides a flexible structure for request and response models, supporting dynamic field assignment while maintaining type safety via Pydantic.

The class is designed to simplify data handling between controller and service layers, allowing additional fields beyond the explicitly defined ones without validation errors.

PageDTO

Bases: BaseModel

DTO is the base class for all Data Transfer Objects used for data handling at the controller layer. It provides a flexible structure for request and response models, supporting dynamic field assignment while maintaining type safety via Pydantic.

The class is designed to simplify data handling between controller and service layers, allowing additional fields beyond the explicitly defined ones without validation errors.

UuidReferenceRequestDTO

Bases: DTO

UuidReferenceRequestDTO is a specialized Data Transfer Object intended to carry a UUID reference for retrieving a specific existing entity from the database. Commonly used as type hint for any request DTO entity referencing field that must have its corresponding entity resolved.

Attributes:

Name Type Description
uuid UuidStr

A string representing the UUID of the target entity. This UUID is intended to be used to resolve the corresponding entity in the database.

Usage

Typically used in service or controller methods where an entity needs to be fetched or manipulated based on its unique identifier.

UuidReferenceResponseDTO

Bases: DTO

UuidReferenceResponseDTO is a specialized Data Transfer Object used to return a UUID reference for an entity in API responses. Commonly used as type hint for any response DTO entity referencing field to hide all its data except for the UUID.

Attributes:

Name Type Description
uuid str

A string representing the UUID of the entity being referenced. This UUID corresponds to the unique identifier of the entity in the database.

Usage

Used in responses from controller layer when an operation involves returning a reference to an entity, such as after creation, update, or retrieval operations, but as not to reveal any other details about given entity.