Pydantic models¶
Account¶
- class telegraph_api.models.Account(*, short_name: str, author_name: str, author_url: str, access_token: str = None, auth_url: str = None, page_count: int = None)¶
Represents Account type
- access_token: Optional[str]¶
Optional. Only returned by the createAccount and revokeAccessToken method. Access token of the Telegraph account.
- auth_url: Optional[str]¶
Optional. URL to authorize a browser on telegra.ph and connect it to a Telegraph account.
- author_name: str¶
Default author name used when creating new articles.
- author_url: str¶
Profile link, opened when users click on the author’s name below the title.
- page_count: Optional[int]¶
Optional. Number of pages belonging to the Telegraph account.
- short_name: str¶
Account name, helps users with several accounts remember which they are currently using.
Page¶
- class telegraph_api.models.Page(*, path: str, url: str, title: str, description: str, author_name: str = None, author_url: str = None, image_url: str = None, content: List[Union[Node, str]] = None, views: int, can_edit: bool = None)¶
PyDantic model for telegra.ph Page
- author_name: Optional[str]¶
Optional. Name of the author, displayed below the title.
- author_url: Optional[str]¶
Optional. Profile link, opened when users click on the author’s name below the title. Can be any link, not necessarily to a Telegram profile or channel.
- can_edit: Optional[bool]¶
Optional. Only returned if access_token passed. True, if the target Telegraph account can edit the page.
- description: str¶
Description of the page.
- image_url: Optional[str]¶
Optional. Image URL of the page.
- path: str¶
Path to the page.
- title: str¶
Title of the page.
- url: str¶
URL of the page.
- views: int¶
Number of page views for the page.