Skip to content

Commit f3b858e

Browse files
committed
chore: regenerate
1 parent fdc1588 commit f3b858e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3515
-82
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite Python SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-python.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).**
9+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-python/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Python SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

appwrite/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def __init__(self):
1414
self._endpoint = 'https://cloud.appwrite.io/v1'
1515
self._global_headers = {
1616
'content-type': '',
17-
'user-agent' : f'AppwritePythonSDK/11.1.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
17+
'user-agent' : f'AppwritePythonSDK/12.0.0 ({platform.uname().system}; {platform.uname().version}; {platform.uname().machine})',
1818
'x-sdk-name': 'Python',
1919
'x-sdk-platform': 'server',
2020
'x-sdk-language': 'python',
21-
'x-sdk-version': '11.1.0',
22-
'X-Appwrite-Response-Format' : '1.7.0',
21+
'x-sdk-version': '12.0.0',
22+
'X-Appwrite-Response-Format' : '1.8.0',
2323
}
2424

2525
def set_self_signed(self, status=True):

appwrite/services/account.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def create(self, user_id: str, email: str, password: str, name: str = None) -> D
3535
"""
3636
Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
3737
38+
3839
Parameters
3940
----------
4041
user_id : str
@@ -84,6 +85,7 @@ def update_email(self, email: str, password: str) -> Dict[str, Any]:
8485
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
8586
8687
88+
8789
Parameters
8890
----------
8991
email : str
@@ -122,6 +124,7 @@ def list_identities(self, queries: List[str] = None) -> Dict[str, Any]:
122124
"""
123125
Get the list of identities for the currently logged in user.
124126
127+
125128
Parameters
126129
----------
127130
queries : List[str]
@@ -150,6 +153,7 @@ def delete_identity(self, identity_id: str) -> Dict[str, Any]:
150153
"""
151154
Delete an identity by its unique ID.
152155
156+
153157
Parameters
154158
----------
155159
identity_id : str
@@ -204,6 +208,7 @@ def list_logs(self, queries: List[str] = None) -> Dict[str, Any]:
204208
"""
205209
Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
206210
211+
207212
Parameters
208213
----------
209214
queries : List[str]
@@ -232,6 +237,7 @@ def update_mfa(self, mfa: bool) -> Dict[str, Any]:
232237
"""
233238
Enable or disable MFA on an account.
234239
240+
235241
Parameters
236242
----------
237243
mfa : bool
@@ -264,6 +270,7 @@ def create_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
264270
"""
265271
Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
266272
273+
267274
Parameters
268275
----------
269276
type : AuthenticatorType
@@ -296,6 +303,7 @@ def update_mfa_authenticator(self, type: AuthenticatorType, otp: str) -> Dict[st
296303
"""
297304
Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
298305
306+
299307
Parameters
300308
----------
301309
type : AuthenticatorType
@@ -334,6 +342,7 @@ def delete_mfa_authenticator(self, type: AuthenticatorType) -> Dict[str, Any]:
334342
"""
335343
Delete an authenticator for a user by ID.
336344
345+
337346
Parameters
338347
----------
339348
type : AuthenticatorType
@@ -366,6 +375,7 @@ def create_mfa_challenge(self, factor: AuthenticationFactor) -> Dict[str, Any]:
366375
"""
367376
Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
368377
378+
369379
Parameters
370380
----------
371381
factor : AuthenticationFactor
@@ -398,6 +408,7 @@ def update_mfa_challenge(self, challenge_id: str, otp: str) -> Dict[str, Any]:
398408
"""
399409
Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
400410
411+
401412
Parameters
402413
----------
403414
challenge_id : str
@@ -522,6 +533,7 @@ def update_name(self, name: str) -> Dict[str, Any]:
522533
"""
523534
Update currently logged in user account name.
524535
536+
525537
Parameters
526538
----------
527539
name : str
@@ -554,6 +566,7 @@ def update_password(self, password: str, old_password: str = None) -> Dict[str,
554566
"""
555567
Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
556568
569+
557570
Parameters
558571
----------
559572
password : str
@@ -589,6 +602,7 @@ def update_phone(self, phone: str, password: str) -> Dict[str, Any]:
589602
"""
590603
Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
591604
605+
592606
Parameters
593607
----------
594608
phone : str
@@ -648,6 +662,7 @@ def update_prefs(self, prefs: dict) -> Dict[str, Any]:
648662
"""
649663
Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
650664
665+
651666
Parameters
652667
----------
653668
prefs : dict
@@ -680,6 +695,7 @@ def create_recovery(self, email: str, url: str) -> Dict[str, Any]:
680695
"""
681696
Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
682697
698+
683699
Parameters
684700
----------
685701
email : str
@@ -720,6 +736,7 @@ def update_recovery(self, user_id: str, secret: str, password: str) -> Dict[str,
720736
721737
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
722738
739+
723740
Parameters
724741
----------
725742
user_id : str
@@ -831,6 +848,7 @@ def create_email_password_session(self, email: str, password: str) -> Dict[str,
831848
832849
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
833850
851+
834852
Parameters
835853
----------
836854
email : str
@@ -869,6 +887,9 @@ def update_magic_url_session(self, user_id: str, secret: str) -> Dict[str, Any]:
869887
"""
870888
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
871889
890+
.. deprecated::
891+
This API has been deprecated.
892+
872893
Parameters
873894
----------
874895
user_id : str
@@ -907,6 +928,9 @@ def update_phone_session(self, user_id: str, secret: str) -> Dict[str, Any]:
907928
"""
908929
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
909930
931+
.. deprecated::
932+
This API has been deprecated.
933+
910934
Parameters
911935
----------
912936
user_id : str
@@ -945,6 +969,7 @@ def create_session(self, user_id: str, secret: str) -> Dict[str, Any]:
945969
"""
946970
Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
947971
972+
948973
Parameters
949974
----------
950975
user_id : str
@@ -983,6 +1008,7 @@ def get_session(self, session_id: str) -> Dict[str, Any]:
9831008
"""
9841009
Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
9851010
1011+
9861012
Parameters
9871013
----------
9881014
session_id : str
@@ -1014,6 +1040,7 @@ def update_session(self, session_id: str) -> Dict[str, Any]:
10141040
"""
10151041
Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
10161042
1043+
10171044
Parameters
10181045
----------
10191046
session_id : str
@@ -1046,6 +1073,7 @@ def delete_session(self, session_id: str) -> Dict[str, Any]:
10461073
"""
10471074
Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
10481075
1076+
10491077
Parameters
10501078
----------
10511079
session_id : str
@@ -1102,6 +1130,7 @@ def create_email_token(self, user_id: str, email: str, phrase: bool = None) -> D
11021130
11031131
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11041132
1133+
11051134
Parameters
11061135
----------
11071136
user_id : str
@@ -1146,6 +1175,7 @@ def create_magic_url_token(self, user_id: str, email: str, url: str = None, phra
11461175
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11471176
11481177
1178+
11491179
Parameters
11501180
----------
11511181
user_id : str
@@ -1194,6 +1224,7 @@ def create_o_auth2_token(self, provider: OAuthProvider, success: str = None, fai
11941224
11951225
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
11961226
1227+
11971228
Parameters
11981229
----------
11991230
provider : OAuthProvider
@@ -1236,6 +1267,7 @@ def create_phone_token(self, user_id: str, phone: str) -> Dict[str, Any]:
12361267
12371268
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
12381269
1270+
12391271
Parameters
12401272
----------
12411273
user_id : str
@@ -1277,6 +1309,7 @@ def create_verification(self, url: str) -> Dict[str, Any]:
12771309
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
12781310
12791311
1312+
12801313
Parameters
12811314
----------
12821315
url : str
@@ -1309,6 +1342,7 @@ def update_verification(self, user_id: str, secret: str) -> Dict[str, Any]:
13091342
"""
13101343
Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
13111344
1345+
13121346
Parameters
13131347
----------
13141348
user_id : str
@@ -1369,6 +1403,7 @@ def update_phone_verification(self, user_id: str, secret: str) -> Dict[str, Any]
13691403
"""
13701404
Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
13711405
1406+
13721407
Parameters
13731408
----------
13741409
user_id : str

appwrite/services/avatars.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def get_browser(self, code: Browser, width: float = None, height: float = None,
1616
1717
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
1818
19+
1920
Parameters
2021
----------
2122
code : Browser
@@ -59,6 +60,7 @@ def get_credit_card(self, code: CreditCard, width: float = None, height: float =
5960
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
6061
6162
63+
6264
Parameters
6365
----------
6466
code : CreditCard
@@ -101,6 +103,7 @@ def get_favicon(self, url: str) -> bytes:
101103
102104
This endpoint does not follow HTTP redirects.
103105
106+
104107
Parameters
105108
----------
106109
url : str
@@ -135,6 +138,7 @@ def get_flag(self, code: Flag, width: float = None, height: float = None, qualit
135138
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
136139
137140
141+
138142
Parameters
139143
----------
140144
code : Flag
@@ -179,6 +183,7 @@ def get_image(self, url: str, width: float = None, height: float = None) -> byte
179183
180184
This endpoint does not follow HTTP redirects.
181185
186+
182187
Parameters
183188
----------
184189
url : str
@@ -221,6 +226,7 @@ def get_initials(self, name: str = None, width: float = None, height: float = No
221226
When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
222227
223228
229+
224230
Parameters
225231
----------
226232
name : str
@@ -259,6 +265,7 @@ def get_qr(self, text: str, size: float = None, margin: float = None, download:
259265
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.
260266
261267
268+
262269
Parameters
263270
----------
264271
text : str

0 commit comments

Comments
 (0)