Skip to content

Commit 97ff4ec

Browse files
committed
chore: update Python SDK to 16.0.0
1 parent b3f0015 commit 97ff4ec

File tree

369 files changed

+1449
-368
lines changed

Some content is hidden

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

369 files changed

+1449
-368
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Added `ValueClassEncoder` support for serializing `AppwriteModel` instances
1212
* Added `pyproject.toml` for modern Python packaging
1313
* Updated README with `uv add appwrite` installation example
14+
* Updated all doc examples to use typed response models (e.g., `result: TemplateFunctionList = functions.list_templates(...)`)
1415

1516
## 15.2.0
1617

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Session
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,5 +10,7 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_anonymous_session()
13+
result: Session = account.create_anonymous_session()
14+
15+
print(result.model_dump())
1316
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Session
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,8 +10,10 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_email_password_session(
13+
result: Session = account.create_email_password_session(
1314
email = 'email@example.com',
1415
password = 'password'
1516
)
17+
18+
print(result.model_dump())
1619
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Token
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,9 +10,11 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_email_token(
13+
result: Token = account.create_email_token(
1314
user_id = '<USER_ID>',
1415
email = 'email@example.com',
1516
phrase = False # optional
1617
)
18+
19+
print(result.model_dump())
1720
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Token
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,7 +10,9 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_email_verification(
13+
result: Token = account.create_email_verification(
1314
url = 'https://example.com'
1415
)
16+
17+
print(result.model_dump())
1518
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Jwt
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,7 +10,9 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_jwt(
13+
result: Jwt = account.create_jwt(
1314
duration = 0 # optional
1415
)
16+
17+
print(result.model_dump())
1518
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import Token
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,10 +10,12 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_magic_url_token(
13+
result: Token = account.create_magic_url_token(
1314
user_id = '<USER_ID>',
1415
email = 'email@example.com',
1516
url = 'https://example.com', # optional
1617
phrase = False # optional
1718
)
19+
20+
print(result.model_dump())
1821
```

docs/examples/account/create-mfa-authenticator.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import MfaType
45
from appwrite.enums import AuthenticatorType
56

67
client = Client()
@@ -10,7 +11,9 @@ client.set_session('') # The user session to authenticate with
1011

1112
account = Account(client)
1213

13-
result = account.create_mfa_authenticator(
14+
result: MfaType = account.create_mfa_authenticator(
1415
type = AuthenticatorType.TOTP
1516
)
17+
18+
print(result.model_dump())
1619
```

docs/examples/account/create-mfa-challenge.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import MfaChallenge
45
from appwrite.enums import AuthenticationFactor
56

67
client = Client()
@@ -10,7 +11,9 @@ client.set_session('') # The user session to authenticate with
1011

1112
account = Account(client)
1213

13-
result = account.create_mfa_challenge(
14+
result: MfaChallenge = account.create_mfa_challenge(
1415
factor = AuthenticationFactor.EMAIL
1516
)
17+
18+
print(result.model_dump())
1619
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python
22
from appwrite.client import Client
33
from appwrite.services.account import Account
4+
from appwrite.models import MfaRecoveryCodes
45

56
client = Client()
67
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -9,5 +10,7 @@ client.set_session('') # The user session to authenticate with
910

1011
account = Account(client)
1112

12-
result = account.create_mfa_recovery_codes()
13+
result: MfaRecoveryCodes = account.create_mfa_recovery_codes()
14+
15+
print(result.model_dump())
1316
```

0 commit comments

Comments
 (0)