from lib.services.cloud_blueprint.github_client import GithubClientInterface
from lib.api_schema.response.flava_services.cloud_blueprint.v1_0 import (
    github as schema,
)


class FlavaGithubClient(GithubClientInterface):
    """Service client for the Flava Cloud Blueprint GitHub API.

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

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

    def get_oauth_login_url_path(self, host):
        """Provide the API endpoint path for OAuth login URL."""
        return f"/api/v1/github/{host}/oauth/login-url"

    def get_oauth_callback_path(self, host):
        """Provide the API endpoint path for OAuth callback."""
        return f"/api/v1/github/{host}/oauth/callback"

    def get_installations_path(self, host):
        """Provide the API endpoint path for GitHub installations."""
        return f"/api/v1/github/{host}/installations"

    def get_app_install_url_path(self, host):
        """Provide the API endpoint path for GitHub App install URL."""
        return f"/api/v1/github/{host}/app/install-url"

    def get_repos_path(self, host):
        """Provide the API endpoint path for GitHub repos."""
        return f"/api/v1/github/{host}/repos"

    def get_branches_path(self, host, owner, repo):
        """Provide the API endpoint path for GitHub branches."""
        return f"/api/v1/github/{host}/{owner}/{repo}/branches"
