Commit ab3adf6
authored
[Confluence] Add get_all_spaces and switch Cloud space methods to v2 plural endpoint (#1638)
* [Confluence] Add get_all_spaces and switch Cloud space methods to v2 plural endpoint
Fixes #1560.
After commit 63e744f the legacy `get_all_spaces` was removed entirely from
the Cloud module — `Confluence("https://api.atlassian.com/ex/confluence/...")`
routes to the new `Cloud` class, which only has `get_spaces` (singular path).
Calling `c.get_all_spaces()` now raises AttributeError; users with OAuth/PAT
tokens routed through the API gateway lose the paginated enumeration they had
under the old v1 path.
Cloud's space methods also use the singular `space` path (e.g.
`self.get("space")`) while `api_root="wiki/api/v2"`, so the constructed URL
`/wiki/api/v2/space` doesn't match the documented v2 endpoint
`/wiki/api/v2/spaces` (plural — see
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/).
This change:
- Adds `Cloud.get_all_spaces()` returning a paginated generator over
`_get_paged("spaces")`, restoring the back-compat surface and using v2.
- Switches `get_spaces`, `get_space`, `create_space`, `update_space`,
`delete_space`, `get_space_content` from `space[/...]` to `spaces[/...]`.
- Updates the existing space mock-tests to assert the v2 plural path and
adds a pagination test for `get_all_spaces`.
The Server implementation is unchanged (still uses v1 `space` paths
correctly, since Server is not affected by gateway routing).
Signed-off-by: 1fanwang <1fannnw@gmail.com>
* [Confluence] Fix multi-line docstrings in cloud space methods to D213 (summary on second line)
Signed-off-by: 1fanwang <1fannnw@gmail.com>
---------
Signed-off-by: 1fanwang <1fannnw@gmail.com>1 parent 2fc67b7 commit ab3adf6
2 files changed
Lines changed: 56 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
75 | 92 | | |
76 | 93 | | |
77 | 94 | | |
78 | | - | |
| 95 | + | |
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | | - | |
| 99 | + | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
86 | | - | |
| 103 | + | |
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
90 | | - | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
94 | | - | |
| 111 | + | |
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
159 | 179 | | |
160 | 180 | | |
161 | | - | |
| 181 | + | |
162 | 182 | | |
163 | 183 | | |
164 | | - | |
| 184 | + | |
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
169 | | - | |
| 189 | + | |
170 | 190 | | |
171 | 191 | | |
172 | 192 | | |
173 | | - | |
| 193 | + | |
174 | 194 | | |
175 | 195 | | |
176 | 196 | | |
177 | 197 | | |
178 | | - | |
| 198 | + | |
179 | 199 | | |
180 | 200 | | |
181 | 201 | | |
182 | | - | |
| 202 | + | |
183 | 203 | | |
184 | 204 | | |
185 | 205 | | |
186 | 206 | | |
187 | | - | |
| 207 | + | |
188 | 208 | | |
189 | 209 | | |
190 | | - | |
| 210 | + | |
191 | 211 | | |
192 | 212 | | |
193 | 213 | | |
194 | 214 | | |
195 | | - | |
| 215 | + | |
196 | 216 | | |
197 | 217 | | |
198 | | - | |
| 218 | + | |
199 | 219 | | |
200 | 220 | | |
201 | 221 | | |
| |||
0 commit comments