from __future__ import annotations

from abc import ABC, abstractmethod

from fastapi import Request
from starlette.responses import Response


class Action(ABC):
	"""
	Action: A per-project action provided by a plugin.

	``project`` is the project path/slug as used in URLs (under PROJECTROOT).
	"""

	@abstractmethod
	def action_name(self) -> str: ...

	@abstractmethod
	def action(self, project: str, req: Request | None = None) -> Response | None: ...