22 lines
608 B
Python
22 lines
608 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
class CharacterBase(BaseModel):
|
|
name: str = Field(..., description="Character's name")
|
|
bounty: int = Field(..., description="Character's bounty")
|
|
|
|
class CharacterCreate(CharacterBase):
|
|
pass
|
|
|
|
class CharacterUpdate(CharacterBase):
|
|
name: Optional[str] = Field(None, description="Character's name")
|
|
bounty: Optional[int] = Field(None, description="Character's bounty")
|
|
|
|
class CharacterSchema(CharacterBase):
|
|
id: UUID
|
|
created_at: int
|
|
updated_at: int
|
|
|
|
class Config:
|
|
orm_mode = True |