Skip to content

Commit 7ded6e2

Browse files
authored
Merge pull request #51 from appwrite/dev
Appwrite 1.2.0 support
2 parents e8d321b + 37eba10 commit 7ded6e2

22 files changed

+77
-169
lines changed

β€ŽLICENSEβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Redistribution and use in source and binary forms, with or without modification,
77

88
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
99

10-
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

1212
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

β€Ž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.0.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.2.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.0.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.2.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self):
1414
'x-sdk-name': 'Python',
1515
'x-sdk-platform': 'server',
1616
'x-sdk-language': 'python',
17-
'x-sdk-version': '1.1.0',
17+
'x-sdk-version': '1.2.0',
1818
'X-Appwrite-Response-Format' : '1.0.0',
1919
}
2020

β€Žappwrite/services/account.pyβ€Ž

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get(self):
1818
}, params)
1919

2020
def update_email(self, email, password):
21-
"""Update Account Email"""
21+
"""Update Email"""
2222

2323

2424
path = '/account/email'
@@ -38,7 +38,7 @@ def update_email(self, email, password):
3838
}, params)
3939

4040
def list_logs(self, queries = None):
41-
"""List Account Logs"""
41+
"""List Logs"""
4242

4343

4444
path = '/account/logs'
@@ -51,7 +51,7 @@ def list_logs(self, queries = None):
5151
}, params)
5252

5353
def update_name(self, name):
54-
"""Update Account Name"""
54+
"""Update Name"""
5555

5656

5757
path = '/account/name'
@@ -67,7 +67,7 @@ def update_name(self, name):
6767
}, params)
6868

6969
def update_password(self, password, old_password = None):
70-
"""Update Account Password"""
70+
"""Update Password"""
7171

7272

7373
path = '/account/password'
@@ -84,7 +84,7 @@ def update_password(self, password, old_password = None):
8484
}, params)
8585

8686
def update_phone(self, phone, password):
87-
"""Update Account Phone"""
87+
"""Update Phone"""
8888

8989

9090
path = '/account/phone'
@@ -115,7 +115,7 @@ def get_prefs(self):
115115
}, params)
116116

117117
def update_prefs(self, prefs):
118-
"""Update Account Preferences"""
118+
"""Update Preferences"""
119119

120120

121121
path = '/account/prefs'
@@ -179,7 +179,7 @@ def update_recovery(self, user_id, secret, password, password_again):
179179
}, params)
180180

181181
def list_sessions(self):
182-
"""List Account Sessions"""
182+
"""List Sessions"""
183183

184184

185185
path = '/account/sessions'
@@ -190,7 +190,7 @@ def list_sessions(self):
190190
}, params)
191191

192192
def delete_sessions(self):
193-
"""Delete All Account Sessions"""
193+
"""Delete Sessions"""
194194

195195

196196
path = '/account/sessions'
@@ -201,7 +201,7 @@ def delete_sessions(self):
201201
}, params)
202202

203203
def get_session(self, session_id):
204-
"""Get Session By ID"""
204+
"""Get Session"""
205205

206206

207207
path = '/account/sessions/{sessionId}'
@@ -217,7 +217,7 @@ def get_session(self, session_id):
217217
}, params)
218218

219219
def update_session(self, session_id):
220-
"""Update Session (Refresh Tokens)"""
220+
"""Update OAuth Session (Refresh Tokens)"""
221221

222222

223223
path = '/account/sessions/{sessionId}'
@@ -233,7 +233,7 @@ def update_session(self, session_id):
233233
}, params)
234234

235235
def delete_session(self, session_id):
236-
"""Delete Account Session"""
236+
"""Delete Session"""
237237

238238

239239
path = '/account/sessions/{sessionId}'
@@ -249,7 +249,7 @@ def delete_session(self, session_id):
249249
}, params)
250250

251251
def update_status(self):
252-
"""Update Account Status"""
252+
"""Update Status"""
253253

254254

255255
path = '/account/status'

β€Žappwrite/services/functions.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def delete_deployment(self, function_id, deployment_id):
234234
'content-type': 'application/json',
235235
}, params)
236236

237-
def retry_build(self, function_id, deployment_id, build_id):
238-
"""Retry Build"""
237+
def create_build(self, function_id, deployment_id, build_id):
238+
"""Create Build"""
239239

240240

241241
path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'

β€Žappwrite/services/graphql.pyβ€Ž

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from ..service import Service
2+
from ..exception import AppwriteException
3+
4+
class Graphql(Service):
5+
6+
def __init__(self, client):
7+
super(Graphql, self).__init__(client)
8+
9+
def query(self, query):
10+
"""GraphQL Endpoint"""
11+
12+
13+
path = '/graphql'
14+
params = {}
15+
if query is None:
16+
raise AppwriteException('Missing required parameter: "query"')
17+
18+
19+
params['query'] = query
20+
21+
return self.client.call('post', path, {
22+
'x-sdk-graphql': 'true',
23+
'content-type': 'application/json',
24+
}, params)
25+
26+
def mutation(self, query):
27+
"""GraphQL Endpoint"""
28+
29+
30+
path = '/graphql/mutation'
31+
params = {}
32+
if query is None:
33+
raise AppwriteException('Missing required parameter: "query"')
34+
35+
36+
params['query'] = query
37+
38+
return self.client.call('post', path, {
39+
'x-sdk-graphql': 'true',
40+
'content-type': 'application/json',
41+
}, params)

β€Ždocs/examples/account/get-logs.mdβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Ždocs/examples/account/get-sessions.mdβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Ždocs/examples/account/update-phone.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.update_phone('', 'password')
14+
result = account.update_phone('+12065550100', 'password')

β€Ždocs/examples/functions/retry-build.mdβ€Ž renamed to β€Ždocs/examples/functions/create-build.mdβ€Ž

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

1212
functions = Functions(client)
1313

14-
result = functions.retry_build('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]')
14+
result = functions.create_build('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]')

0 commit comments

Comments
Β (0)