Skip to content

Commit ccf8deb

Browse files
committed
chore: update Python SDK to 16.0.0
1 parent 3f0b4ce commit ccf8deb

File tree

16 files changed

+1546
-773
lines changed

16 files changed

+1546
-773
lines changed

appwrite/services/account.py

Lines changed: 170 additions & 85 deletions
Large diffs are not rendered by default.

appwrite/services/activities.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def __init__(self, client) -> None:
1212

1313
def list_events(
1414
self,
15-
queries: Optional[str] = None ) -> ActivityEventList:
15+
queries: Optional[str] = None
16+
) -> ActivityEventList:
1617
"""
1718
List all events for selected filters.
1819
@@ -23,7 +24,8 @@ def list_events(
2324
2425
Returns
2526
-------
26-
ActivityEventList API response as a typed Pydantic model
27+
ActivityEventList
28+
API response as a typed Pydantic model
2729
2830
Raises
2931
------
@@ -45,7 +47,8 @@ def list_events(
4547

4648
def get_event(
4749
self,
48-
event_id: str ) -> ActivityEvent:
50+
event_id: str
51+
) -> ActivityEvent:
4952
"""
5053
Get event by ID.
5154
@@ -57,7 +60,8 @@ def get_event(
5760
5861
Returns
5962
-------
60-
ActivityEvent API response as a typed Pydantic model
63+
ActivityEvent
64+
API response as a typed Pydantic model
6165
6266
Raises
6367
------

appwrite/services/avatars.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def get_browser(
2020
code: Browser,
2121
width: Optional[float] = None,
2222
height: Optional[float] = None,
23-
quality: Optional[float] = None ) -> bytes:
23+
quality: Optional[float] = None
24+
) -> bytes:
2425
"""
2526
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
2627
@@ -73,7 +74,8 @@ def get_credit_card(
7374
code: CreditCard,
7475
width: Optional[float] = None,
7576
height: Optional[float] = None,
76-
quality: Optional[float] = None ) -> bytes:
77+
quality: Optional[float] = None
78+
) -> bytes:
7779
"""
7880
The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
7981
@@ -124,7 +126,8 @@ def get_credit_card(
124126

125127
def get_favicon(
126128
self,
127-
url: str ) -> bytes:
129+
url: str
130+
) -> bytes:
128131
"""
129132
Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
130133
@@ -165,7 +168,8 @@ def get_flag(
165168
code: Flag,
166169
width: Optional[float] = None,
167170
height: Optional[float] = None,
168-
quality: Optional[float] = None ) -> bytes:
171+
quality: Optional[float] = None
172+
) -> bytes:
169173
"""
170174
You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
171175
@@ -218,7 +222,8 @@ def get_image(
218222
self,
219223
url: str,
220224
width: Optional[float] = None,
221-
height: Optional[float] = None ) -> bytes:
225+
height: Optional[float] = None
226+
) -> bytes:
222227
"""
223228
Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
224229
@@ -269,7 +274,8 @@ def get_initials(
269274
name: Optional[str] = None,
270275
width: Optional[float] = None,
271276
height: Optional[float] = None,
272-
background: Optional[str] = None ) -> bytes:
277+
background: Optional[str] = None
278+
) -> bytes:
273279
"""
274280
Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
275281
@@ -323,7 +329,8 @@ def get_qr(
323329
text: str,
324330
size: Optional[float] = None,
325331
margin: Optional[float] = None,
326-
download: Optional[bool] = None ) -> bytes:
332+
download: Optional[bool] = None
333+
) -> bytes:
327334
"""
328335
Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
329336
@@ -391,7 +398,8 @@ def get_screenshot(
391398
width: Optional[float] = None,
392399
height: Optional[float] = None,
393400
quality: Optional[float] = None,
394-
output: Optional[ImageFormat] = None ) -> bytes:
401+
output: Optional[ImageFormat] = None
402+
) -> bytes:
395403
"""
396404
Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
397405

appwrite/services/backups.py

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def __init__(self, client) -> None:
1717

1818
def list_archives(
1919
self,
20-
queries: Optional[List[str]] = None ) -> BackupArchiveList:
20+
queries: Optional[List[str]] = None
21+
) -> BackupArchiveList:
2122
"""
2223
List all archives for a project.
2324
@@ -28,7 +29,8 @@ def list_archives(
2829
2930
Returns
3031
-------
31-
BackupArchiveList API response as a typed Pydantic model
32+
BackupArchiveList
33+
API response as a typed Pydantic model
3234
3335
Raises
3436
------
@@ -51,7 +53,8 @@ def list_archives(
5153
def create_archive(
5254
self,
5355
services: List[BackupServices],
54-
resource_id: Optional[str] = None ) -> BackupArchive:
56+
resource_id: Optional[str] = None
57+
) -> BackupArchive:
5558
"""
5659
Create a new archive asynchronously for a project.
5760
@@ -64,7 +67,8 @@ def create_archive(
6467
6568
Returns
6669
-------
67-
BackupArchive API response as a typed Pydantic model
70+
BackupArchive
71+
API response as a typed Pydantic model
6872
6973
Raises
7074
------
@@ -90,7 +94,8 @@ def create_archive(
9094

9195
def get_archive(
9296
self,
93-
archive_id: str ) -> BackupArchive:
97+
archive_id: str
98+
) -> BackupArchive:
9499
"""
95100
Get a backup archive using it's ID.
96101
@@ -101,7 +106,8 @@ def get_archive(
101106
102107
Returns
103108
-------
104-
BackupArchive API response as a typed Pydantic model
109+
BackupArchive
110+
API response as a typed Pydantic model
105111
106112
Raises
107113
------
@@ -125,7 +131,8 @@ def get_archive(
125131

126132
def delete_archive(
127133
self,
128-
archive_id: str ) -> Dict[str, Any]:
134+
archive_id: str
135+
) -> Dict[str, Any]:
129136
"""
130137
Delete an existing archive for a project.
131138
@@ -162,7 +169,8 @@ def delete_archive(
162169

163170
def list_policies(
164171
self,
165-
queries: Optional[List[str]] = None ) -> BackupPolicyList:
172+
queries: Optional[List[str]] = None
173+
) -> BackupPolicyList:
166174
"""
167175
List all policies for a project.
168176
@@ -173,7 +181,8 @@ def list_policies(
173181
174182
Returns
175183
-------
176-
BackupPolicyList API response as a typed Pydantic model
184+
BackupPolicyList
185+
API response as a typed Pydantic model
177186
178187
Raises
179188
------
@@ -201,7 +210,8 @@ def create_policy(
201210
schedule: str,
202211
name: Optional[str] = None,
203212
resource_id: Optional[str] = None,
204-
enabled: Optional[bool] = None ) -> BackupPolicy:
213+
enabled: Optional[bool] = None
214+
) -> BackupPolicy:
205215
"""
206216
Create a new backup policy.
207217
@@ -224,7 +234,8 @@ def create_policy(
224234
225235
Returns
226236
-------
227-
BackupPolicy API response as a typed Pydantic model
237+
BackupPolicy
238+
API response as a typed Pydantic model
228239
229240
Raises
230241
------
@@ -266,7 +277,8 @@ def create_policy(
266277

267278
def get_policy(
268279
self,
269-
policy_id: str ) -> BackupPolicy:
280+
policy_id: str
281+
) -> BackupPolicy:
270282
"""
271283
Get a backup policy using it's ID.
272284
@@ -277,7 +289,8 @@ def get_policy(
277289
278290
Returns
279291
-------
280-
BackupPolicy API response as a typed Pydantic model
292+
BackupPolicy
293+
API response as a typed Pydantic model
281294
282295
Raises
283296
------
@@ -305,7 +318,8 @@ def update_policy(
305318
name: Optional[str] = None,
306319
retention: Optional[float] = None,
307320
schedule: Optional[str] = None,
308-
enabled: Optional[bool] = None ) -> BackupPolicy:
321+
enabled: Optional[bool] = None
322+
) -> BackupPolicy:
309323
"""
310324
Update an existing policy using it's ID.
311325
@@ -324,7 +338,8 @@ def update_policy(
324338
325339
Returns
326340
-------
327-
BackupPolicy API response as a typed Pydantic model
341+
BackupPolicy
342+
API response as a typed Pydantic model
328343
329344
Raises
330345
------
@@ -354,7 +369,8 @@ def update_policy(
354369

355370
def delete_policy(
356371
self,
357-
policy_id: str ) -> Dict[str, Any]:
372+
policy_id: str
373+
) -> Dict[str, Any]:
358374
"""
359375
Delete a policy using it's ID.
360376
@@ -394,7 +410,8 @@ def create_restoration(
394410
archive_id: str,
395411
services: List[BackupServices],
396412
new_resource_id: Optional[str] = None,
397-
new_resource_name: Optional[str] = None ) -> BackupRestoration:
413+
new_resource_name: Optional[str] = None
414+
) -> BackupRestoration:
398415
"""
399416
Create and trigger a new restoration for a backup on a project.
400417
@@ -411,7 +428,8 @@ def create_restoration(
411428
412429
Returns
413430
-------
414-
BackupRestoration API response as a typed Pydantic model
431+
BackupRestoration
432+
API response as a typed Pydantic model
415433
416434
Raises
417435
------
@@ -444,7 +462,8 @@ def create_restoration(
444462

445463
def list_restorations(
446464
self,
447-
queries: Optional[List[str]] = None ) -> BackupRestorationList:
465+
queries: Optional[List[str]] = None
466+
) -> BackupRestorationList:
448467
"""
449468
List all backup restorations for a project.
450469
@@ -455,7 +474,8 @@ def list_restorations(
455474
456475
Returns
457476
-------
458-
BackupRestorationList API response as a typed Pydantic model
477+
BackupRestorationList
478+
API response as a typed Pydantic model
459479
460480
Raises
461481
------
@@ -477,7 +497,8 @@ def list_restorations(
477497

478498
def get_restoration(
479499
self,
480-
restoration_id: str ) -> BackupRestoration:
500+
restoration_id: str
501+
) -> BackupRestoration:
481502
"""
482503
Get the current status of a backup restoration.
483504
@@ -488,7 +509,8 @@ def get_restoration(
488509
489510
Returns
490511
-------
491-
BackupRestoration API response as a typed Pydantic model
512+
BackupRestoration
513+
API response as a typed Pydantic model
492514
493515
Raises
494516
------

0 commit comments

Comments
 (0)