@resolution/confluence-api-client 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +60 -1
  3. package/lib/openapi/v1/BaseConfluenceApiV1Client.d.ts +32 -33
  4. package/lib/openapi/v1/BaseConfluenceApiV1Client.js +151 -88
  5. package/lib/openapi/v1/BaseConfluenceApiV1Client.js.map +1 -1
  6. package/lib/openapi/v1/core/CommonHttpService.d.ts +2 -0
  7. package/lib/openapi/v1/core/CommonHttpService.js +9 -0
  8. package/lib/openapi/v1/core/CommonHttpService.js.map +1 -1
  9. package/lib/openapi/v1/services/AnalyticsService.d.ts +10 -10
  10. package/lib/openapi/v1/services/AnalyticsService.js +62 -59
  11. package/lib/openapi/v1/services/AnalyticsService.js.map +1 -1
  12. package/lib/openapi/v1/services/AuditService.d.ts +25 -25
  13. package/lib/openapi/v1/services/AuditService.js +205 -202
  14. package/lib/openapi/v1/services/AuditService.js.map +1 -1
  15. package/lib/openapi/v1/services/ContentAttachmentsService.d.ts +20 -20
  16. package/lib/openapi/v1/services/ContentAttachmentsService.js +317 -314
  17. package/lib/openapi/v1/services/ContentAttachmentsService.js.map +1 -1
  18. package/lib/openapi/v1/services/ContentBodyService.d.ts +15 -15
  19. package/lib/openapi/v1/services/ContentBodyService.js +140 -137
  20. package/lib/openapi/v1/services/ContentBodyService.js.map +1 -1
  21. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.d.ts +27 -27
  22. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js +391 -388
  23. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js.map +1 -1
  24. package/lib/openapi/v1/services/ContentCommentsService.d.ts +8 -8
  25. package/lib/openapi/v1/services/ContentCommentsService.js +49 -46
  26. package/lib/openapi/v1/services/ContentCommentsService.js.map +1 -1
  27. package/lib/openapi/v1/services/ContentLabelsService.d.ts +11 -11
  28. package/lib/openapi/v1/services/ContentLabelsService.js +150 -147
  29. package/lib/openapi/v1/services/ContentLabelsService.js.map +1 -1
  30. package/lib/openapi/v1/services/ContentMacroBodyService.d.ts +13 -13
  31. package/lib/openapi/v1/services/ContentMacroBodyService.js +155 -152
  32. package/lib/openapi/v1/services/ContentMacroBodyService.js.map +1 -1
  33. package/lib/openapi/v1/services/ContentPermissionsService.d.ts +2 -2
  34. package/lib/openapi/v1/services/ContentPermissionsService.js +48 -45
  35. package/lib/openapi/v1/services/ContentPermissionsService.js.map +1 -1
  36. package/lib/openapi/v1/services/ContentPropertiesService.d.ts +18 -18
  37. package/lib/openapi/v1/services/ContentPropertiesService.js +237 -234
  38. package/lib/openapi/v1/services/ContentPropertiesService.js.map +1 -1
  39. package/lib/openapi/v1/services/ContentRestrictionsService.d.ts +49 -49
  40. package/lib/openapi/v1/services/ContentRestrictionsService.js +505 -502
  41. package/lib/openapi/v1/services/ContentRestrictionsService.js.map +1 -1
  42. package/lib/openapi/v1/services/ContentService.d.ts +50 -50
  43. package/lib/openapi/v1/services/ContentService.js +475 -472
  44. package/lib/openapi/v1/services/ContentService.js.map +1 -1
  45. package/lib/openapi/v1/services/ContentStatesService.d.ts +25 -25
  46. package/lib/openapi/v1/services/ContentStatesService.js +359 -356
  47. package/lib/openapi/v1/services/ContentStatesService.js.map +1 -1
  48. package/lib/openapi/v1/services/ContentVersionsService.d.ts +13 -13
  49. package/lib/openapi/v1/services/ContentVersionsService.js +144 -141
  50. package/lib/openapi/v1/services/ContentVersionsService.js.map +1 -1
  51. package/lib/openapi/v1/services/ContentWatchesService.d.ts +57 -57
  52. package/lib/openapi/v1/services/ContentWatchesService.js +454 -451
  53. package/lib/openapi/v1/services/ContentWatchesService.js.map +1 -1
  54. package/lib/openapi/v1/services/DynamicModulesService.d.ts +5 -5
  55. package/lib/openapi/v1/services/DynamicModulesService.js +70 -67
  56. package/lib/openapi/v1/services/DynamicModulesService.js.map +1 -1
  57. package/lib/openapi/v1/services/ExperimentalService.d.ts +12 -12
  58. package/lib/openapi/v1/services/ExperimentalService.js +151 -148
  59. package/lib/openapi/v1/services/ExperimentalService.js.map +1 -1
  60. package/lib/openapi/v1/services/GroupService.d.ts +52 -52
  61. package/lib/openapi/v1/services/GroupService.js +445 -442
  62. package/lib/openapi/v1/services/GroupService.js.map +1 -1
  63. package/lib/openapi/v1/services/InlineTasksService.d.ts +20 -20
  64. package/lib/openapi/v1/services/InlineTasksService.js +118 -115
  65. package/lib/openapi/v1/services/InlineTasksService.js.map +1 -1
  66. package/lib/openapi/v1/services/LabelInfoService.d.ts +5 -5
  67. package/lib/openapi/v1/services/LabelInfoService.js +37 -34
  68. package/lib/openapi/v1/services/LabelInfoService.js.map +1 -1
  69. package/lib/openapi/v1/services/LongRunningTaskService.d.ts +8 -6
  70. package/lib/openapi/v1/services/LongRunningTaskService.js +67 -63
  71. package/lib/openapi/v1/services/LongRunningTaskService.js.map +1 -1
  72. package/lib/openapi/v1/services/RelationService.d.ts +37 -37
  73. package/lib/openapi/v1/services/RelationService.js +231 -228
  74. package/lib/openapi/v1/services/RelationService.js.map +1 -1
  75. package/lib/openapi/v1/services/SearchService.d.ts +20 -20
  76. package/lib/openapi/v1/services/SearchService.js +136 -133
  77. package/lib/openapi/v1/services/SearchService.js.map +1 -1
  78. package/lib/openapi/v1/services/SettingsService.d.ts +15 -15
  79. package/lib/openapi/v1/services/SettingsService.js +204 -201
  80. package/lib/openapi/v1/services/SettingsService.js.map +1 -1
  81. package/lib/openapi/v1/services/SpacePermissionsService.d.ts +6 -6
  82. package/lib/openapi/v1/services/SpacePermissionsService.js +99 -96
  83. package/lib/openapi/v1/services/SpacePermissionsService.js.map +1 -1
  84. package/lib/openapi/v1/services/SpacePropertiesService.d.ts +16 -16
  85. package/lib/openapi/v1/services/SpacePropertiesService.js +227 -224
  86. package/lib/openapi/v1/services/SpacePropertiesService.js.map +1 -1
  87. package/lib/openapi/v1/services/SpaceService.d.ts +38 -38
  88. package/lib/openapi/v1/services/SpaceService.js +320 -317
  89. package/lib/openapi/v1/services/SpaceService.js.map +1 -1
  90. package/lib/openapi/v1/services/SpaceSettingsService.d.ts +4 -4
  91. package/lib/openapi/v1/services/SpaceSettingsService.js +68 -65
  92. package/lib/openapi/v1/services/SpaceSettingsService.js.map +1 -1
  93. package/lib/openapi/v1/services/TemplateService.d.ts +20 -20
  94. package/lib/openapi/v1/services/TemplateService.js +214 -211
  95. package/lib/openapi/v1/services/TemplateService.js.map +1 -1
  96. package/lib/openapi/v1/services/ThemesService.d.ts +13 -13
  97. package/lib/openapi/v1/services/ThemesService.js +179 -176
  98. package/lib/openapi/v1/services/ThemesService.js.map +1 -1
  99. package/lib/openapi/v1/services/UserPropertiesService.d.ts +12 -12
  100. package/lib/openapi/v1/services/UserPropertiesService.js +165 -162
  101. package/lib/openapi/v1/services/UserPropertiesService.js.map +1 -1
  102. package/lib/openapi/v1/services/UsersService.d.ts +21 -21
  103. package/lib/openapi/v1/services/UsersService.js +229 -226
  104. package/lib/openapi/v1/services/UsersService.js.map +1 -1
  105. package/lib/openapi/v2/BaseConfluenceApiV2Client.d.ts +23 -24
  106. package/lib/openapi/v2/BaseConfluenceApiV2Client.js +92 -47
  107. package/lib/openapi/v2/BaseConfluenceApiV2Client.js.map +1 -1
  108. package/lib/openapi/v2/core/CommonHttpService.d.ts +2 -0
  109. package/lib/openapi/v2/core/CommonHttpService.js +9 -0
  110. package/lib/openapi/v2/core/CommonHttpService.js.map +1 -1
  111. package/lib/openapi/v2/models/user.d.ts +0 -2
  112. package/lib/openapi/v2/models/user.js +0 -2
  113. package/lib/openapi/v2/models/user.js.map +1 -1
  114. package/lib/openapi/v2/services/AncestorsService.d.ts +17 -17
  115. package/lib/openapi/v2/services/AncestorsService.js +174 -171
  116. package/lib/openapi/v2/services/AncestorsService.js.map +1 -1
  117. package/lib/openapi/v2/services/AttachmentService.d.ts +62 -62
  118. package/lib/openapi/v2/services/AttachmentService.js +261 -258
  119. package/lib/openapi/v2/services/AttachmentService.js.map +1 -1
  120. package/lib/openapi/v2/services/BlogPostService.d.ts +70 -70
  121. package/lib/openapi/v2/services/BlogPostService.js +270 -267
  122. package/lib/openapi/v2/services/BlogPostService.js.map +1 -1
  123. package/lib/openapi/v2/services/ChildrenService.d.ts +14 -14
  124. package/lib/openapi/v2/services/ChildrenService.js +77 -74
  125. package/lib/openapi/v2/services/ChildrenService.js.map +1 -1
  126. package/lib/openapi/v2/services/ClassificationLevelService.d.ts +21 -21
  127. package/lib/openapi/v2/services/ClassificationLevelService.js +304 -301
  128. package/lib/openapi/v2/services/ClassificationLevelService.js.map +1 -1
  129. package/lib/openapi/v2/services/CommentService.d.ts +136 -136
  130. package/lib/openapi/v2/services/CommentService.js +635 -632
  131. package/lib/openapi/v2/services/CommentService.js.map +1 -1
  132. package/lib/openapi/v2/services/ContentPropertiesService.d.ts +128 -128
  133. package/lib/openapi/v2/services/ContentPropertiesService.js +1242 -1239
  134. package/lib/openapi/v2/services/ContentPropertiesService.js.map +1 -1
  135. package/lib/openapi/v2/services/ContentService.d.ts +2 -2
  136. package/lib/openapi/v2/services/ContentService.js +40 -37
  137. package/lib/openapi/v2/services/ContentService.js.map +1 -1
  138. package/lib/openapi/v2/services/CustomContentService.d.ts +72 -72
  139. package/lib/openapi/v2/services/CustomContentService.js +299 -296
  140. package/lib/openapi/v2/services/CustomContentService.js.map +1 -1
  141. package/lib/openapi/v2/services/DataPoliciesService.d.ts +10 -10
  142. package/lib/openapi/v2/services/DataPoliciesService.js +67 -64
  143. package/lib/openapi/v2/services/DataPoliciesService.js.map +1 -1
  144. package/lib/openapi/v2/services/DatabaseService.d.ts +17 -17
  145. package/lib/openapi/v2/services/DatabaseService.js +90 -87
  146. package/lib/openapi/v2/services/DatabaseService.js.map +1 -1
  147. package/lib/openapi/v2/services/LabelService.d.ts +57 -57
  148. package/lib/openapi/v2/services/LabelService.js +263 -260
  149. package/lib/openapi/v2/services/LabelService.js.map +1 -1
  150. package/lib/openapi/v2/services/LikeService.d.ts +36 -36
  151. package/lib/openapi/v2/services/LikeService.js +250 -247
  152. package/lib/openapi/v2/services/LikeService.js.map +1 -1
  153. package/lib/openapi/v2/services/OperationService.d.ts +20 -20
  154. package/lib/openapi/v2/services/OperationService.js +298 -295
  155. package/lib/openapi/v2/services/OperationService.js.map +1 -1
  156. package/lib/openapi/v2/services/PageService.d.ts +73 -73
  157. package/lib/openapi/v2/services/PageService.js +272 -269
  158. package/lib/openapi/v2/services/PageService.js.map +1 -1
  159. package/lib/openapi/v2/services/SmartLinkService.d.ts +19 -17
  160. package/lib/openapi/v2/services/SmartLinkService.js +92 -89
  161. package/lib/openapi/v2/services/SmartLinkService.js.map +1 -1
  162. package/lib/openapi/v2/services/SpacePermissionsService.d.ts +6 -6
  163. package/lib/openapi/v2/services/SpacePermissionsService.js +35 -32
  164. package/lib/openapi/v2/services/SpacePermissionsService.js.map +1 -1
  165. package/lib/openapi/v2/services/SpacePropertiesService.d.ts +15 -15
  166. package/lib/openapi/v2/services/SpacePropertiesService.js +165 -162
  167. package/lib/openapi/v2/services/SpacePropertiesService.js.map +1 -1
  168. package/lib/openapi/v2/services/SpaceService.d.ts +28 -28
  169. package/lib/openapi/v2/services/SpaceService.js +83 -80
  170. package/lib/openapi/v2/services/SpaceService.js.map +1 -1
  171. package/lib/openapi/v2/services/TaskService.d.ts +40 -40
  172. package/lib/openapi/v2/services/TaskService.js +120 -117
  173. package/lib/openapi/v2/services/TaskService.js.map +1 -1
  174. package/lib/openapi/v2/services/UserService.d.ts +11 -11
  175. package/lib/openapi/v2/services/UserService.js +91 -88
  176. package/lib/openapi/v2/services/UserService.js.map +1 -1
  177. package/lib/openapi/v2/services/VersionService.d.ts +59 -59
  178. package/lib/openapi/v2/services/VersionService.js +395 -392
  179. package/lib/openapi/v2/services/VersionService.js.map +1 -1
  180. package/lib/openapi/v2/services/WhiteboardService.d.ts +17 -17
  181. package/lib/openapi/v2/services/WhiteboardService.js +90 -87
  182. package/lib/openapi/v2/services/WhiteboardService.js.map +1 -1
  183. package/package.json +4 -3
@@ -12,508 +12,511 @@ const contentRestrictions_1 = require("../models/contentRestrictions");
12
12
  const validationSchemaStorage_1 = require("../validationSchemaStorage");
13
13
  /** @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions */
14
14
  class ContentRestrictionsService extends CommonHttpService_1.CommonHttpService {
15
- /**
16
- * Deprecated, use [Add group to content restriction via
17
- * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-put).
18
- * Adds a group to a content restriction. That is, grant read or update
19
- * permission to the group for a piece of content.
20
- *
21
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
22
- * Permission to edit the content.
23
- *
24
- * @deprecated
25
- * @path {PUT}
26
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
27
- * @scopes-current write:confluence-content
28
- * @scopes-beta write:content.restriction:confluence
29
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-put
30
- */
31
- addGroupToContentRestriction({ id, operationKey, groupName, }) {
32
- return this.getClientInstance()
33
- .request({
34
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
35
- method: "PUT",
36
- pathParams: {
37
- id,
38
- operationKey,
39
- groupName,
40
- },
41
- })
42
- .then(commonHttpClient.discardResult);
43
- }
44
- /**
45
- * Adds a group to a content restriction by Group Id. That is, grant read or update
46
- * permission to the group for a piece of content.
47
- *
48
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
49
- * Permission to edit the content.
50
- *
51
- * @path {PUT}
52
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
53
- * @scopes-current write:confluence-content
54
- * @scopes-beta write:content.restriction:confluence
55
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-put
56
- */
57
- addGroupToContentRestrictionByGroupId({ id, operationKey, groupId, }) {
58
- return this.getClientInstance()
59
- .request({
60
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
61
- method: "PUT",
62
- pathParams: {
63
- id,
64
- operationKey,
65
- groupId,
66
- },
67
- })
68
- .then(commonHttpClient.discardResult);
69
- }
70
- /**
71
- * Adds restrictions to a piece of content. Note, this does not change any
72
- * existing restrictions on the content.
73
- *
74
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
75
- * Permission to edit the content.
76
- *
77
- * @returns Returned if the requested restrictions are added.
78
- * @path {POST} /wiki/rest/api/content/{id}/restriction
79
- * @scopes-current write:confluence-content
80
- * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
81
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-post
82
- */
83
- addRestrictions({ id, expand, contentRestrictionAddOrUpdateArray, }) {
84
- return this.getClientInstance()
85
- .request({
86
- path: "/wiki/rest/api/content/{id}/restriction",
87
- method: "POST",
88
- pathParams: {
89
- id,
90
- },
91
- query: {
92
- expand,
93
- },
94
- headers: {
95
- "Content-Type": "application/json",
96
- },
97
- body: contentRestrictionAddOrUpdateArray,
98
- })
99
- .then(this.getClientInstance().responseHandler({
100
- 200: {
101
- "application/json": "json",
102
- },
103
- }))
104
- .then(commonHttpClient.castResponse())
105
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.addRestrictions.response"))
106
- .then(commonHttpClient.getBody);
107
- }
108
- /**
109
- * Adds a user to a content restriction. That is, grant read or update
110
- * permission to the user for a piece of content.
111
- *
112
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
113
- * Permission to edit the content.
114
- *
115
- * @path {PUT} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
116
- * @scopes-current write:confluence-content
117
- * @scopes-beta write:content.restriction:confluence
118
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-put
119
- */
120
- addUserToContentRestriction({ id, operationKey, key, username, accountId, }) {
121
- return this.getClientInstance()
122
- .request({
123
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
124
- method: "PUT",
125
- pathParams: {
126
- id,
127
- operationKey,
128
- },
129
- query: {
130
- key,
131
- username,
132
- accountId,
133
- },
134
- })
135
- .then(commonHttpClient.discardResult);
136
- }
137
- /**
138
- * Removes all restrictions (read and update) on a piece of content.
139
- *
140
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
141
- * Permission to edit the content.
142
- *
143
- * @returns Returned if the restrictions are removed.
144
- * @path {DELETE} /wiki/rest/api/content/{id}/restriction
145
- * @scopes-current write:confluence-content
146
- * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
147
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-delete
148
- */
149
- deleteRestrictions({ id, expand, }) {
150
- return this.getClientInstance()
151
- .request({
152
- path: "/wiki/rest/api/content/{id}/restriction",
153
- method: "DELETE",
154
- pathParams: {
155
- id,
156
- },
157
- query: {
158
- expand,
159
- },
160
- })
161
- .then(this.getClientInstance().responseHandler({
162
- 200: {
163
- "application/json": "json",
164
- },
165
- }))
166
- .then(commonHttpClient.castResponse())
167
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.deleteRestrictions.response"))
168
- .then(commonHttpClient.getBody);
169
- }
170
- /**
171
- * Deprecated, use [Get content restriction status for group via
172
- * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-get).
173
- * Returns whether the specified content restriction applies to a group.
174
- * For example, if a page with `id=123` has a `read` restriction for the `admins`
175
- * group,
176
- * the following request will return `true`:
177
- *
178
- * `/wiki/rest/api/content/123/restriction/byOperation/read/group/admins`
179
- *
180
- * Note that a response of `true` does not guarantee that the group can view the
181
- * page, as it does not account for
182
- * account-inherited restrictions, space permissions, or even product access. For
183
- * more
184
- * information, see [Confluence
185
- * permissions](https://confluence.atlassian.com/x/_AozKw).
186
- *
187
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
188
- * Permission to view the content.
189
- *
190
- * @deprecated
191
- * @path {GET}
192
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
193
- * @scopes-current read:confluence-content.all
194
- * @scopes-beta read:content.restriction:confluence
195
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-get
196
- */
197
- getContentRestrictionStatusForGroup({ id, operationKey, groupName, }) {
198
- return this.getClientInstance()
199
- .request({
200
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
201
- method: "GET",
202
- pathParams: {
203
- id,
204
- operationKey,
205
- groupName,
206
- },
207
- })
208
- .then(commonHttpClient.discardResult);
209
- }
210
- /**
211
- * Returns whether the specified content restriction applies to a user.
212
- * For example, if a page with `id=123` has a `read` restriction for a user with
213
- * an account ID of
214
- * `384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192`, the following request will
215
- * return `true`:
216
- *
217
- * `/wiki/rest/api/content/123/restriction/byOperation/read/user?accountId=384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192`
218
- *
219
- * Note that a response of `true` does not guarantee that the user can view the
220
- * page, as it does not account for
221
- * account-inherited restrictions, space permissions, or even product access. For
222
- * more
223
- * information, see [Confluence
224
- * permissions](https://confluence.atlassian.com/x/_AozKw).
225
- *
226
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
227
- * Permission to view the content.
228
- *
229
- * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
230
- * @scopes-current read:confluence-content.all
231
- * @scopes-beta read:content.restriction:confluence
232
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-get
233
- */
234
- getContentRestrictionStatusForUser({ id, operationKey, key, username, accountId, }) {
235
- return this.getClientInstance()
236
- .request({
237
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
238
- method: "GET",
239
- pathParams: {
240
- id,
241
- operationKey,
242
- },
243
- query: {
244
- key,
245
- username,
246
- accountId,
247
- },
248
- })
249
- .then(commonHttpClient.discardResult);
250
- }
251
- /**
252
- * Returns whether the specified content restriction applies to a group.
253
- * For example, if a page with `id=123` has a `read` restriction for the `123456`
254
- * group id,
255
- * the following request will return `true`:
256
- *
257
- * `/wiki/rest/api/content/123/restriction/byOperation/read/byGroupId/123456`
258
- *
259
- * Note that a response of `true` does not guarantee that the group can view the
260
- * page, as it does not account for
261
- * account-inherited restrictions, space permissions, or even product access. For
262
- * more
263
- * information, see [Confluence
264
- * permissions](https://confluence.atlassian.com/x/_AozKw).
265
- *
266
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
267
- * Permission to view the content.
268
- *
269
- * @path {GET}
270
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
271
- * @scopes-current read:confluence-content.all
272
- * @scopes-beta read:content.restriction:confluence
273
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-get
274
- */
275
- getIndividualGroupRestrictionStatusByGroupId({ id, operationKey, groupId, }) {
276
- return this.getClientInstance()
277
- .request({
278
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
279
- method: "GET",
280
- pathParams: {
281
- id,
282
- operationKey,
283
- groupId,
284
- },
285
- })
286
- .then(commonHttpClient.discardResult);
287
- }
288
- /**
289
- * Returns the restrictions on a piece of content.
290
- *
291
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
292
- * Permission to view the content.
293
- *
294
- * @returns Returned if the requested restrictions are returned.
295
- * @path {GET} /wiki/rest/api/content/{id}/restriction
296
- * @scopes-current read:confluence-content.all
297
- * @scopes-beta read:content-details:confluence
298
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-get
299
- */
300
- getRestrictions({ id, expand, start, limit, }) {
301
- return this.getClientInstance()
302
- .request({
303
- path: "/wiki/rest/api/content/{id}/restriction",
304
- method: "GET",
305
- pathParams: {
306
- id,
307
- },
308
- query: {
309
- expand,
310
- start,
311
- limit,
312
- },
313
- })
314
- .then(this.getClientInstance().responseHandler({
315
- 200: {
316
- "application/json": "json",
317
- },
318
- }))
319
- .then(commonHttpClient.castResponse())
320
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictions.response"))
321
- .then(commonHttpClient.getBody);
322
- }
323
- /**
324
- * Returns restrictions on a piece of content by operation. This method is
325
- * similar to [Get restrictions](#api-content-id-restriction-get) except that
326
- * the operations are properties of the return object, rather than items in
327
- * a results array.
328
- *
329
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
330
- * Permission to view the content.
331
- *
332
- * @returns Returned if the requested restrictions are returned.
333
- * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation
334
- * @scopes-current read:confluence-content.all
335
- * @scopes-beta read:content-details:confluence
336
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-get
337
- */
338
- getRestrictionsByOperation({ id, expand, }) {
339
- return this.getClientInstance()
340
- .request({
341
- path: "/wiki/rest/api/content/{id}/restriction/byOperation",
342
- method: "GET",
343
- pathParams: {
344
- id,
345
- },
346
- query: {
347
- expand,
348
- },
349
- })
350
- .then(this.getClientInstance().responseHandler({
351
- 200: {
352
- "application/json": "json",
353
- },
354
- }))
355
- .then(commonHttpClient.castResponse())
356
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictionsByOperation.response"))
357
- .then(commonHttpClient.getBody);
358
- }
359
- /**
360
- * Returns the restictions on a piece of content for a given operation (read
361
- * or update).
362
- *
363
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
364
- * Permission to view the content.
365
- *
366
- * @returns Returned if the requested restrictions are returned.
367
- * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}
368
- * @scopes-current read:confluence-content.all
369
- * @scopes-beta read:content-details:confluence
370
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-get
371
- */
372
- getRestrictionsForOperation({ id, operationKey, expand, start, limit, }) {
373
- return this.getClientInstance()
374
- .request({
375
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}",
376
- method: "GET",
377
- pathParams: {
378
- id,
379
- operationKey,
380
- },
381
- query: {
382
- expand,
383
- start,
384
- limit,
385
- },
386
- })
387
- .then(this.getClientInstance().responseHandler({
388
- 200: {
389
- "application/json": "json",
390
- },
391
- }))
392
- .then(commonHttpClient.castResponse())
393
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictionsForOperation.response"))
394
- .then(commonHttpClient.getBody);
395
- }
396
- /**
397
- * Removes a group from a content restriction. That is, remove read or update
398
- * permission for the group for a piece of content.
399
- *
400
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
401
- * Permission to edit the content.
402
- *
403
- * @path {DELETE}
404
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
405
- * @scopes-current write:confluence-content
406
- * @scopes-beta write:content.restriction:confluence
407
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-delete
408
- */
409
- removeGroupFromContentRestriction({ id, operationKey, groupId, }) {
410
- return this.getClientInstance()
411
- .request({
412
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
413
- method: "DELETE",
414
- pathParams: {
415
- id,
416
- operationKey,
417
- groupId,
418
- },
419
- })
420
- .then(commonHttpClient.discardResult);
421
- }
422
- /**
423
- * Deprecated, use [Remove group from content restriction by
424
- * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-delete).
425
- * Removes a group from a content restriction. That is, remove read or update
426
- * permission for the group for a piece of content.
427
- *
428
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
429
- * Permission to edit the content.
430
- *
431
- * @deprecated
432
- * @path {DELETE}
433
- * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
434
- * @scopes-current write:confluence-content
435
- * @scopes-beta write:content.restriction:confluence
436
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-delete
437
- */
438
- removeGroupFromContentRestrictionById({ id, operationKey, groupName, }) {
439
- return this.getClientInstance()
440
- .request({
441
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
442
- method: "DELETE",
443
- pathParams: {
444
- id,
445
- operationKey,
446
- groupName,
447
- },
448
- })
449
- .then(commonHttpClient.discardResult);
450
- }
451
- /**
452
- * Removes a group from a content restriction. That is, remove read or update
453
- * permission for the group for a piece of content.
454
- *
455
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
456
- * Permission to edit the content.
457
- *
458
- * @path {DELETE} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
459
- * @scopes-current write:confluence-content
460
- * @scopes-beta write:content.restriction:confluence
461
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-delete
462
- */
463
- removeUserFromContentRestriction({ id, operationKey, key, username, accountId, }) {
464
- return this.getClientInstance()
465
- .request({
466
- path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
467
- method: "DELETE",
468
- pathParams: {
469
- id,
470
- operationKey,
471
- },
472
- query: {
473
- key,
474
- username,
475
- accountId,
476
- },
477
- })
478
- .then(commonHttpClient.discardResult);
479
- }
480
- /**
481
- * Updates restrictions for a piece of content. This removes the existing
482
- * restrictions and replaces them with the restrictions in the request.
483
- *
484
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
485
- * Permission to edit the content.
486
- *
487
- * @returns Returned if the requested restrictions are updated.
488
- * @path {PUT} /wiki/rest/api/content/{id}/restriction
489
- * @scopes-current write:confluence-content
490
- * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
491
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-put
492
- */
493
- updateRestrictions({ id, expand, contentRestrictionAddOrUpdateArray, }) {
494
- return this.getClientInstance()
495
- .request({
496
- path: "/wiki/rest/api/content/{id}/restriction",
497
- method: "PUT",
498
- pathParams: {
499
- id,
500
- },
501
- query: {
502
- expand,
503
- },
504
- headers: {
505
- "Content-Type": "application/json",
506
- },
507
- body: contentRestrictionAddOrUpdateArray,
508
- })
509
- .then(this.getClientInstance().responseHandler({
510
- 200: {
511
- "application/json": "json",
512
- },
513
- }))
514
- .then(commonHttpClient.castResponse())
515
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.updateRestrictions.response"))
516
- .then(commonHttpClient.getBody);
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * Deprecated, use [Add group to content restriction via
19
+ * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-put).
20
+ * Adds a group to a content restriction. That is, grant read or update
21
+ * permission to the group for a piece of content.
22
+ *
23
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
24
+ * Permission to edit the content.
25
+ *
26
+ * @deprecated
27
+ * @path {PUT}
28
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
29
+ * @scopes-current write:confluence-content
30
+ * @scopes-beta write:content.restriction:confluence
31
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-put
32
+ */
33
+ this.addGroupToContentRestriction = ({ id, operationKey, groupName, }) => {
34
+ return this.getClientInstance()
35
+ .request({
36
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
37
+ method: "PUT",
38
+ pathParams: {
39
+ id,
40
+ operationKey,
41
+ groupName,
42
+ },
43
+ })
44
+ .then(commonHttpClient.discardResult);
45
+ };
46
+ /**
47
+ * Adds a group to a content restriction by Group Id. That is, grant read or update
48
+ * permission to the group for a piece of content.
49
+ *
50
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
51
+ * Permission to edit the content.
52
+ *
53
+ * @path {PUT}
54
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
55
+ * @scopes-current write:confluence-content
56
+ * @scopes-beta write:content.restriction:confluence
57
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-put
58
+ */
59
+ this.addGroupToContentRestrictionByGroupId = ({ id, operationKey, groupId, }) => {
60
+ return this.getClientInstance()
61
+ .request({
62
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
63
+ method: "PUT",
64
+ pathParams: {
65
+ id,
66
+ operationKey,
67
+ groupId,
68
+ },
69
+ })
70
+ .then(commonHttpClient.discardResult);
71
+ };
72
+ /**
73
+ * Adds restrictions to a piece of content. Note, this does not change any
74
+ * existing restrictions on the content.
75
+ *
76
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
77
+ * Permission to edit the content.
78
+ *
79
+ * @returns Returned if the requested restrictions are added.
80
+ * @path {POST} /wiki/rest/api/content/{id}/restriction
81
+ * @scopes-current write:confluence-content
82
+ * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
83
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-post
84
+ */
85
+ this.addRestrictions = ({ id, expand, contentRestrictionAddOrUpdateArray, }) => {
86
+ return this.getClientInstance()
87
+ .request({
88
+ path: "/wiki/rest/api/content/{id}/restriction",
89
+ method: "POST",
90
+ pathParams: {
91
+ id,
92
+ },
93
+ query: {
94
+ expand,
95
+ },
96
+ headers: {
97
+ "Content-Type": "application/json",
98
+ },
99
+ body: contentRestrictionAddOrUpdateArray,
100
+ })
101
+ .then(this.getClientInstance().responseHandler({
102
+ 200: {
103
+ "application/json": "json",
104
+ },
105
+ }))
106
+ .then(commonHttpClient.castResponse())
107
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.addRestrictions.response"))
108
+ .then(commonHttpClient.getBody);
109
+ };
110
+ /**
111
+ * Adds a user to a content restriction. That is, grant read or update
112
+ * permission to the user for a piece of content.
113
+ *
114
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
115
+ * Permission to edit the content.
116
+ *
117
+ * @path {PUT} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
118
+ * @scopes-current write:confluence-content
119
+ * @scopes-beta write:content.restriction:confluence
120
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-put
121
+ */
122
+ this.addUserToContentRestriction = ({ id, operationKey, key, username, accountId, }) => {
123
+ return this.getClientInstance()
124
+ .request({
125
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
126
+ method: "PUT",
127
+ pathParams: {
128
+ id,
129
+ operationKey,
130
+ },
131
+ query: {
132
+ key,
133
+ username,
134
+ accountId,
135
+ },
136
+ })
137
+ .then(commonHttpClient.discardResult);
138
+ };
139
+ /**
140
+ * Removes all restrictions (read and update) on a piece of content.
141
+ *
142
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
143
+ * Permission to edit the content.
144
+ *
145
+ * @returns Returned if the restrictions are removed.
146
+ * @path {DELETE} /wiki/rest/api/content/{id}/restriction
147
+ * @scopes-current write:confluence-content
148
+ * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
149
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-delete
150
+ */
151
+ this.deleteRestrictions = ({ id, expand, }) => {
152
+ return this.getClientInstance()
153
+ .request({
154
+ path: "/wiki/rest/api/content/{id}/restriction",
155
+ method: "DELETE",
156
+ pathParams: {
157
+ id,
158
+ },
159
+ query: {
160
+ expand,
161
+ },
162
+ })
163
+ .then(this.getClientInstance().responseHandler({
164
+ 200: {
165
+ "application/json": "json",
166
+ },
167
+ }))
168
+ .then(commonHttpClient.castResponse())
169
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.deleteRestrictions.response"))
170
+ .then(commonHttpClient.getBody);
171
+ };
172
+ /**
173
+ * Deprecated, use [Get content restriction status for group via
174
+ * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-get).
175
+ * Returns whether the specified content restriction applies to a group.
176
+ * For example, if a page with `id=123` has a `read` restriction for the `admins`
177
+ * group,
178
+ * the following request will return `true`:
179
+ *
180
+ * `/wiki/rest/api/content/123/restriction/byOperation/read/group/admins`
181
+ *
182
+ * Note that a response of `true` does not guarantee that the group can view the
183
+ * page, as it does not account for
184
+ * account-inherited restrictions, space permissions, or even product access. For
185
+ * more
186
+ * information, see [Confluence
187
+ * permissions](https://confluence.atlassian.com/x/_AozKw).
188
+ *
189
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
190
+ * Permission to view the content.
191
+ *
192
+ * @deprecated
193
+ * @path {GET}
194
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
195
+ * @scopes-current read:confluence-content.all
196
+ * @scopes-beta read:content.restriction:confluence
197
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-get
198
+ */
199
+ this.getContentRestrictionStatusForGroup = ({ id, operationKey, groupName, }) => {
200
+ return this.getClientInstance()
201
+ .request({
202
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
203
+ method: "GET",
204
+ pathParams: {
205
+ id,
206
+ operationKey,
207
+ groupName,
208
+ },
209
+ })
210
+ .then(commonHttpClient.discardResult);
211
+ };
212
+ /**
213
+ * Returns whether the specified content restriction applies to a user.
214
+ * For example, if a page with `id=123` has a `read` restriction for a user with
215
+ * an account ID of
216
+ * `384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192`, the following request will
217
+ * return `true`:
218
+ *
219
+ * `/wiki/rest/api/content/123/restriction/byOperation/read/user?accountId=384093:32b4d9w0-f6a5-3535-11a3-9c8c88d10192`
220
+ *
221
+ * Note that a response of `true` does not guarantee that the user can view the
222
+ * page, as it does not account for
223
+ * account-inherited restrictions, space permissions, or even product access. For
224
+ * more
225
+ * information, see [Confluence
226
+ * permissions](https://confluence.atlassian.com/x/_AozKw).
227
+ *
228
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
229
+ * Permission to view the content.
230
+ *
231
+ * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
232
+ * @scopes-current read:confluence-content.all
233
+ * @scopes-beta read:content.restriction:confluence
234
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-get
235
+ */
236
+ this.getContentRestrictionStatusForUser = ({ id, operationKey, key, username, accountId, }) => {
237
+ return this.getClientInstance()
238
+ .request({
239
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
240
+ method: "GET",
241
+ pathParams: {
242
+ id,
243
+ operationKey,
244
+ },
245
+ query: {
246
+ key,
247
+ username,
248
+ accountId,
249
+ },
250
+ })
251
+ .then(commonHttpClient.discardResult);
252
+ };
253
+ /**
254
+ * Returns whether the specified content restriction applies to a group.
255
+ * For example, if a page with `id=123` has a `read` restriction for the `123456`
256
+ * group id,
257
+ * the following request will return `true`:
258
+ *
259
+ * `/wiki/rest/api/content/123/restriction/byOperation/read/byGroupId/123456`
260
+ *
261
+ * Note that a response of `true` does not guarantee that the group can view the
262
+ * page, as it does not account for
263
+ * account-inherited restrictions, space permissions, or even product access. For
264
+ * more
265
+ * information, see [Confluence
266
+ * permissions](https://confluence.atlassian.com/x/_AozKw).
267
+ *
268
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
269
+ * Permission to view the content.
270
+ *
271
+ * @path {GET}
272
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
273
+ * @scopes-current read:confluence-content.all
274
+ * @scopes-beta read:content.restriction:confluence
275
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-get
276
+ */
277
+ this.getIndividualGroupRestrictionStatusByGroupId = ({ id, operationKey, groupId, }) => {
278
+ return this.getClientInstance()
279
+ .request({
280
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
281
+ method: "GET",
282
+ pathParams: {
283
+ id,
284
+ operationKey,
285
+ groupId,
286
+ },
287
+ })
288
+ .then(commonHttpClient.discardResult);
289
+ };
290
+ /**
291
+ * Returns the restrictions on a piece of content.
292
+ *
293
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
294
+ * Permission to view the content.
295
+ *
296
+ * @returns Returned if the requested restrictions are returned.
297
+ * @path {GET} /wiki/rest/api/content/{id}/restriction
298
+ * @scopes-current read:confluence-content.all
299
+ * @scopes-beta read:content-details:confluence
300
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-get
301
+ */
302
+ this.getRestrictions = ({ id, expand, start, limit, }) => {
303
+ return this.getClientInstance()
304
+ .request({
305
+ path: "/wiki/rest/api/content/{id}/restriction",
306
+ method: "GET",
307
+ pathParams: {
308
+ id,
309
+ },
310
+ query: {
311
+ expand,
312
+ start,
313
+ limit,
314
+ },
315
+ })
316
+ .then(this.getClientInstance().responseHandler({
317
+ 200: {
318
+ "application/json": "json",
319
+ },
320
+ }))
321
+ .then(commonHttpClient.castResponse())
322
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictions.response"))
323
+ .then(commonHttpClient.getBody);
324
+ };
325
+ /**
326
+ * Returns restrictions on a piece of content by operation. This method is
327
+ * similar to [Get restrictions](#api-content-id-restriction-get) except that
328
+ * the operations are properties of the return object, rather than items in
329
+ * a results array.
330
+ *
331
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
332
+ * Permission to view the content.
333
+ *
334
+ * @returns Returned if the requested restrictions are returned.
335
+ * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation
336
+ * @scopes-current read:confluence-content.all
337
+ * @scopes-beta read:content-details:confluence
338
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-get
339
+ */
340
+ this.getRestrictionsByOperation = ({ id, expand, }) => {
341
+ return this.getClientInstance()
342
+ .request({
343
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation",
344
+ method: "GET",
345
+ pathParams: {
346
+ id,
347
+ },
348
+ query: {
349
+ expand,
350
+ },
351
+ })
352
+ .then(this.getClientInstance().responseHandler({
353
+ 200: {
354
+ "application/json": "json",
355
+ },
356
+ }))
357
+ .then(commonHttpClient.castResponse())
358
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictionsByOperation.response"))
359
+ .then(commonHttpClient.getBody);
360
+ };
361
+ /**
362
+ * Returns the restictions on a piece of content for a given operation (read
363
+ * or update).
364
+ *
365
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
366
+ * Permission to view the content.
367
+ *
368
+ * @returns Returned if the requested restrictions are returned.
369
+ * @path {GET} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}
370
+ * @scopes-current read:confluence-content.all
371
+ * @scopes-beta read:content-details:confluence
372
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-get
373
+ */
374
+ this.getRestrictionsForOperation = ({ id, operationKey, expand, start, limit, }) => {
375
+ return this.getClientInstance()
376
+ .request({
377
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}",
378
+ method: "GET",
379
+ pathParams: {
380
+ id,
381
+ operationKey,
382
+ },
383
+ query: {
384
+ expand,
385
+ start,
386
+ limit,
387
+ },
388
+ })
389
+ .then(this.getClientInstance().responseHandler({
390
+ 200: {
391
+ "application/json": "json",
392
+ },
393
+ }))
394
+ .then(commonHttpClient.castResponse())
395
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.getRestrictionsForOperation.response"))
396
+ .then(commonHttpClient.getBody);
397
+ };
398
+ /**
399
+ * Removes a group from a content restriction. That is, remove read or update
400
+ * permission for the group for a piece of content.
401
+ *
402
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
403
+ * Permission to edit the content.
404
+ *
405
+ * @path {DELETE}
406
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}
407
+ * @scopes-current write:confluence-content
408
+ * @scopes-beta write:content.restriction:confluence
409
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-bygroupid-groupid-delete
410
+ */
411
+ this.removeGroupFromContentRestriction = ({ id, operationKey, groupId, }) => {
412
+ return this.getClientInstance()
413
+ .request({
414
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/byGroupId/{groupId}",
415
+ method: "DELETE",
416
+ pathParams: {
417
+ id,
418
+ operationKey,
419
+ groupId,
420
+ },
421
+ })
422
+ .then(commonHttpClient.discardResult);
423
+ };
424
+ /**
425
+ * Deprecated, use [Remove group from content restriction by
426
+ * groupId](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-delete).
427
+ * Removes a group from a content restriction. That is, remove read or update
428
+ * permission for the group for a piece of content.
429
+ *
430
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
431
+ * Permission to edit the content.
432
+ *
433
+ * @deprecated
434
+ * @path {DELETE}
435
+ * /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}
436
+ * @scopes-current write:confluence-content
437
+ * @scopes-beta write:content.restriction:confluence
438
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-group-groupname-delete
439
+ */
440
+ this.removeGroupFromContentRestrictionById = ({ id, operationKey, groupName, }) => {
441
+ return this.getClientInstance()
442
+ .request({
443
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/group/{groupName}",
444
+ method: "DELETE",
445
+ pathParams: {
446
+ id,
447
+ operationKey,
448
+ groupName,
449
+ },
450
+ })
451
+ .then(commonHttpClient.discardResult);
452
+ };
453
+ /**
454
+ * Removes a group from a content restriction. That is, remove read or update
455
+ * permission for the group for a piece of content.
456
+ *
457
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
458
+ * Permission to edit the content.
459
+ *
460
+ * @path {DELETE} /wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user
461
+ * @scopes-current write:confluence-content
462
+ * @scopes-beta write:content.restriction:confluence
463
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-byoperation-operationkey-user-delete
464
+ */
465
+ this.removeUserFromContentRestriction = ({ id, operationKey, key, username, accountId, }) => {
466
+ return this.getClientInstance()
467
+ .request({
468
+ path: "/wiki/rest/api/content/{id}/restriction/byOperation/{operationKey}/user",
469
+ method: "DELETE",
470
+ pathParams: {
471
+ id,
472
+ operationKey,
473
+ },
474
+ query: {
475
+ key,
476
+ username,
477
+ accountId,
478
+ },
479
+ })
480
+ .then(commonHttpClient.discardResult);
481
+ };
482
+ /**
483
+ * Updates restrictions for a piece of content. This removes the existing
484
+ * restrictions and replaces them with the restrictions in the request.
485
+ *
486
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
487
+ * Permission to edit the content.
488
+ *
489
+ * @returns Returned if the requested restrictions are updated.
490
+ * @path {PUT} /wiki/rest/api/content/{id}/restriction
491
+ * @scopes-current write:confluence-content
492
+ * @scopes-beta read:content-details:confluence, write:content.restriction:confluence
493
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions#api-wiki-rest-api-content-id-restriction-put
494
+ */
495
+ this.updateRestrictions = ({ id, expand, contentRestrictionAddOrUpdateArray, }) => {
496
+ return this.getClientInstance()
497
+ .request({
498
+ path: "/wiki/rest/api/content/{id}/restriction",
499
+ method: "PUT",
500
+ pathParams: {
501
+ id,
502
+ },
503
+ query: {
504
+ expand,
505
+ },
506
+ headers: {
507
+ "Content-Type": "application/json",
508
+ },
509
+ body: contentRestrictionAddOrUpdateArray,
510
+ })
511
+ .then(this.getClientInstance().responseHandler({
512
+ 200: {
513
+ "application/json": "json",
514
+ },
515
+ }))
516
+ .then(commonHttpClient.castResponse())
517
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentRestrictionsService.updateRestrictions.response"))
518
+ .then(commonHttpClient.getBody);
519
+ };
517
520
  }
518
521
  static initialize() {
519
522
  validationSchemaStorage_1.validationSchemaStorage.registerExtensible("ContentRestrictionsService.getRestrictions.response", zod_1.z