Skip to content

Commit b0c9f71

Browse files
authored
Add support for statuspage.io (atlassian-api#1120)
* [Statuspage] WIP: add wrapping around page API * [Statuspage] WIP: add wrapper around organization permissions * [Statuspage] WIP: add typing for older version of python * [Statuspage] WIP: remove typehints from parameters * [Statuspage] WIP: add embed config settings * [Statuspage] WIP: add page access users And also fix parameters in docstings * [Statuspage] WIP: add Page Access User Components * [Statuspage] WIP: add Page Access User Metrics * [Statuspage] WIP: add Page Access Groups * [Statuspage] WIP: add Page Access Group Components * [Statuspage] WIP: add page_ to all page methods * [rest-client] add: patch method * [Statuspage] WIP: add Page Subscribers * [Statuspage] WIP: add Page Templates * [Statuspage] WIP: renaming moment * [Statuspage] WIP: add Page Incidents * [Statuspage] WIP: add Page Incident Updates * [Statuspage] WIP: add Page Incident Subscribers * [Statuspage] WIP: add Page Incident Subscribers * [Statuspage] WIP: probably fix Codacy complains * [Statuspage] WIP: add Page Components * [Statuspage] WIP: add Page Components Groups * [Statuspage] WIP: add Page Metrics * [Statuspage] Do not shadow the builtin id and add docstring for the wrapper * [Statuspage] WIP: add Page Metric Providers * [Statuspage] Making naming consistent * [Statuspage] Fix typo * [Statuspage] Fix E501 (really long strings) * [Statuspage] Rename page getter function This way it feels better * [Statuspage] Refactor page_get_subscribers * [Statuspage] Refactor page_get_uptime_component, page_get_uptime_for_component_group * [Statuspage] Replace PUT with PATCH In general, I think this is more useful. Yet there is a reason to use PUT sometimes, but when? And how do we call functions with it?
1 parent d11bbb1 commit b0c9f71

File tree

2 files changed

+3169
-0
lines changed

2 files changed

+3169
-0
lines changed

atlassian/rest_client.py

+36
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,42 @@ def put(
381381
return response
382382
return self._response_handler(response)
383383

384+
def patch(
385+
self,
386+
path,
387+
data=None,
388+
headers=None,
389+
files=None,
390+
trailing=None,
391+
params=None,
392+
absolute=False,
393+
advanced_mode=False,
394+
):
395+
"""
396+
:param path: Path of request
397+
:param data:
398+
:param headers: adjusted headers, usually it's default
399+
:param files:
400+
:param trailing:
401+
:param params:
402+
:param absolute:
403+
:param advanced_mode: bool, OPTIONAL: Return the raw response
404+
:return: if advanced_mode is not set - returns dictionary. If it is set - returns raw response.
405+
"""
406+
response = self.request(
407+
"PATCH",
408+
path=path,
409+
data=data,
410+
headers=headers,
411+
files=files,
412+
params=params,
413+
trailing=trailing,
414+
absolute=absolute,
415+
)
416+
if self.advanced_mode or advanced_mode:
417+
return response
418+
return self._response_handler(response)
419+
384420
def delete(
385421
self,
386422
path,

0 commit comments

Comments
 (0)