Skip to content

Commit 9d923ff

Browse files
committed
remove redirect and reorganize args and kwargs
1 parent d8055d6 commit 9d923ff

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

synapseclient/api/wiki_service.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ async def post_wiki_page(
3939

4040
async def get_wiki_page(
4141
owner_id: str,
42-
*,
4342
wiki_id: Optional[str] = None,
4443
wiki_version: Optional[int] = None,
44+
*,
4545
synapse_client: Optional["Synapse"] = None,
4646
) -> Dict[str, Any]:
4747
"""Get a wiki page.
@@ -242,8 +242,8 @@ async def get_wiki_history(
242242
async def get_attachment_handles(
243243
owner_id: str,
244244
wiki_id: str,
245-
*,
246245
wiki_version: Optional[int] = None,
246+
*,
247247
synapse_client: Optional["Synapse"] = None,
248248
) -> List[Dict[str, Any]]:
249249
"""Get the file handles of all attachments on a wiki page.
@@ -279,9 +279,8 @@ async def get_attachment_url(
279279
owner_id: str,
280280
wiki_id: str,
281281
file_name: str,
282-
*,
283-
redirect: Optional[bool] = False,
284282
wiki_version: Optional[int] = None,
283+
*,
285284
synapse_client: Optional["Synapse"] = None,
286285
) -> Dict[str, Any]:
287286
"""Get the URL of a wiki page attachment.
@@ -292,7 +291,6 @@ async def get_attachment_url(
292291
wiki_id: The ID of the wiki.
293292
file_name: The name of the file to get.
294293
The file names can be found in the FileHandles from the GET /entity/{ownerId}/wiki/{wikiId}/attachmenthandles method.
295-
redirect: When set to false, the URL will be returned as text/plain instead of redirecting. Default is False.
296294
wiki_version: Optional version of the wiki page.
297295
synapse_client: If not passed in and caching was not disabled by
298296
`Synapse.allow_client_caching(False)` this will use the last created
@@ -305,13 +303,11 @@ async def get_attachment_url(
305303

306304
client = Synapse.get_client(synapse_client=synapse_client)
307305

308-
# Add version and redirect as a query parameter if provided
306+
# Add version as a query parameter if provided
309307
params = {}
310308
params["fileName"] = file_name
311309
if wiki_version is not None:
312310
params["wikiVersion"] = wiki_version
313-
if redirect is not None:
314-
params["redirect"] = redirect
315311

316312
return await client.rest_get_async(
317313
uri=f"/entity/{owner_id}/wiki2/{wiki_id}/attachment",
@@ -323,7 +319,6 @@ async def get_attachment_preview_url(
323319
owner_id: str,
324320
wiki_id: str,
325321
file_name: str,
326-
redirect: Optional[bool] = False,
327322
wiki_version: Optional[int] = None,
328323
*,
329324
synapse_client: Optional["Synapse"] = None,
@@ -336,7 +331,6 @@ async def get_attachment_preview_url(
336331
wiki_id: The ID of the wiki.
337332
file_name: The name of the file to get.
338333
The file names can be found in the FileHandles from the GET /entity/{ownerId}/wiki/{wikiId}/attachmenthandles method.
339-
redirect: When set to false, the URL will be returned as text/plain instead of redirecting. Default is False.
340334
wiki_version: Optional version of the wiki page.
341335
synapse_client: If not passed in and caching was not disabled by
342336
`Synapse.allow_client_caching(False)` this will use the last created
@@ -349,11 +343,9 @@ async def get_attachment_preview_url(
349343

350344
client = Synapse.get_client(synapse_client=synapse_client)
351345

352-
# Add version and redirect as a query parameter if provided
346+
# Add version as a query parameter if provided
353347
params = {}
354348
params["fileName"] = file_name
355-
if redirect is not None:
356-
params["redirect"] = redirect
357349
if wiki_version is not None:
358350
params["wikiVersion"] = wiki_version
359351

@@ -366,7 +358,6 @@ async def get_attachment_preview_url(
366358
async def get_markdown_url(
367359
owner_id: str,
368360
wiki_id: str,
369-
redirect: Optional[bool] = False,
370361
wiki_version: Optional[int] = None,
371362
*,
372363
synapse_client: Optional["Synapse"] = None,
@@ -377,7 +368,6 @@ async def get_markdown_url(
377368
Arguments:
378369
owner_id: The ID of the owner entity.
379370
wiki_id: The ID of the wiki.
380-
redirect: When set to false, the URL will be returned as text/plain instead of redirecting. Default is False.
381371
wiki_version: Optional version of the wiki page.
382372
synapse_client: If not passed in and caching was not disabled by
383373
`Synapse.allow_client_caching(False)` this will use the last created
@@ -390,10 +380,8 @@ async def get_markdown_url(
390380

391381
client = Synapse.get_client(synapse_client=synapse_client)
392382

393-
# Add version and redirect as a query parameter if provided
383+
# Add version as a query parameter if provided
394384
params = {}
395-
if redirect is not None:
396-
params["redirect"] = redirect
397385
if wiki_version is not None:
398386
params["wikiVersion"] = wiki_version
399387

0 commit comments

Comments
 (0)