48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
import uuid
|
|
|
|
import pydantic
|
|
|
|
|
|
class ExternalChannelOutput(pydantic.BaseModel):
|
|
id: uuid.UUID
|
|
telegram_id: int
|
|
title: str
|
|
username: str | None
|
|
description: str | None
|
|
subscribers_count: int | None
|
|
|
|
|
|
class GetExternalChannelsInput(pydantic.BaseModel):
|
|
target_channel_id: uuid.UUID
|
|
user_id: uuid.UUID
|
|
|
|
|
|
class GetExternalChannelsOutput(pydantic.BaseModel):
|
|
external_channels: list[ExternalChannelOutput]
|
|
|
|
|
|
class CreateExternalChannelInput(pydantic.BaseModel):
|
|
telegram_id: int
|
|
title: str
|
|
username: str | None = None
|
|
description: str | None = None
|
|
subscribers_count: int | None = None
|
|
target_channel_ids: list[uuid.UUID]
|
|
|
|
|
|
class DeleteExternalChannelInput(pydantic.BaseModel):
|
|
channel_id: uuid.UUID
|
|
user_id: uuid.UUID
|
|
|
|
|
|
class UpdateExternalChannelInput(pydantic.BaseModel):
|
|
title: str | None = None
|
|
username: str | None = None
|
|
description: str | None = None
|
|
subscribers_count: int | None = None
|
|
|
|
|
|
class UpdateExternalChannelLinksInput(pydantic.BaseModel):
|
|
add_target_channel_ids: list[uuid.UUID] = []
|
|
remove_target_channel_ids: list[uuid.UUID] = []
|