from typing import Dict, Any, Optional
from ..http_client import HTTPClient


class UsageResource:
    def __init__(self, http: HTTPClient):
        self._http = http

    def get_current_period(self, project_id: str) -> Dict[str, Any]:
        return self._http.get(f"/usage/projects/{project_id}/current")

    def get_reports(self, project_id: str, start_date: str = None,
                    end_date: str = None) -> Dict[str, Any]:
        params = {"projectId": project_id}
        if start_date:
            params["startDate"] = start_date
        if end_date:
            params["endDate"] = end_date
        return self._http.get("/usage/reports", params=params)
