# SPDX-FileCopyrightText: 2025-2026 Global Computing Lab
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from typing import Any, Mapping


class AnnotationType:
    """Base class for all A4X-Orchestration objects that are annotatable."""

    def __init__(self) -> None:
        """Initialize an empty set of annotations."""
        self.annotations_attr = {}

    @property
    def annotations(self) -> Mapping[str, Any]:
        """User-specified annotations on a particular A4X-Orchestration object.

        Annotations are meant to be interpreted by plugins to enable WMS-specific functionality
        that the A4X-Orchestration API does not provide directly. For more information, see the
        documentation of the desired plugin.
        """
        return self.annotations_attr

    @annotations.setter
    def annotations(self, val: Mapping[str, Any]) -> None:
        if not isinstance(val, Mapping):
            raise TypeError("Cannot store a non-Mapping object as annotations")
        self.annotations_attr = val
