Skip to content

Commit d5ab8ef

Browse files
feat: support for 0.14.x
1 parent 1a5335b commit d5ab8ef

File tree

9 files changed

+35
-31
lines changed

9 files changed

+35
-31
lines changed

README.md

Lines changed: 3 additions & 3 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-0.13.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.14.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 0.13.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 0.14.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

@@ -24,7 +24,7 @@ pip install appwrite
2424
## Getting Started
2525

2626
### Init your SDK
27-
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
27+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found on your project settings page and your new API secret Key from project's API keys section.
2828

2929
```python
3030
from appwrite.client import Client

appwrite/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self):
1111
self._endpoint = 'https://HOSTNAME/v1'
1212
self._global_headers = {
1313
'content-type': '',
14-
'x-sdk-version': 'appwrite:python:0.8.0',
14+
'x-sdk-version': 'appwrite:python:0.9.0',
1515
'X-Appwrite-Response-Format' : '0.13.0',
1616
}
1717

appwrite/services/account.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ def get(self):
1616
'content-type': 'application/json',
1717
}, params)
1818

19-
def delete(self):
20-
"""Delete Account"""
21-
22-
params = {}
23-
path = '/account'
24-
25-
return self.client.call('delete', path, {
26-
'content-type': 'application/json',
27-
}, params)
28-
2919
def update_email(self, email, password):
3020
"""Update Account Email"""
3121

@@ -243,6 +233,16 @@ def delete_session(self, session_id):
243233
'content-type': 'application/json',
244234
}, params)
245235

236+
def update_status(self):
237+
"""Update Account Status"""
238+
239+
params = {}
240+
path = '/account/status'
241+
242+
return self.client.call('patch', path, {
243+
'content-type': 'application/json',
244+
}, params)
245+
246246
def create_verification(self, url):
247247
"""Create Email Verification"""
248248

appwrite/services/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def create(self, function_id, name, execute, runtime, vars = None, events = None
8181
}, params)
8282

8383
def list_runtimes(self):
84-
"""List the currently active function runtimes."""
84+
"""List runtimes"""
8585

8686
params = {}
8787
path = '/functions/runtimes'

appwrite/services/health.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ def get_queue_logs(self):
7676
'content-type': 'application/json',
7777
}, params)
7878

79-
def get_queue_usage(self):
80-
"""Get Usage Queue"""
81-
82-
params = {}
83-
path = '/health/queue/usage'
84-
85-
return self.client.call('get', path, {
86-
'content-type': 'application/json',
87-
}, params)
88-
8979
def get_queue_webhooks(self):
9080
"""Get Webhooks Queue"""
9181

appwrite/services/users.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ def get_logs(self, user_id, limit = None, offset = None):
133133
'content-type': 'application/json',
134134
}, params)
135135

136+
def get_memberships(self, user_id):
137+
"""Get User Memberships"""
138+
139+
if user_id is None:
140+
raise AppwriteException('Missing required parameter: "user_id"')
141+
142+
params = {}
143+
path = '/users/{userId}/memberships'
144+
path = path.replace('{userId}', user_id)
145+
146+
return self.client.call('get', path, {
147+
'content-type': 'application/json',
148+
}, params)
149+
136150
def update_name(self, user_id, name):
137151
"""Update Name"""
138152

docs/examples/account/delete.md renamed to docs/examples/account/update-status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ client = Client()
1111

1212
account = Account(client)
1313

14-
result = account.delete()
14+
result = account.update_status()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from appwrite.client import Client
2-
from appwrite.services.health import Health
2+
from appwrite.services.users import Users
33

44
client = Client()
55

@@ -9,6 +9,6 @@ client = Client()
99
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
1010
)
1111

12-
health = Health(client)
12+
users = Users(client)
1313

14-
result = health.get_queue_usage()
14+
result = users.get_memberships('[USER_ID]')

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
setuptools.setup(
44
name = 'appwrite',
55
packages = ['appwrite', 'appwrite/services'],
6-
version = '0.8.0',
6+
version = '0.9.0',
77
license='BSD-3-Clause',
88
description = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API',
99
author = 'Appwrite Team',
1010
author_email = '[email protected]',
1111
maintainer = 'Appwrite Team',
1212
maintainer_email = '[email protected]',
1313
url = 'https://appwrite.io/support',
14-
download_url='https://github.com/appwrite/sdk-for-python/archive/0.8.0.tar.gz',
14+
download_url='https://github.com/appwrite/sdk-for-python/archive/0.9.0.tar.gz',
1515
# keywords = ['SOME', 'MEANINGFULL', 'KEYWORDS'],
1616
install_requires=[
1717
'requests',

0 commit comments

Comments
 (0)