Skip to content

Commit 2424ff3

Browse files
committed
feat: update Python SDK to 16.0.0
* No user-facing SDK changes
1 parent aa01904 commit 2424ff3

File tree

119 files changed

+6307
-54
lines changed

Some content is hidden

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

119 files changed

+6307
-54
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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.8.1-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.9.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)

appwrite/client.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self):
2020
'x-sdk-platform': 'server',
2121
'x-sdk-language': 'python',
2222
'x-sdk-version': '16.0.0',
23-
'X-Appwrite-Response-Format' : '1.8.0',
23+
'X-Appwrite-Response-Format' : '1.9.0',
2424
}
2525

2626
def set_self_signed(self, status=True):
@@ -72,6 +72,24 @@ def set_forwarded_user_agent(self, value):
7272
self._global_headers['x-forwarded-user-agent'] = value
7373
return self
7474

75+
def set_impersonate_user_id(self, value):
76+
"""Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data."""
77+
78+
self._global_headers['x-appwrite-impersonate-user-id'] = value
79+
return self
80+
81+
def set_impersonate_user_email(self, value):
82+
"""Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data."""
83+
84+
self._global_headers['x-appwrite-impersonate-user-email'] = value
85+
return self
86+
87+
def set_impersonate_user_phone(self, value):
88+
"""Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data."""
89+
90+
self._global_headers['x-appwrite-impersonate-user-phone'] = value
91+
return self
92+
7593
def call(self, method, path='', headers=None, params=None, response_type='json'):
7694
if headers is None:
7795
headers = {}

appwrite/encoders/value_class_encoder.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
from ..enums.backup_services import BackupServices
1414
from ..enums.relationship_type import RelationshipType
1515
from ..enums.relation_mutate import RelationMutate
16-
from ..enums.index_type import IndexType
16+
from ..enums.databases_index_type import DatabasesIndexType
1717
from ..enums.order_by import OrderBy
18+
from ..enums.documents_db_index_type import DocumentsDBIndexType
1819
from ..enums.runtime import Runtime
1920
from ..enums.scopes import Scopes
2021
from ..enums.template_reference_type import TemplateReferenceType
@@ -29,8 +30,11 @@
2930
from ..enums.adapter import Adapter
3031
from ..enums.compression import Compression
3132
from ..enums.image_gravity import ImageGravity
33+
from ..enums.tables_db_index_type import TablesDBIndexType
3234
from ..enums.password_hash import PasswordHash
3335
from ..enums.messaging_provider_type import MessagingProviderType
36+
from ..enums.model import Model
37+
from ..enums.vectors_db_index_type import VectorsDBIndexType
3438
from ..enums.database_type import DatabaseType
3539
from ..enums.attribute_status import AttributeStatus
3640
from ..enums.column_status import ColumnStatus
@@ -86,12 +90,15 @@ def default(self, o):
8690
if isinstance(o, RelationMutate):
8791
return o.value
8892

89-
if isinstance(o, IndexType):
93+
if isinstance(o, DatabasesIndexType):
9094
return o.value
9195

9296
if isinstance(o, OrderBy):
9397
return o.value
9498

99+
if isinstance(o, DocumentsDBIndexType):
100+
return o.value
101+
95102
if isinstance(o, Runtime):
96103
return o.value
97104

@@ -134,12 +141,21 @@ def default(self, o):
134141
if isinstance(o, ImageGravity):
135142
return o.value
136143

144+
if isinstance(o, TablesDBIndexType):
145+
return o.value
146+
137147
if isinstance(o, PasswordHash):
138148
return o.value
139149

140150
if isinstance(o, MessagingProviderType):
141151
return o.value
142152

153+
if isinstance(o, Model):
154+
return o.value
155+
156+
if isinstance(o, VectorsDBIndexType):
157+
return o.value
158+
143159
if isinstance(o, DatabaseType):
144160
return o.value
145161

appwrite/enums/backup_services.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22

33
class BackupServices(Enum):
44
DATABASES = "databases"
5+
TABLESDB = "tablesdb"
6+
DOCUMENTSDB = "documentsdb"
7+
VECTORSDB = "vectorsdb"
58
FUNCTIONS = "functions"
69
STORAGE = "storage"

appwrite/enums/build_runtime.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,89 @@ class BuildRuntime(Enum):
8787
FLUTTER_3_32 = "flutter-3.32"
8888
FLUTTER_3_35 = "flutter-3.35"
8989
FLUTTER_3_38 = "flutter-3.38"
90+
NODE_14_5_RC = "node-14.5-rc"
91+
NODE_16_0_RC = "node-16.0-rc"
92+
NODE_18_0_RC = "node-18.0-rc"
93+
NODE_19_0_RC = "node-19.0-rc"
94+
NODE_20_0_RC = "node-20.0-rc"
95+
NODE_21_0_RC = "node-21.0-rc"
96+
NODE_22_RC = "node-22-rc"
97+
NODE_23_RC = "node-23-rc"
98+
NODE_24_RC = "node-24-rc"
99+
NODE_25_RC = "node-25-rc"
100+
PHP_8_0_RC = "php-8.0-rc"
101+
PHP_8_1_RC = "php-8.1-rc"
102+
PHP_8_2_RC = "php-8.2-rc"
103+
PHP_8_3_RC = "php-8.3-rc"
104+
PHP_8_4_RC = "php-8.4-rc"
105+
RUBY_3_0_RC = "ruby-3.0-rc"
106+
RUBY_3_1_RC = "ruby-3.1-rc"
107+
RUBY_3_2_RC = "ruby-3.2-rc"
108+
RUBY_3_3_RC = "ruby-3.3-rc"
109+
RUBY_3_4_RC = "ruby-3.4-rc"
110+
RUBY_4_0_RC = "ruby-4.0-rc"
111+
PYTHON_3_8_RC = "python-3.8-rc"
112+
PYTHON_3_9_RC = "python-3.9-rc"
113+
PYTHON_3_10_RC = "python-3.10-rc"
114+
PYTHON_3_11_RC = "python-3.11-rc"
115+
PYTHON_3_12_RC = "python-3.12-rc"
116+
PYTHON_3_13_RC = "python-3.13-rc"
117+
PYTHON_3_14_RC = "python-3.14-rc"
118+
PYTHON_ML_3_11_RC = "python-ml-3.11-rc"
119+
PYTHON_ML_3_12_RC = "python-ml-3.12-rc"
120+
PYTHON_ML_3_13_RC = "python-ml-3.13-rc"
121+
DENO_1_40_RC = "deno-1.40-rc"
122+
DENO_1_46_RC = "deno-1.46-rc"
123+
DENO_2_0_RC = "deno-2.0-rc"
124+
DENO_2_5_RC = "deno-2.5-rc"
125+
DENO_2_6_RC = "deno-2.6-rc"
126+
DART_2_15_RC = "dart-2.15-rc"
127+
DART_2_16_RC = "dart-2.16-rc"
128+
DART_2_17_RC = "dart-2.17-rc"
129+
DART_2_18_RC = "dart-2.18-rc"
130+
DART_2_19_RC = "dart-2.19-rc"
131+
DART_3_0_RC = "dart-3.0-rc"
132+
DART_3_1_RC = "dart-3.1-rc"
133+
DART_3_3_RC = "dart-3.3-rc"
134+
DART_3_5_RC = "dart-3.5-rc"
135+
DART_3_8_RC = "dart-3.8-rc"
136+
DART_3_9_RC = "dart-3.9-rc"
137+
DART_3_10_RC = "dart-3.10-rc"
138+
DOTNET_6_0_RC = "dotnet-6.0-rc"
139+
DOTNET_7_0_RC = "dotnet-7.0-rc"
140+
DOTNET_8_0_RC = "dotnet-8.0-rc"
141+
DOTNET_10_RC = "dotnet-10-rc"
142+
JAVA_8_0_RC = "java-8.0-rc"
143+
JAVA_11_0_RC = "java-11.0-rc"
144+
JAVA_17_0_RC = "java-17.0-rc"
145+
JAVA_18_0_RC = "java-18.0-rc"
146+
JAVA_21_0_RC = "java-21.0-rc"
147+
JAVA_22_RC = "java-22-rc"
148+
JAVA_25_RC = "java-25-rc"
149+
SWIFT_5_5_RC = "swift-5.5-rc"
150+
SWIFT_5_8_RC = "swift-5.8-rc"
151+
SWIFT_5_9_RC = "swift-5.9-rc"
152+
SWIFT_5_10_RC = "swift-5.10-rc"
153+
SWIFT_6_2_RC = "swift-6.2-rc"
154+
KOTLIN_1_6_RC = "kotlin-1.6-rc"
155+
KOTLIN_1_8_RC = "kotlin-1.8-rc"
156+
KOTLIN_1_9_RC = "kotlin-1.9-rc"
157+
KOTLIN_2_0_RC = "kotlin-2.0-rc"
158+
KOTLIN_2_3_RC = "kotlin-2.3-rc"
159+
CPP_17_RC = "cpp-17-rc"
160+
CPP_20_RC = "cpp-20-rc"
161+
BUN_1_0_RC = "bun-1.0-rc"
162+
BUN_1_1_RC = "bun-1.1-rc"
163+
BUN_1_2_RC = "bun-1.2-rc"
164+
BUN_1_3_RC = "bun-1.3-rc"
165+
GO_1_23_RC = "go-1.23-rc"
166+
GO_1_24_RC = "go-1.24-rc"
167+
GO_1_25_RC = "go-1.25-rc"
168+
GO_1_26_RC = "go-1.26-rc"
169+
STATIC_1_RC = "static-1-rc"
170+
FLUTTER_3_24_RC = "flutter-3.24-rc"
171+
FLUTTER_3_27_RC = "flutter-3.27-rc"
172+
FLUTTER_3_29_RC = "flutter-3.29-rc"
173+
FLUTTER_3_32_RC = "flutter-3.32-rc"
174+
FLUTTER_3_35_RC = "flutter-3.35-rc"
175+
FLUTTER_3_38_RC = "flutter-3.38-rc"

appwrite/enums/database_type.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
class DatabaseType(Enum):
44
LEGACY = "legacy"
55
TABLESDB = "tablesdb"
6+
DOCUMENTSDB = "documentsdb"
7+
VECTORSDB = "vectorsdb"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
class DatabasesIndexType(Enum):
4+
KEY = "key"
5+
FULLTEXT = "fulltext"
6+
UNIQUE = "unique"
7+
SPATIAL = "spatial"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
class DocumentsDBIndexType(Enum):
4+
KEY = "key"
5+
FULLTEXT = "fulltext"
6+
UNIQUE = "unique"
7+
SPATIAL = "spatial"

appwrite/enums/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from enum import Enum
2+
3+
class Model(Enum):
4+
EMBEDDINGGEMMA = "embeddinggemma"

appwrite/enums/runtime.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,89 @@ class Runtime(Enum):
8787
FLUTTER_3_32 = "flutter-3.32"
8888
FLUTTER_3_35 = "flutter-3.35"
8989
FLUTTER_3_38 = "flutter-3.38"
90+
NODE_14_5_RC = "node-14.5-rc"
91+
NODE_16_0_RC = "node-16.0-rc"
92+
NODE_18_0_RC = "node-18.0-rc"
93+
NODE_19_0_RC = "node-19.0-rc"
94+
NODE_20_0_RC = "node-20.0-rc"
95+
NODE_21_0_RC = "node-21.0-rc"
96+
NODE_22_RC = "node-22-rc"
97+
NODE_23_RC = "node-23-rc"
98+
NODE_24_RC = "node-24-rc"
99+
NODE_25_RC = "node-25-rc"
100+
PHP_8_0_RC = "php-8.0-rc"
101+
PHP_8_1_RC = "php-8.1-rc"
102+
PHP_8_2_RC = "php-8.2-rc"
103+
PHP_8_3_RC = "php-8.3-rc"
104+
PHP_8_4_RC = "php-8.4-rc"
105+
RUBY_3_0_RC = "ruby-3.0-rc"
106+
RUBY_3_1_RC = "ruby-3.1-rc"
107+
RUBY_3_2_RC = "ruby-3.2-rc"
108+
RUBY_3_3_RC = "ruby-3.3-rc"
109+
RUBY_3_4_RC = "ruby-3.4-rc"
110+
RUBY_4_0_RC = "ruby-4.0-rc"
111+
PYTHON_3_8_RC = "python-3.8-rc"
112+
PYTHON_3_9_RC = "python-3.9-rc"
113+
PYTHON_3_10_RC = "python-3.10-rc"
114+
PYTHON_3_11_RC = "python-3.11-rc"
115+
PYTHON_3_12_RC = "python-3.12-rc"
116+
PYTHON_3_13_RC = "python-3.13-rc"
117+
PYTHON_3_14_RC = "python-3.14-rc"
118+
PYTHON_ML_3_11_RC = "python-ml-3.11-rc"
119+
PYTHON_ML_3_12_RC = "python-ml-3.12-rc"
120+
PYTHON_ML_3_13_RC = "python-ml-3.13-rc"
121+
DENO_1_40_RC = "deno-1.40-rc"
122+
DENO_1_46_RC = "deno-1.46-rc"
123+
DENO_2_0_RC = "deno-2.0-rc"
124+
DENO_2_5_RC = "deno-2.5-rc"
125+
DENO_2_6_RC = "deno-2.6-rc"
126+
DART_2_15_RC = "dart-2.15-rc"
127+
DART_2_16_RC = "dart-2.16-rc"
128+
DART_2_17_RC = "dart-2.17-rc"
129+
DART_2_18_RC = "dart-2.18-rc"
130+
DART_2_19_RC = "dart-2.19-rc"
131+
DART_3_0_RC = "dart-3.0-rc"
132+
DART_3_1_RC = "dart-3.1-rc"
133+
DART_3_3_RC = "dart-3.3-rc"
134+
DART_3_5_RC = "dart-3.5-rc"
135+
DART_3_8_RC = "dart-3.8-rc"
136+
DART_3_9_RC = "dart-3.9-rc"
137+
DART_3_10_RC = "dart-3.10-rc"
138+
DOTNET_6_0_RC = "dotnet-6.0-rc"
139+
DOTNET_7_0_RC = "dotnet-7.0-rc"
140+
DOTNET_8_0_RC = "dotnet-8.0-rc"
141+
DOTNET_10_RC = "dotnet-10-rc"
142+
JAVA_8_0_RC = "java-8.0-rc"
143+
JAVA_11_0_RC = "java-11.0-rc"
144+
JAVA_17_0_RC = "java-17.0-rc"
145+
JAVA_18_0_RC = "java-18.0-rc"
146+
JAVA_21_0_RC = "java-21.0-rc"
147+
JAVA_22_RC = "java-22-rc"
148+
JAVA_25_RC = "java-25-rc"
149+
SWIFT_5_5_RC = "swift-5.5-rc"
150+
SWIFT_5_8_RC = "swift-5.8-rc"
151+
SWIFT_5_9_RC = "swift-5.9-rc"
152+
SWIFT_5_10_RC = "swift-5.10-rc"
153+
SWIFT_6_2_RC = "swift-6.2-rc"
154+
KOTLIN_1_6_RC = "kotlin-1.6-rc"
155+
KOTLIN_1_8_RC = "kotlin-1.8-rc"
156+
KOTLIN_1_9_RC = "kotlin-1.9-rc"
157+
KOTLIN_2_0_RC = "kotlin-2.0-rc"
158+
KOTLIN_2_3_RC = "kotlin-2.3-rc"
159+
CPP_17_RC = "cpp-17-rc"
160+
CPP_20_RC = "cpp-20-rc"
161+
BUN_1_0_RC = "bun-1.0-rc"
162+
BUN_1_1_RC = "bun-1.1-rc"
163+
BUN_1_2_RC = "bun-1.2-rc"
164+
BUN_1_3_RC = "bun-1.3-rc"
165+
GO_1_23_RC = "go-1.23-rc"
166+
GO_1_24_RC = "go-1.24-rc"
167+
GO_1_25_RC = "go-1.25-rc"
168+
GO_1_26_RC = "go-1.26-rc"
169+
STATIC_1_RC = "static-1-rc"
170+
FLUTTER_3_24_RC = "flutter-3.24-rc"
171+
FLUTTER_3_27_RC = "flutter-3.27-rc"
172+
FLUTTER_3_29_RC = "flutter-3.29-rc"
173+
FLUTTER_3_32_RC = "flutter-3.32-rc"
174+
FLUTTER_3_35_RC = "flutter-3.35-rc"
175+
FLUTTER_3_38_RC = "flutter-3.38-rc"

0 commit comments

Comments
 (0)