Source code for dxaws_cloudfront.providers.base

from __future__ import annotations
from typing import Protocol


[docs] class ProviderBase(Protocol): """Provider interface for dxaws-cloudfront."""
[docs] def find_distribution_by_alias(self, alias: str): """Find a distribution by alias (CNAME)."""
[docs] def get_distribution(self, dist_id: str): """Return (DistributionConfig, ETag)."""
[docs] def get_distribution_status(self, dist_id: str) -> str: """Return distribution Status (Deployed/InProgress)."""
[docs] def create_distribution(self, *, config: dict, tags: dict | None = None): """Create a distribution and return a ref."""
[docs] def update_distribution(self, *, dist_id: str, if_match: str, config: dict): """Update a distribution and return a ref."""
[docs] def wait_deployed(self, dist_id: str) -> None: """Wait for distribution to reach Deployed."""
[docs] def disable_distribution(self, dist_id: str) -> None: """Disable a distribution (required before delete)."""
[docs] def delete_distribution(self, dist_id: str) -> None: """Delete a distribution."""