"""mgf-cloud — the Magogi Foundation's cloud-resource interface.

A provider-agnostic library for creating and managing cloud **VMs and storage**
(Infomaniak Public Cloud first; AWS-ready). Used by ``mgf-fed`` to own the
federation's Infomaniak resources. Ships a CLI (``mgf-cloud``) and a local web
GUI (``mgf-cloud web``).

Importing :mod:`mgf.cloud` pulls none of the heavy provider SDKs (openstacksdk,
boto3) or the web stack (fastapi): provider adapters are loaded lazily through
:func:`mgf.cloud.get_provider`, each gated behind its own extra
(``mgf-cloud[infomaniak]``, ``[aws]``, ``[web]`` …).
"""

from __future__ import annotations

from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as _pkg_version

from mgf.cloud.config import CloudConfig, Credentials
from mgf.cloud.models import (
    DEFAULT_OWNER,
    OWNER_TAG,
    Flavor,
    FloatingIP,
    Image,
    Keypair,
    Network,
    ObjectContainer,
    ObjectInfo,
    SecurityGroup,
    SecurityRule,
    Server,
    ServerSpec,
    Volume,
    VolumeSnapshot,
    VolumeSpec,
    is_owned,
    owned_metadata,
)
from mgf.cloud.providers import available_providers, get_provider
from mgf.cloud.providers.base import CloudProvider

try:
    #: Single-sourced from the installed package metadata (AP-13/REL-03/REL-06):
    #: this is ALWAYS the real installed version, so __version__, the wheel, and
    #: the git tag can never drift. tests/unit/test_version_in_sync.py pins it to
    #: pyproject on every push (not just at tag time).
    __version__ = _pkg_version("mgf-cloud")
except PackageNotFoundError:  # pragma: no cover - source tree without install metadata
    __version__ = "0.0.0+unknown"

__all__ = [
    "DEFAULT_OWNER",
    "OWNER_TAG",
    "CloudConfig",
    "CloudProvider",
    "Credentials",
    "Flavor",
    "FloatingIP",
    "Image",
    "Keypair",
    "Network",
    "ObjectContainer",
    "ObjectInfo",
    "SecurityGroup",
    "SecurityRule",
    "Server",
    "ServerSpec",
    "Volume",
    "VolumeSnapshot",
    "VolumeSpec",
    "__version__",
    "available_providers",
    "get_provider",
    "is_owned",
    "owned_metadata",
]
