Add generic adapter capability model
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
from typing import Protocol
|
||||
|
||||
from .adapters import (
|
||||
Capability,
|
||||
DiscoveredObject,
|
||||
Endpoint,
|
||||
NormalizedObject,
|
||||
PlanAction,
|
||||
)
|
||||
from .models import DesiredRecord, ProviderCapabilities, ProviderRecord
|
||||
|
||||
|
||||
class AdapterPlugin(Protocol):
|
||||
name: str
|
||||
endpoint: Endpoint
|
||||
capabilities: frozenset[Capability]
|
||||
|
||||
def connect(self) -> None: ...
|
||||
def discover(self, object_type: str) -> list[DiscoveredObject]: ...
|
||||
def apply(self, action: PlanAction) -> str | None: ...
|
||||
def verify(self, object: NormalizedObject) -> bool: ...
|
||||
|
||||
|
||||
# Compatibility protocols for the existing DNS-only execution path. They remain
|
||||
# in place until the current plugins and CLI are migrated to AdapterPlugin.
|
||||
class SourcePlugin(Protocol):
|
||||
name: str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user