webhook_telegram_bot.database.models
This file contains independent database models.
Module Contents
Classes
This class provide pydantic compatible representation of ObjectId. |
|
This class represents webhook object. |
|
This class represents chat object. |
- class webhook_telegram_bot.database.models.PydanticObjectId
Bases:
bson.ObjectIdThis class provide pydantic compatible representation of ObjectId.
- classmethod __get_validators__(cls: Type[PydanticObjectId]) Generator[Callable[[Any], Any], None, None]
Return validators.
- Returns
- classmethod validate(cls: Type[PydanticObjectId], value: Any) Any
Validate object.
- Parameters
value –
- Returns
- class webhook_telegram_bot.database.models.Webhook
Bases:
pydantic.BaseModelThis class represents webhook object.
- webhook_id :str
- service :str
- repository_name :Optional[str]
- __hash__(self) int
Return hash.
- __eq__(self, other: object) bool
Return True if objects are equal.
- class webhook_telegram_bot.database.models.Chat
Bases:
pydantic.BaseModelThis class represents chat object.
- id :Optional[Union[int, PydanticObjectId]]
- chat_id :int
- webhooks :List[Webhook] = []
- get_webhook_by_id(self, webhook_id: str) Optional[Webhook]
Return Webhook object by webhook_id.
- Parameters
webhook_id – chat identification string
- Returns
Webhook instance or None
- set_webhook_repository_name(self, webhook_id: str, name: str) None
Set webhook repository_name.
- Parameters
webhook_id – chat identification string
name – repository name
- Returns
None
- delete_webhook_by_id(self, webhook_id: str) None
Exclude webhook from webhooks list by id.
- Parameters
webhook_id – chat identification string
- Returns
None