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


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

    def list(self, page: int = 1, page_size: int = 20) -> Dict[str, Any]:
        return self._http.get("/organizations", params={"page": page, "pageSize": page_size})

    def get(self, org_id: str) -> Dict[str, Any]:
        return self._http.get(f"/organizations/{org_id}")

    def create(self, data: Dict[str, Any]) -> Dict[str, Any]:
        return self._http.post("/organizations", json=data)

    def update(self, org_id: str, data: Dict[str, Any]) -> Dict[str, Any]:
        return self._http.patch(f"/organizations/{org_id}", json=data)
