From 2480369e0e7cb8def52b08db53f384481f438091 Mon Sep 17 00:00:00 2001 From: Oluwafemi Adenuga Date: Wed, 8 Nov 2023 15:05:44 +0100 Subject: [PATCH] Add status client --- openproject/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openproject/client.py b/openproject/client.py index 7abd848..18dbe62 100644 --- a/openproject/client.py +++ b/openproject/client.py @@ -11,6 +11,7 @@ def __init__(self, base_url: str, api_token: str): self.work_packages = WorkPackages(self) self.projects = Projects(self) + self.statuses = Statuses(self) def _handle_response(self, response: httpx.Response): if response.status_code == 401: @@ -131,3 +132,11 @@ def update(self, id: int, **kwargs): def delete(self, id: int): return self.client._send_request("DELETE", f"/projects/{id}") + + +class Statuses(SubClient): + def list(self): + return self.client._send_request("GET", "/statuses") + + def view(self, id: int): + return self.client._send_request("GET", f"/statuses/{id}")