Skip to content

Commit c474048

Browse files
Merge pull request #63 from appwrite/dev
fix nullable parameters in request body
2 parents df27804 + b658e55 commit c474048

File tree

163 files changed

+166
-190
lines changed

Some content is hidden

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

163 files changed

+166
-190
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.3.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.3.2-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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ def __init__(self):
1111
self._endpoint = 'https://HOSTNAME/v1'
1212
self._global_headers = {
1313
'content-type': '',
14+
'user-agent' : 'AppwritePythonSDK/2.0.1 (${os.uname().sysname}; ${os.uname().version}; ${os.uname().machine})',
1415
'x-sdk-name': 'Python',
1516
'x-sdk-platform': 'server',
1617
'x-sdk-language': 'python',
17-
'x-sdk-version': '2.0.0',
18+
'x-sdk-version': '2.0.1',
1819
'X-Appwrite-Response-Format' : '1.0.0',
1920
}
2021

@@ -59,6 +60,8 @@ def call(self, method, path='', headers=None, params=None):
5960
if params is None:
6061
params = {}
6162

63+
params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary
64+
6265
data = {}
6366
json = {}
6467
files = {}

appwrite/services/databases.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ def update_boolean_attribute(self, database_id, collection_id, key, required, de
271271
if required is None:
272272
raise AppwriteException('Missing required parameter: "required"')
273273

274-
if default is None:
275-
raise AppwriteException('Missing required parameter: "default"')
276-
277274
path = path.replace('{databaseId}', database_id)
278275
path = path.replace('{collectionId}', collection_id)
279276
path = path.replace('{key}', key)
@@ -333,9 +330,6 @@ def update_datetime_attribute(self, database_id, collection_id, key, required, d
333330
if required is None:
334331
raise AppwriteException('Missing required parameter: "required"')
335332

336-
if default is None:
337-
raise AppwriteException('Missing required parameter: "default"')
338-
339333
path = path.replace('{databaseId}', database_id)
340334
path = path.replace('{collectionId}', collection_id)
341335
path = path.replace('{key}', key)
@@ -395,9 +389,6 @@ def update_email_attribute(self, database_id, collection_id, key, required, defa
395389
if required is None:
396390
raise AppwriteException('Missing required parameter: "required"')
397391

398-
if default is None:
399-
raise AppwriteException('Missing required parameter: "default"')
400-
401392
path = path.replace('{databaseId}', database_id)
402393
path = path.replace('{collectionId}', collection_id)
403394
path = path.replace('{key}', key)
@@ -464,9 +455,6 @@ def update_enum_attribute(self, database_id, collection_id, key, elements, requi
464455
if required is None:
465456
raise AppwriteException('Missing required parameter: "required"')
466457

467-
if default is None:
468-
raise AppwriteException('Missing required parameter: "default"')
469-
470458
path = path.replace('{databaseId}', database_id)
471459
path = path.replace('{collectionId}', collection_id)
472460
path = path.replace('{key}', key)
@@ -535,9 +523,6 @@ def update_float_attribute(self, database_id, collection_id, key, required, min,
535523
if max is None:
536524
raise AppwriteException('Missing required parameter: "max"')
537525

538-
if default is None:
539-
raise AppwriteException('Missing required parameter: "default"')
540-
541526
path = path.replace('{databaseId}', database_id)
542527
path = path.replace('{collectionId}', collection_id)
543528
path = path.replace('{key}', key)
@@ -607,9 +592,6 @@ def update_integer_attribute(self, database_id, collection_id, key, required, mi
607592
if max is None:
608593
raise AppwriteException('Missing required parameter: "max"')
609594

610-
if default is None:
611-
raise AppwriteException('Missing required parameter: "default"')
612-
613595
path = path.replace('{databaseId}', database_id)
614596
path = path.replace('{collectionId}', collection_id)
615597
path = path.replace('{key}', key)
@@ -671,9 +653,6 @@ def update_ip_attribute(self, database_id, collection_id, key, required, default
671653
if required is None:
672654
raise AppwriteException('Missing required parameter: "required"')
673655

674-
if default is None:
675-
raise AppwriteException('Missing required parameter: "default"')
676-
677656
path = path.replace('{databaseId}', database_id)
678657
path = path.replace('{collectionId}', collection_id)
679658
path = path.replace('{key}', key)
@@ -769,9 +748,6 @@ def update_string_attribute(self, database_id, collection_id, key, required, def
769748
if required is None:
770749
raise AppwriteException('Missing required parameter: "required"')
771750

772-
if default is None:
773-
raise AppwriteException('Missing required parameter: "default"')
774-
775751
path = path.replace('{databaseId}', database_id)
776752
path = path.replace('{collectionId}', collection_id)
777753
path = path.replace('{key}', key)
@@ -831,9 +807,6 @@ def update_url_attribute(self, database_id, collection_id, key, required, defaul
831807
if required is None:
832808
raise AppwriteException('Missing required parameter: "required"')
833809

834-
if default is None:
835-
raise AppwriteException('Missing required parameter: "default"')
836-
837810
path = path.replace('{databaseId}', database_id)
838811
path = path.replace('{collectionId}', collection_id)
839812
path = path.replace('{key}', key)

docs/examples/account/create-phone-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/create-recovery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/create-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/delete-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/delete-sessions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/get-prefs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

docs/examples/account/get-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from appwrite.services.account import Account
44
client = Client()
55

66
(client
7-
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
88
.set_project('5df5acd0d48c2') # Your project ID
99
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
1010
)

0 commit comments

Comments
 (0)