2023-11-23 16:13:21 +03:00
|
|
|
from enum import Enum
|
|
|
|
from typing import Optional
|
|
|
|
from uuid import UUID
|
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class PromptStatusEnum(str, Enum):
|
|
|
|
private = "private"
|
|
|
|
public = "public"
|
|
|
|
|
|
|
|
|
|
|
|
class Prompt(BaseModel):
|
|
|
|
title: str
|
|
|
|
content: str
|
|
|
|
status: PromptStatusEnum = PromptStatusEnum.private
|
|
|
|
id: UUID
|
|
|
|
|
|
|
|
|
|
|
|
class CreatePromptProperties(BaseModel):
|
|
|
|
"""Properties that can be received on prompt creation"""
|
|
|
|
|
|
|
|
title: str
|
|
|
|
content: str
|
|
|
|
status: PromptStatusEnum = PromptStatusEnum.private
|
|
|
|
|
|
|
|
|
|
|
|
class PromptUpdatableProperties(BaseModel):
|
|
|
|
"""Properties that can be received on prompt update"""
|
|
|
|
|
2024-02-15 01:01:35 +03:00
|
|
|
title: Optional[str] = None
|
|
|
|
content: Optional[str] = None
|
|
|
|
status: Optional[PromptStatusEnum] = None
|
2023-11-23 16:13:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
class DeletePromptResponse(BaseModel):
|
|
|
|
"""Response when deleting a prompt"""
|
|
|
|
|
|
|
|
status: str = "delete"
|
|
|
|
prompt_id: UUID
|