|
7 | 7 | from requests import HTTPError
|
8 | 8 | from deprecated import deprecated
|
9 | 9 | from atlassian import utils
|
10 |
| -from .errors import ( |
11 |
| - ApiError, |
12 |
| - ApiNotFoundError, |
13 |
| - ApiPermissionError, |
14 |
| - ApiValueError, |
15 |
| - ApiConflictError, |
16 |
| -) |
| 10 | +from .errors import ApiError, ApiNotFoundError, ApiPermissionError, ApiValueError, ApiConflictError, ApiNotAcceptable |
17 | 11 | from .rest_client import AtlassianRestAPI
|
18 | 12 |
|
19 | 13 | log = logging.getLogger(__name__)
|
@@ -1572,17 +1566,18 @@ def update_existing_page(
|
1572 | 1566 | representation="storage",
|
1573 | 1567 | minor_edit=False,
|
1574 | 1568 | version_comment=None,
|
| 1569 | + full_width=False, |
1575 | 1570 | ):
|
1576 | 1571 | """Duplicate update_page. Left for the people who used it before. Use update_page instead"""
|
1577 | 1572 | return self.update_page(
|
1578 | 1573 | page_id=page_id,
|
1579 | 1574 | title=title,
|
1580 | 1575 | body=body,
|
1581 |
| - parent_id=None, |
1582 | 1576 | type=type,
|
1583 | 1577 | representation=representation,
|
1584 | 1578 | minor_edit=minor_edit,
|
1585 | 1579 | version_comment=version_comment,
|
| 1580 | + full_width=full_width, |
1586 | 1581 | )
|
1587 | 1582 |
|
1588 | 1583 | def update_page(
|
@@ -2943,6 +2938,101 @@ def clean_jira_metadata_cache(self, global_id):
|
2943 | 2938 | params = {"globalId": global_id}
|
2944 | 2939 | return self.delete(url, params=params)
|
2945 | 2940 |
|
| 2941 | + # Collaborative editing |
| 2942 | + def collaborative_editing_get_configuration(self): |
| 2943 | + """ |
| 2944 | + Get collaborative editing configuration |
| 2945 | + Related to the on-prem setup Confluence Data Center |
| 2946 | + :return: |
| 2947 | + """ |
| 2948 | + if self.cloud: |
| 2949 | + return ApiNotAcceptable |
| 2950 | + url = "rest/synchrony-interop/configuration" |
| 2951 | + return self.get(url, headers=self.no_check_headers) |
| 2952 | + |
| 2953 | + def collaborative_editing_disable(self): |
| 2954 | + """ |
| 2955 | + Disable collaborative editing |
| 2956 | + Related to the on-prem setup Confluence Data Center |
| 2957 | + :return: |
| 2958 | + """ |
| 2959 | + if self.cloud: |
| 2960 | + return ApiNotAcceptable |
| 2961 | + url = "rest/synchrony-interop/disable" |
| 2962 | + return self.post(url, headers=self.no_check_headers) |
| 2963 | + |
| 2964 | + def collaborative_editing_enable(self): |
| 2965 | + """ |
| 2966 | + Disable collaborative editing |
| 2967 | + Related to the on-prem setup Confluence Data Center |
| 2968 | + :return: |
| 2969 | + """ |
| 2970 | + if self.cloud: |
| 2971 | + return ApiNotAcceptable |
| 2972 | + url = "rest/synchrony-interop/enable" |
| 2973 | + return self.post(url, headers=self.no_check_headers) |
| 2974 | + |
| 2975 | + def collaborative_editing_restart(self): |
| 2976 | + """ |
| 2977 | + Disable collaborative editing |
| 2978 | + Related to the on-prem setup Confluence Data Center |
| 2979 | + :return: |
| 2980 | + """ |
| 2981 | + if self.cloud: |
| 2982 | + return ApiNotAcceptable |
| 2983 | + url = "rest/synchrony-interop/restart" |
| 2984 | + return self.post(url, headers=self.no_check_headers) |
| 2985 | + |
| 2986 | + def collaborative_editing_shared_draft_status(self): |
| 2987 | + """ |
| 2988 | + Status of collaborative editing |
| 2989 | + Related to the on-prem setup Confluence Data Center |
| 2990 | + :return: false or true parameter in json |
| 2991 | + { |
| 2992 | + "sharedDraftsEnabled": false |
| 2993 | + } |
| 2994 | + """ |
| 2995 | + if self.cloud: |
| 2996 | + return ApiNotAcceptable |
| 2997 | + url = "rest/synchrony-interop/status" |
| 2998 | + return self.get(url, headers=self.no_check_headers) |
| 2999 | + |
| 3000 | + def collaborative_editing_synchrony_status(self): |
| 3001 | + """ |
| 3002 | + Status of collaborative editing |
| 3003 | + Related to the on-prem setup Confluence Data Center |
| 3004 | + :return: stopped or running parameter in json |
| 3005 | + { |
| 3006 | + "status": "stopped" |
| 3007 | + } |
| 3008 | + """ |
| 3009 | + if self.cloud: |
| 3010 | + return ApiNotAcceptable |
| 3011 | + url = "rest/synchrony-interop/synchrony-status" |
| 3012 | + return self.get(url, headers=self.no_check_headers) |
| 3013 | + |
| 3014 | + def synchrony_get_configuration(self): |
| 3015 | + """ |
| 3016 | + Status of collaborative editing |
| 3017 | + Related to the on-prem setup Confluence Data Center |
| 3018 | + :return: |
| 3019 | + """ |
| 3020 | + if self.cloud: |
| 3021 | + return ApiNotAcceptable |
| 3022 | + url = "rest/synchrony/1.0/config/status" |
| 3023 | + return self.get(url, headers=self.no_check_headers) |
| 3024 | + |
| 3025 | + def synchrony_remove_draft(self, page_id): |
| 3026 | + """ |
| 3027 | + Status of collaborative editing |
| 3028 | + Related to the on-prem setup Confluence Data Center |
| 3029 | + :return: |
| 3030 | + """ |
| 3031 | + if self.cloud: |
| 3032 | + return ApiNotAcceptable |
| 3033 | + url = "rest/synchrony/1.0/content/{pageId}/changes/unpublished".format(pageId=page_id) |
| 3034 | + return self.delete(url) |
| 3035 | + |
2946 | 3036 | def get_license_details(self):
|
2947 | 3037 | """
|
2948 | 3038 | Returns the license detailed information
|
|
0 commit comments