"""DeployedItems Resource."""

from typing import Any, Dict, List

from netorca_sdk.v2.base import BaseResource
from netorca_sdk.v2.models.deployed_item import DeployedItem


class DeployedItemsResource(BaseResource):
    """Deployed Items resource."""

    endpoint = "deployed_items"
    model_class = DeployedItem

    def get_dependant(self, **filters: Any) -> List[Dict[str, Any]]:
        """
        Get dependent deployed items.

        Args:
            **filters: Filter parameters

        Returns:
            List of dependent item data
        """
        results = []
        for item in self.client.get(self.endpoint, params=filters, custom_path="deployed_items/dependant"):
            results.append(item)
        return results
