Skip to content

Commit 889402a

Browse files
committed
Release candidate 4 for 1.5.x
1 parent 987cc34 commit 889402a

File tree

262 files changed

+2111
-1782
lines changed

Some content is hidden

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

262 files changed

+2111
-1782
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.4.13-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.5.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def __init__(self):
1313
self._endpoint = 'https://cloud.appwrite.io/v1'
1414
self._global_headers = {
1515
'content-type': '',
16-
'user-agent' : 'AppwritePythonSDK/5.0.0-rc.3 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
16+
'user-agent' : 'AppwritePythonSDK/5.0.0-rc.4 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
1717
'x-sdk-name': 'Python',
1818
'x-sdk-platform': 'server',
1919
'x-sdk-language': 'python',
20-
'x-sdk-version': '5.0.0-rc.3',
20+
'x-sdk-version': '5.0.0-rc.4',
2121
'X-Appwrite-Response-Format' : '1.5.0',
2222
}
2323

appwrite/encoders/value_class_encoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from ..enums.execution_method import ExecutionMethod
1313
from ..enums.name import Name
1414
from ..enums.message_status import MessageStatus
15-
from ..enums.smtp_encryption import SMTPEncryption
15+
from ..enums.encryption import Encryption
1616
from ..enums.compression import Compression
1717
from ..enums.image_gravity import ImageGravity
1818
from ..enums.image_format import ImageFormat
@@ -60,7 +60,7 @@ def default(self, o):
6060
if isinstance(o, MessageStatus):
6161
return o.value
6262

63-
if isinstance(o, SMTPEncryption):
63+
if isinstance(o, Encryption):
6464
return o.value
6565

6666
if isinstance(o, Compression):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from enum import Enum
22

3-
class SMTPEncryption(Enum):
3+
class Encryption(Enum):
44
NONE = "none"
55
SSL = "ssl"
66
TLS = "tls"

appwrite/enums/runtime.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
from enum import Enum
22

33
class Runtime(Enum):
4+
NODE145 = "node-14.5"
5+
NODE160 = "node-16.0"
46
NODE180 = "node-18.0"
7+
NODE190 = "node-19.0"
8+
NODE200 = "node-20.0"
59
PHP80 = "php-8.0"
10+
PHP81 = "php-8.1"
11+
PHP82 = "php-8.2"
12+
RUBY30 = "ruby-3.0"
613
RUBY31 = "ruby-3.1"
14+
RUBY32 = "ruby-3.2"
15+
PYTHON38 = "python-3.8"
716
PYTHON39 = "python-3.9"
17+
PYTHON310 = "python-3.10"
18+
PYTHON311 = "python-3.11"
19+
PYTHON312 = "python-3.12"
20+
DART215 = "dart-2.15"
21+
DART216 = "dart-2.16"
22+
DART217 = "dart-2.17"
23+
DART218 = "dart-2.18"
24+
DART30 = "dart-3.0"
25+
DART31 = "dart-3.1"
26+
DOTNET31 = "dotnet-3.1"
27+
DOTNET60 = "dotnet-6.0"
28+
DOTNET70 = "dotnet-7.0"
29+
JAVA80 = "java-8.0"
30+
JAVA110 = "java-11.0"
31+
JAVA170 = "java-17.0"
32+
JAVA180 = "java-18.0"
33+
SWIFT55 = "swift-5.5"
34+
SWIFT58 = "swift-5.8"
35+
KOTLIN16 = "kotlin-1.6"
36+
KOTLIN18 = "kotlin-1.8"
37+
CPP17 = "cpp-17"
38+
CPP20 = "cpp-20"
39+
BUN10 = "bun-1.0"

appwrite/services/messaging.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def list_messages(self, queries = None, search = None):
2020
'content-type': 'application/json',
2121
}, api_params)
2222

23-
def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, status = None, html = None, scheduled_at = None):
24-
"""Create an email."""
23+
def create_email(self, message_id, subject, content, topics = None, users = None, targets = None, cc = None, bcc = None, attachments = None, status = None, html = None, scheduled_at = None):
24+
"""Create an email"""
2525

2626

2727
api_path = '/messaging/messages/email'
@@ -44,6 +44,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None
4444
api_params['targets'] = targets
4545
api_params['cc'] = cc
4646
api_params['bcc'] = bcc
47+
api_params['attachments'] = attachments
4748
api_params['status'] = status
4849
api_params['html'] = html
4950
api_params['scheduledAt'] = scheduled_at
@@ -53,7 +54,7 @@ def create_email(self, message_id, subject, content, topics = None, users = None
5354
}, api_params)
5455

5556
def update_email(self, message_id, topics = None, users = None, targets = None, subject = None, content = None, status = None, html = None, cc = None, bcc = None, scheduled_at = None):
56-
"""Update an email."""
57+
"""Update an email"""
5758

5859

5960
api_path = '/messaging/messages/email/{messageId}'
@@ -78,8 +79,8 @@ def update_email(self, message_id, topics = None, users = None, targets = None,
7879
'content-type': 'application/json',
7980
}, api_params)
8081

81-
def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None):
82-
"""Create a push notification."""
82+
def create_push(self, message_id, title, body, topics = None, users = None, targets = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None):
83+
"""Create a push notification"""
8384

8485

8586
api_path = '/messaging/messages/push'
@@ -102,6 +103,7 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ
102103
api_params['targets'] = targets
103104
api_params['data'] = data
104105
api_params['action'] = action
106+
api_params['image'] = image
105107
api_params['icon'] = icon
106108
api_params['sound'] = sound
107109
api_params['color'] = color
@@ -114,8 +116,8 @@ def create_push(self, message_id, title, body, topics = None, users = None, targ
114116
'content-type': 'application/json',
115117
}, api_params)
116118

117-
def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None):
118-
"""Update a push notification."""
119+
def update_push(self, message_id, topics = None, users = None, targets = None, title = None, body = None, data = None, action = None, image = None, icon = None, sound = None, color = None, tag = None, badge = None, status = None, scheduled_at = None):
120+
"""Update a push notification"""
119121

120122

121123
api_path = '/messaging/messages/push/{messageId}'
@@ -132,6 +134,7 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t
132134
api_params['body'] = body
133135
api_params['data'] = data
134136
api_params['action'] = action
137+
api_params['image'] = image
135138
api_params['icon'] = icon
136139
api_params['sound'] = sound
137140
api_params['color'] = color
@@ -145,7 +148,7 @@ def update_push(self, message_id, topics = None, users = None, targets = None, t
145148
}, api_params)
146149

147150
def create_sms(self, message_id, content, topics = None, users = None, targets = None, status = None, scheduled_at = None):
148-
"""Create an SMS."""
151+
"""Create an SMS"""
149152

150153

151154
api_path = '/messaging/messages/sms'
@@ -170,7 +173,7 @@ def create_sms(self, message_id, content, topics = None, users = None, targets =
170173
}, api_params)
171174

172175
def update_sms(self, message_id, topics = None, users = None, targets = None, content = None, status = None, scheduled_at = None):
173-
"""Update an SMS."""
176+
"""Update an SMS"""
174177

175178

176179
api_path = '/messaging/messages/sms/{messageId}'
@@ -817,7 +820,7 @@ def list_subscriber_logs(self, subscriber_id, queries = None):
817820
}, api_params)
818821

819822
def list_topics(self, queries = None, search = None):
820-
"""List topics."""
823+
"""List topics"""
821824

822825

823826
api_path = '/messaging/topics'
@@ -831,7 +834,7 @@ def list_topics(self, queries = None, search = None):
831834
}, api_params)
832835

833836
def create_topic(self, topic_id, name, subscribe = None):
834-
"""Create a topic."""
837+
"""Create a topic"""
835838

836839

837840
api_path = '/messaging/topics'
@@ -852,7 +855,7 @@ def create_topic(self, topic_id, name, subscribe = None):
852855
}, api_params)
853856

854857
def get_topic(self, topic_id):
855-
"""Get a topic."""
858+
"""Get a topic"""
856859

857860

858861
api_path = '/messaging/topics/{topicId}'
@@ -868,7 +871,7 @@ def get_topic(self, topic_id):
868871
}, api_params)
869872

870873
def update_topic(self, topic_id, name = None):
871-
"""Update a topic."""
874+
"""Update a topic"""
872875

873876

874877
api_path = '/messaging/topics/{topicId}'
@@ -885,7 +888,7 @@ def update_topic(self, topic_id, name = None):
885888
}, api_params)
886889

887890
def delete_topic(self, topic_id):
888-
"""Delete a topic."""
891+
"""Delete a topic"""
889892

890893

891894
api_path = '/messaging/topics/{topicId}'
@@ -918,7 +921,7 @@ def list_topic_logs(self, topic_id, queries = None):
918921
}, api_params)
919922

920923
def list_subscribers(self, topic_id, queries = None, search = None):
921-
"""List subscribers."""
924+
"""List subscribers"""
922925

923926

924927
api_path = '/messaging/topics/{topicId}/subscribers'
@@ -936,7 +939,7 @@ def list_subscribers(self, topic_id, queries = None, search = None):
936939
}, api_params)
937940

938941
def create_subscriber(self, topic_id, subscriber_id, target_id):
939-
"""Create a subscriber."""
942+
"""Create a subscriber"""
940943

941944

942945
api_path = '/messaging/topics/{topicId}/subscribers'
@@ -960,7 +963,7 @@ def create_subscriber(self, topic_id, subscriber_id, target_id):
960963
}, api_params)
961964

962965
def get_subscriber(self, topic_id, subscriber_id):
963-
"""Get a subscriber."""
966+
"""Get a subscriber"""
964967

965968

966969
api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}'
@@ -980,7 +983,7 @@ def get_subscriber(self, topic_id, subscriber_id):
980983
}, api_params)
981984

982985
def delete_subscriber(self, topic_id, subscriber_id):
983-
"""Delete a subscriber."""
986+
"""Delete a subscriber"""
984987

985988

986989
api_path = '/messaging/topics/{topicId}/subscribers/{subscriberId}'
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
from appwrite.client import Client
2-
from Appwrite.enums import AuthenticatorType
2+
from appwrite.enums import AuthenticatorType
33

44
client = Client()
5-
6-
(client
7-
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
8-
.set_project('5df5acd0d48c2') # Your project ID
9-
.set_session('') # The user session to authenticate with
10-
)
5+
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
6+
client.set_project('5df5acd0d48c2') # Your project ID
7+
client.set_session('') # The user session to authenticate with
118

129
account = Account(client)
1310

14-
result = account.add_authenticator(AuthenticatorType.TOTP)
11+
result = account.add_authenticator(
12+
type = AuthenticatorType.TOTP
13+
)

docs/examples/account/create-anonymous-session.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
from appwrite.client import Client
22

33
client = Client()
4-
5-
(client
6-
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
7-
.set_project('5df5acd0d48c2') # Your project ID
8-
)
4+
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
5+
client.set_project('5df5acd0d48c2') # Your project ID
96

107
account = Account(client)
118

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from appwrite.client import Client
22

33
client = Client()
4-
5-
(client
6-
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
7-
.set_project('5df5acd0d48c2') # Your project ID
8-
)
4+
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
5+
client.set_project('5df5acd0d48c2') # Your project ID
96

107
account = Account(client)
118

12-
result = account.create_email_password_session('email@example.com', 'password')
9+
result = account.create_email_password_session(
10+
email = 'email@example.com',
11+
password = 'password'
12+
)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from appwrite.client import Client
22

33
client = Client()
4-
5-
(client
6-
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
7-
.set_project('5df5acd0d48c2') # Your project ID
8-
)
4+
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
5+
client.set_project('5df5acd0d48c2') # Your project ID
96

107
account = Account(client)
118

12-
result = account.create_email_token('[USER_ID]', 'email@example.com')
9+
result = account.create_email_token(
10+
user_id = '[USER_ID]',
11+
email = 'email@example.com',
12+
phrase = False # optional
13+
)

0 commit comments

Comments
 (0)