58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from typing import Literal, Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SkillInstallForm(BaseModel):
|
|
url: str = Field(min_length=1, max_length=2000)
|
|
|
|
|
|
class SkillEnabledForm(BaseModel):
|
|
enabled: Optional[bool] = None
|
|
|
|
|
|
class SkillDeleteForm(BaseModel):
|
|
owner: str = Field(default="", max_length=32)
|
|
|
|
|
|
class MessageForm(BaseModel):
|
|
content: str = Field(min_length=0, max_length=2000)
|
|
receiver_uid: str = Field(min_length=1, max_length=36)
|
|
attachment_uids: list[str] = []
|
|
client_id: Optional[str] = Field(default=None, max_length=64)
|
|
|
|
|
|
class GistForm(BaseModel):
|
|
title: str = Field(min_length=1, max_length=200)
|
|
description: str = Field(default="", max_length=5000)
|
|
source_code: str = Field(min_length=1, max_length=400000)
|
|
language: str = Field(default="plaintext", max_length=50)
|
|
attachment_uids: list[str] = []
|
|
|
|
|
|
class GistEditForm(BaseModel):
|
|
title: str = Field(min_length=1, max_length=200)
|
|
description: str = Field(default="", max_length=5000)
|
|
source_code: str = Field(min_length=1, max_length=400000)
|
|
language: str = Field(default="plaintext", max_length=50)
|
|
|
|
|
|
class IssueForm(BaseModel):
|
|
title: str = Field(min_length=1, max_length=200)
|
|
description: str = Field(min_length=1, max_length=5000)
|
|
attachment_uids: list[str] = []
|
|
|
|
|
|
class IssueCommentForm(BaseModel):
|
|
body: str = Field(min_length=1, max_length=5000)
|
|
attachment_uids: list[str] = []
|
|
|
|
|
|
class IssueAttachmentForm(BaseModel):
|
|
attachment_uids: list[str] = []
|
|
|
|
|
|
class IssueStatusForm(BaseModel):
|
|
status: Literal["open", "closed"]
|