2026-05-25 09:05:17 +01:00
|
|
|
"""
|
2026-05-26 10:16:59 +01:00
|
|
|
Pydantic models for the service module
|
2026-05-25 09:05:17 +01:00
|
|
|
|
|
|
|
|
Models:
|
|
|
|
|
- List: Description
|
|
|
|
|
- Models: Description
|
2026-05-26 10:16:59 +01:00
|
|
|
"""
|
2026-05-27 12:21:03 +01:00
|
|
|
from pydantic import ConfigDict
|
2026-05-26 10:16:59 +01:00
|
|
|
|
|
|
|
|
from src.schemas import CustomBaseModel
|
|
|
|
|
|
2026-05-27 13:43:06 +01:00
|
|
|
class ServiceIDMixin(CustomBaseModel):
|
|
|
|
|
service_id: int
|
|
|
|
|
|
2026-05-28 14:27:14 +01:00
|
|
|
class ServiceSchema(CustomBaseModel):
|
2026-05-26 10:16:59 +01:00
|
|
|
model_config = ConfigDict(from_attributes=True, extra="ignore")
|
2026-05-27 12:21:03 +01:00
|
|
|
|
2026-05-26 10:16:59 +01:00
|
|
|
id: int
|
|
|
|
|
name: str
|
|
|
|
|
|
2026-05-28 14:27:14 +01:00
|
|
|
class ServiceWithKeySchema(ServiceSchema):
|
2026-05-26 10:16:59 +01:00
|
|
|
api_key: str
|
|
|
|
|
|
|
|
|
|
class ServiceGetServiceResponse(CustomBaseModel):
|
2026-05-28 14:27:14 +01:00
|
|
|
services: list[ServiceSchema]
|
2026-05-26 10:16:59 +01:00
|
|
|
|
|
|
|
|
class ServicePostServiceRequest(CustomBaseModel):
|
|
|
|
|
name: str
|
|
|
|
|
|
|
|
|
|
class ServicePostServiceResponse(CustomBaseModel):
|
2026-05-28 14:27:14 +01:00
|
|
|
service: ServiceWithKeySchema
|
2026-05-26 10:16:59 +01:00
|
|
|
|
2026-05-27 13:43:06 +01:00
|
|
|
class ServicePatchKeyRequest(ServiceIDMixin):
|
|
|
|
|
pass
|
|
|
|
|
|
2026-05-26 10:16:59 +01:00
|
|
|
class ServicePatchKeyResponse(CustomBaseModel):
|
2026-05-28 14:27:14 +01:00
|
|
|
service: ServiceWithKeySchema
|
2026-05-27 13:43:06 +01:00
|
|
|
|
|
|
|
|
class ServiceDeleteServiceRequest(ServiceIDMixin):
|
|
|
|
|
pass
|