Skip to content

Commit

Permalink
Merge pull request #11 from CPES-Power-and-Energy-Systems/feat/patch-…
Browse files Browse the repository at this point in the history
…openapi-specs

added PATCH operation for openapi data app requests
  • Loading branch information
itsjrsa authored Feb 26, 2024
2 parents 47b83ca + 019f7a8 commit fb8c5c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tsg_client/controllers/RequestController.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@ def post(self, endpoint, **kwargs):
def put(self, endpoint, **kwargs):
return self.request('PUT', endpoint, **kwargs)

def patch(self, endpoint, **kwargs):
return self.request('PATCH', endpoint, **kwargs)

def delete(self, endpoint, **kwargs):
return self.request('DELETE', endpoint, **kwargs)
4 changes: 3 additions & 1 deletion tsg_client/controllers/TSGController.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ def openapi_request(self, external_access_url, data_app_agent_id,
elif method == "put":
rsp = self.controller.put(endpoint=full_endpoint, headers=headers, params=params, data=data)
elif method == "delete":
rsp = self.controller.delete(endpoint=full_endpoint, headers=headers, params=params) # noqa
rsp = self.controller.delete(endpoint=full_endpoint, headers=headers, params=params)
elif method == "patch":
rsp = self.controller.patch(endpoint=full_endpoint, headers=headers, params=params, data=data)

return rsp

Expand Down

0 comments on commit fb8c5c3

Please sign in to comment.