Skip to content

Commit a09439f

Browse files
committed
fix: return type for some sdks
1 parent 38f20eb commit a09439f

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

appwrite/services/avatars.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Avatars(Service):
1010
def __init__(self, client) -> None:
1111
super(Avatars, self).__init__(client)
1212

13-
def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]:
13+
def get_browser(self, code: Browser, width: float = None, height: float = None, quality: float = None) -> str:
1414
"""
1515
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.
1616
@@ -29,8 +29,8 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,
2929
3030
Returns
3131
-------
32-
Dict[str, Any]
33-
API response as a dictionary
32+
str
33+
Response as a string
3434
3535
Raises
3636
------
@@ -53,7 +53,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,
5353
'content-type': 'application/json',
5454
}, api_params)
5555

56-
def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]:
56+
def get_credit_card(self, code: CreditCard, width: float = None, height: float = None, quality: float = None) -> str:
5757
"""
5858
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.
5959
@@ -73,8 +73,8 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
7373
7474
Returns
7575
-------
76-
Dict[str, Any]
77-
API response as a dictionary
76+
str
77+
Response as a string
7878
7979
Raises
8080
------
@@ -97,7 +97,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
9797
'content-type': 'application/json',
9898
}, api_params)
9999

100-
def get_favicon(self, url: str) -> Dict[str, Any]:
100+
def get_favicon(self, url: str) -> str:
101101
"""
102102
Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
103103
@@ -110,8 +110,8 @@ def get_favicon(self, url: str) -> Dict[str, Any]:
110110
111111
Returns
112112
-------
113-
Dict[str, Any]
114-
API response as a dictionary
113+
str
114+
Response as a string
115115
116116
Raises
117117
------
@@ -131,7 +131,7 @@ def get_favicon(self, url: str) -> Dict[str, Any]:
131131
'content-type': 'application/json',
132132
}, api_params)
133133

134-
def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> Dict[str, Any]:
134+
def get_flag(self, code: Flag, width: float = None, height: float = None, quality: float = None) -> str:
135135
"""
136136
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.
137137
@@ -151,8 +151,8 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
151151
152152
Returns
153153
-------
154-
Dict[str, Any]
155-
API response as a dictionary
154+
str
155+
Response as a string
156156
157157
Raises
158158
------
@@ -175,7 +175,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
175175
'content-type': 'application/json',
176176
}, api_params)
177177

178-
def get_image(self, url: str, width: float = None, height: float = None) -> Dict[str, Any]:
178+
def get_image(self, url: str, width: float = None, height: float = None) -> str:
179179
"""
180180
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.
181181
@@ -194,8 +194,8 @@ def get_image(self, url: str, width: float = None, height: float = None) -> Dict
194194
195195
Returns
196196
-------
197-
Dict[str, Any]
198-
API response as a dictionary
197+
str
198+
Response as a string
199199
200200
Raises
201201
------
@@ -217,7 +217,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> Dict
217217
'content-type': 'application/json',
218218
}, api_params)
219219

220-
def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> Dict[str, Any]:
220+
def get_initials(self, name: str = None, width: float = None, height: float = None, background: str = None) -> str:
221221
"""
222222
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.
223223
@@ -239,8 +239,8 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
239239
240240
Returns
241241
-------
242-
Dict[str, Any]
243-
API response as a dictionary
242+
str
243+
Response as a string
244244
245245
Raises
246246
------
@@ -260,7 +260,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
260260
'content-type': 'application/json',
261261
}, api_params)
262262

263-
def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> Dict[str, Any]:
263+
def get_qr(self, text: str, size: float = None, margin: float = None, download: bool = None) -> str:
264264
"""
265265
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.
266266
@@ -278,8 +278,8 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download:
278278
279279
Returns
280280
-------
281-
Dict[str, Any]
282-
API response as a dictionary
281+
str
282+
Response as a string
283283
284284
Raises
285285
------

appwrite/services/functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def update_deployment_build(self, function_id: str, deployment_id: str) -> Dict[
630630
'content-type': 'application/json',
631631
}, api_params)
632632

633-
def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[str, Any]:
633+
def get_deployment_download(self, function_id: str, deployment_id: str) -> str:
634634
"""
635635
Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.
636636
@@ -643,8 +643,8 @@ def get_deployment_download(self, function_id: str, deployment_id: str) -> Dict[
643643
644644
Returns
645645
-------
646-
Dict[str, Any]
647-
API response as a dictionary
646+
str
647+
Response as a string
648648
649649
Raises
650650
------

appwrite/services/storage.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def delete_file(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
451451
'content-type': 'application/json',
452452
}, api_params)
453453

454-
def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
454+
def get_file_download(self, bucket_id: str, file_id: str) -> str:
455455
"""
456456
Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
457457
@@ -464,8 +464,8 @@ def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
464464
465465
Returns
466466
-------
467-
Dict[str, Any]
468-
API response as a dictionary
467+
str
468+
Response as a string
469469
470470
Raises
471471
------
@@ -489,7 +489,7 @@ def get_file_download(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
489489
'content-type': 'application/json',
490490
}, api_params)
491491

492-
def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> Dict[str, Any]:
492+
def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, height: float = None, gravity: ImageGravity = None, quality: float = None, border_width: float = None, border_color: str = None, border_radius: float = None, opacity: float = None, rotation: float = None, background: str = None, output: ImageFormat = None) -> str:
493493
"""
494494
Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.
495495
@@ -524,8 +524,8 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he
524524
525525
Returns
526526
-------
527-
Dict[str, Any]
528-
API response as a dictionary
527+
str
528+
Response as a string
529529
530530
Raises
531531
------
@@ -560,7 +560,7 @@ def get_file_preview(self, bucket_id: str, file_id: str, width: float = None, he
560560
'content-type': 'application/json',
561561
}, api_params)
562562

563-
def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
563+
def get_file_view(self, bucket_id: str, file_id: str) -> str:
564564
"""
565565
Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.
566566
@@ -573,8 +573,8 @@ def get_file_view(self, bucket_id: str, file_id: str) -> Dict[str, Any]:
573573
574574
Returns
575575
-------
576-
Dict[str, Any]
577-
API response as a dictionary
576+
str
577+
Response as a string
578578
579579
Raises
580580
------

0 commit comments

Comments
 (0)