Commit 87f9913b authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Add method for patching branches

parent 0886b7fb
......@@ -206,6 +206,16 @@ class TopDeskClient:
return_response=True,
data=branch.json())
def patch_branch(self, branch_id: str, data: dict) -> Optional[Branch]:
url = self.urls.get_branch(branch_id)
r = self.patch(url,
return_response=True,
json=data)
r.raise_for_status()
if r.status_code == 200:
return Branch.from_dict(r.json())
return None
def get_client(config):
return TopDeskClient(**config)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment