responses
DataResponse
¶
Bases: GeneralResponse
Represents a response containing general data, inheriting from the GeneralResponse.
This class is used for defining a response structure that includes the general data model. It enforces the inclusion of the general data field, ensuring proper structure and expected data handling as part of the response. It can be extended or utilized wherever a general data response entity is required.
Attributes:
Name | Type | Description |
---|---|---|
data |
GeneralDataModel
|
The general data model that represents the main content of the response. |
Source code in backend/app/responses.py
ErrorResponse
¶
Bases: GeneralResponse
Represents an error response detailing the result of a failed operation.
This class extends the GeneralResponse and is intended to provide a standard structure for reporting errors or unsuccessful operations in the application. It includes attributes that indicate the success status and any data related to the error response.
Attributes:
Name | Type | Description |
---|---|---|
data |
None
|
Data returned by the request. Default is None. |
success |
bool
|
Indicates whether the request was successful or not. Default is False. |
Source code in backend/app/responses.py
GeneralResponse
¶
Bases: BaseModel
Represents the general response structure for API requests.
This class encapsulates the standard response format, including the data returned, success status, and any errors that occurred during the request. It is utilized as the base model for structuring API responses.
Attributes:
Name | Type | Description |
---|---|---|
data |
None
|
Data returned by the request. |
success |
bool
|
Indicates whether the request was successful or not. |
errors |
list[ErrorModel] | None
|
List of errors encountered during the request. |
Source code in backend/app/responses.py
MessageResponse
¶
Bases: GeneralResponse
Represents a response message inheriting properties from GeneralResponse
.
This class is used to handle message responses with associated data and extends the general response functionality by including a specific 'data' attribute.
Attributes:
Name | Type | Description |
---|---|---|
data |
str
|
The content of the response message. |
Source code in backend/app/responses.py
ResultResponse
¶
Bases: GeneralResponse
Represents a response containing result data, inheriting from GeneralResponse.
This class is used to encapsulate response data specific to result information. It extends the functionality provided by GeneralResponse and includes additional data fields related to results. The purpose of this class is to standardize the structure of result-related responses and ensure consistent access to result data in the response object.
Attributes:
Name | Type | Description |
---|---|---|
data |
ResultDataModel
|
Contains the specific result data encapsulated in the ResultDataModel. |