Skip to content

Commit 1ce73fd

Browse files
committed
add synchronous protocol parent class
1 parent b2a5840 commit 1ce73fd

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

synapseclient/models/wiki.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@
2626
from synapseclient.core.async_utils import async_to_sync, otel_trace_method
2727
from synapseclient.core.upload.upload_functions_async import upload_file_handle
2828
from synapseclient.core.utils import delete_none_keys
29+
from synapseclient.models.protocols.wikipage_protocol import (
30+
WikiHeaderSynchronousProtocol,
31+
WikiHistorySnapshotSynchronousProtocol,
32+
WikiOrderHintSynchronousProtocol,
33+
WikiPageSynchronousProtocol,
34+
)
2935

3036

3137
@dataclass
3238
@async_to_sync
33-
class WikiOrderHint:
39+
class WikiOrderHint(WikiOrderHintSynchronousProtocol):
3440
"""
3541
A WikiOrderHint contains the order hint for the root wiki that corresponds to the given owner ID and type.
3642
@@ -130,14 +136,14 @@ async def update_async(
130136

131137
@dataclass
132138
@async_to_sync
133-
class WikiHistorySnapshot:
139+
class WikiHistorySnapshot(WikiHistorySnapshotSynchronousProtocol):
134140
"""
135141
A WikiHistorySnapshot contains basic information about an update to a WikiPage.
136142
137143
Attributes:
138144
version: The version number of the wiki page.
139145
modified_on: The timestamp when this version was created.
140-
modified_by: The ID of the user that created this version.
146+
modified_by: The ID of the user that created this version.
141147
"""
142148

143149
version: Optional[str] = None
@@ -210,7 +216,7 @@ async def get_async(
210216

211217
@dataclass
212218
@async_to_sync
213-
class WikiHeader:
219+
class WikiHeader(WikiHeaderSynchronousProtocol):
214220
"""
215221
A WikiHeader contains basic metadata about a WikiPage.
216222
@@ -285,7 +291,7 @@ async def get_async(
285291

286292
@dataclass
287293
@async_to_sync
288-
class WikiPage:
294+
class WikiPage(WikiPageSynchronousProtocol):
289295
"""
290296
Represents a [Wiki Page](https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/v2/wiki/V2WikiPage.html).
291297

0 commit comments

Comments
 (0)