31 lines
781 B
Python
31 lines
781 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class ProviderResult:
|
|
ok: bool
|
|
external_key: str = ""
|
|
error: str = ""
|
|
payload: dict | None = None
|
|
|
|
|
|
class TaskProvider:
|
|
name = "base"
|
|
|
|
def healthcheck(self, config: dict) -> ProviderResult:
|
|
raise NotImplementedError
|
|
|
|
def create_task(self, config: dict, payload: dict) -> ProviderResult:
|
|
raise NotImplementedError
|
|
|
|
def append_update(self, config: dict, payload: dict) -> ProviderResult:
|
|
raise NotImplementedError
|
|
|
|
def mark_complete(self, config: dict, payload: dict) -> ProviderResult:
|
|
raise NotImplementedError
|
|
|
|
def link_task(self, config: dict, payload: dict) -> ProviderResult:
|
|
raise NotImplementedError
|