make the connectors form be able to display all types for connectors

This commit is contained in:
Mikhail Epifanov
2024-01-14 16:59:54 +01:00
parent fb65100b14
commit 245787b89e
14 changed files with 302 additions and 93 deletions

View File

@ -0,0 +1,27 @@
from cookbook.connectors.connector import Connector
from cookbook.models import ExampleConfig, Space, ShoppingListEntry
class Example(Connector):
_config: ExampleConfig
def __init__(self, config: ExampleConfig):
self._config = config
async def on_shopping_list_entry_created(self, space: Space, shopping_list_entry: ShoppingListEntry) -> None:
if not self._config.on_shopping_list_entry_created_enabled:
return
pass
async def on_shopping_list_entry_updated(self, space: Space, shopping_list_entry: ShoppingListEntry) -> None:
if not self._config.on_shopping_list_entry_updated_enabled:
return
pass
async def on_shopping_list_entry_deleted(self, space: Space, shopping_list_entry: ShoppingListEntry) -> None:
if not self._config.on_shopping_list_entry_deleted_enabled:
return
pass
async def close(self) -> None:
pass