Skip to content

Commit

Permalink
Add types client
Browse files Browse the repository at this point in the history
  • Loading branch information
Oluwafemi Adenuga authored Jan 23, 2024
2 parents 4f11b37 + af0b8dd commit b05dfbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openproject/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def __init__(self, base_url: str, api_token: str):
self.work_packages = WorkPackages(self)
self.projects = Projects(self)
self.statuses = Statuses(self)
self.types = Types(self)

def _handle_response(self, response: httpx.Response):
if response.status_code == 401:
Expand Down Expand Up @@ -143,3 +144,11 @@ def list(self):

def view(self, id: int):
return self.client._send_request("GET", f"statuses/{id}")


class Types(SubClient):
def list(self):
return self.client._send_request("GET", "types")

def view(self, id: int):
return self.client._send_request("GET", f"types/{id}")

0 comments on commit b05dfbe

Please sign in to comment.