1
0
Fork 0
forked from sr2/cloud-api
cloud-api/src/service/schemas.py
2026-05-27 14:29:09 +01:00

40 lines
843 B
Python

"""
Pydantic models for the service module
Models:
- List: Description
- Models: Description
"""
from pydantic import ConfigDict
from src.schemas import CustomBaseModel
class ServiceIDMixin(CustomBaseModel):
service_id: int
class ServiceResponse(CustomBaseModel):
model_config = ConfigDict(from_attributes=True, extra="ignore")
id: int
name: str
class ServiceWithKeyResponse(ServiceResponse):
api_key: str
class ServiceGetServiceResponse(CustomBaseModel):
services: list[ServiceResponse]
class ServicePostServiceRequest(CustomBaseModel):
name: str
class ServicePostServiceResponse(CustomBaseModel):
service: ServiceWithKeyResponse
class ServicePatchKeyRequest(ServiceIDMixin):
pass
class ServicePatchKeyResponse(CustomBaseModel):
service: ServiceWithKeyResponse
class ServiceDeleteServiceRequest(ServiceIDMixin):
pass