Module coolipy.services.coolify_api.teams
Classes
class Teams (http_service: HttpService, base_service_url: str)
-
Handles operations related to teams in the Coolify API.
Initializes the Coolify API service with an HTTP service instance and a specific service URL.
Args
http_service
:HttpService
- Instance of the HttpService class for making HTTP requests.
base_service_url
:str
- The endpoint URL for the specific service (e.g., '/servers', '/teams').
Expand source code
class Teams(CoolifyApiBase): """ Handles operations related to teams in the Coolify API. """ def list(self) -> CoolifyAPIResponse: """ Retrieve all teams. Returns: CoolifyAPIResponse: Response containing a list of teams. """ content = self._http.get(self._base_url) return self._handle_response(content, COOLIFY_RETURN_TYPES.list, TeamModel) def get(self, team_id: int) -> CoolifyAPIResponse: """ Retrieve a team by ID. Args: team_id (int): The ID of the team. Returns: CoolifyAPIResponse: Response containing the team details. """ content = self._http.get(f"{self._base_url}/{team_id}") return self._handle_response(content, COOLIFY_RETURN_TYPES.single, TeamModel) def members(self, team_id: int) -> CoolifyAPIResponse: """ Retrieve members of a team. Args: team_id (int): The ID of the team. Returns: CoolifyAPIResponse: Response containing a list of team members. """ content = self._http.get(f"{self._base_url}/{team_id}{URL_MAP.members}") return self._handle_response( content, COOLIFY_RETURN_TYPES.list, TeamMemberModel ) def authenticated_team(self) -> CoolifyAPIResponse: """ Retrieve the authenticated user's team. Returns: CoolifyAPIResponse: Response containing the authenticated team details. """ content = self._http.get(f"{self._base_url}/current") return self._handle_response(content, COOLIFY_RETURN_TYPES.single, TeamModel) def authenticated_team_members(self) -> CoolifyAPIResponse: """ Retrieve members of the authenticated user's team. Returns: CoolifyAPIResponse: Response containing the list of team members. """ content = self._http.get(f"{self._base_url}{URL_MAP.current}{URL_MAP.members}") return self._handle_response( content, COOLIFY_RETURN_TYPES.list, TeamMemberModel )
Ancestors
Methods
def authenticated_team(self) ‑> CoolifyAPIResponse
-
Retrieve the authenticated user's team.
Returns
CoolifyAPIResponse
- Response containing the authenticated team details.
def authenticated_team_members(self) ‑> CoolifyAPIResponse
-
Retrieve members of the authenticated user's team.
Returns
CoolifyAPIResponse
- Response containing the list of team members.
def get(self, team_id: int) ‑> CoolifyAPIResponse
-
Retrieve a team by ID.
Args
team_id
:int
- The ID of the team.
Returns
CoolifyAPIResponse
- Response containing the team details.
def list(self) ‑> CoolifyAPIResponse
-
Retrieve all teams.
Returns
CoolifyAPIResponse
- Response containing a list of teams.
def members(self, team_id: int) ‑> CoolifyAPIResponse
-
Retrieve members of a team.
Args
team_id
:int
- The ID of the team.
Returns
CoolifyAPIResponse
- Response containing a list of team members.