from lib.services.rollouts.action_client import ActionClientInterface
from lib.api_schema.response.flava_services.rollouts.v1_0 import (
    action as schema,
)


class FlavaActionClient(ActionClientInterface):
    """Service client for the Flava Rollout Action API.

    This client provides the schema and path to each API endpoint for dependency
    injection.

    NOTE: Paths omit the /v1 prefix because api_version="v1" is set on the
    resource client, and RestClient auto-prepends /{api_version} to the URL.
    """

    def get_schema(self):
        """Provide the response schema of the Action API."""
        return schema

    def get_action_path(self, project, product, name, trigger):
        """Provide the API endpoint path for triggering a rollout action."""
        return f"/projects/{project}/products/{product}/rollouts/{name}/action/{trigger}"
