Skip to content

Commit 3f57ce2

Browse files
fix: realtime events payload
1 parent 5ad54e5 commit 3f57ce2

File tree

8 files changed

+5
-144
lines changed

8 files changed

+5
-144
lines changed

appwrite/services/account.py

-15
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ def update_email(self, email, password):
3030

3131
if email is not None:
3232
params['email'] = email
33-
3433
if password is not None:
3534
params['password'] = password
36-
3735
return self.client.call('patch', path, {
3836
'content-type': 'application/json',
3937
}, params)
@@ -65,7 +63,6 @@ def update_name(self, name):
6563

6664
if name is not None:
6765
params['name'] = name
68-
6966
return self.client.call('patch', path, {
7067
'content-type': 'application/json',
7168
}, params)
@@ -81,10 +78,8 @@ def update_password(self, password, old_password = None):
8178

8279
if password is not None:
8380
params['password'] = password
84-
8581
if old_password is not None:
8682
params['oldPassword'] = old_password
87-
8883
return self.client.call('patch', path, {
8984
'content-type': 'application/json',
9085
}, params)
@@ -110,7 +105,6 @@ def update_prefs(self, prefs):
110105

111106
if prefs is not None:
112107
params['prefs'] = prefs
113-
114108
return self.client.call('patch', path, {
115109
'content-type': 'application/json',
116110
}, params)
@@ -129,10 +123,8 @@ def create_recovery(self, email, url):
129123

130124
if email is not None:
131125
params['email'] = email
132-
133126
if url is not None:
134127
params['url'] = url
135-
136128
return self.client.call('post', path, {
137129
'content-type': 'application/json',
138130
}, params)
@@ -157,16 +149,12 @@ def update_recovery(self, user_id, secret, password, password_again):
157149

158150
if user_id is not None:
159151
params['userId'] = user_id
160-
161152
if secret is not None:
162153
params['secret'] = secret
163-
164154
if password is not None:
165155
params['password'] = password
166-
167156
if password_again is not None:
168157
params['passwordAgain'] = password_again
169-
170158
return self.client.call('put', path, {
171159
'content-type': 'application/json',
172160
}, params)
@@ -254,7 +242,6 @@ def create_verification(self, url):
254242

255243
if url is not None:
256244
params['url'] = url
257-
258245
return self.client.call('post', path, {
259246
'content-type': 'application/json',
260247
}, params)
@@ -273,10 +260,8 @@ def update_verification(self, user_id, secret):
273260

274261
if user_id is not None:
275262
params['userId'] = user_id
276-
277263
if secret is not None:
278264
params['secret'] = secret
279-
280265
return self.client.call('put', path, {
281266
'content-type': 'application/json',
282267
}, params)

appwrite/services/database.py

-59
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,14 @@ def create_collection(self, collection_id, name, permission, read, write):
5757

5858
if collection_id is not None:
5959
params['collectionId'] = collection_id
60-
6160
if name is not None:
6261
params['name'] = name
63-
6462
if permission is not None:
6563
params['permission'] = permission
66-
6764
if read is not None:
6865
params['read'] = read
69-
7066
if write is not None:
7167
params['write'] = write
72-
7368
return self.client.call('post', path, {
7469
'content-type': 'application/json',
7570
}, params)
@@ -106,19 +101,14 @@ def update_collection(self, collection_id, name, permission, read = None, write
106101

107102
if name is not None:
108103
params['name'] = name
109-
110104
if permission is not None:
111105
params['permission'] = permission
112-
113106
if read is not None:
114107
params['read'] = read
115-
116108
if write is not None:
117109
params['write'] = write
118-
119110
if enabled is not None:
120111
params['enabled'] = enabled
121-
122112
return self.client.call('put', path, {
123113
'content-type': 'application/json',
124114
}, params)
@@ -169,16 +159,12 @@ def create_boolean_attribute(self, collection_id, key, required, default = None,
169159

170160
if key is not None:
171161
params['key'] = key
172-
173162
if required is not None:
174163
params['required'] = required
175-
176164
if default is not None:
177165
params['default'] = default
178-
179166
if array is not None:
180167
params['array'] = array
181-
182168
return self.client.call('post', path, {
183169
'content-type': 'application/json',
184170
}, params)
@@ -201,16 +187,12 @@ def create_email_attribute(self, collection_id, key, required, default = None, a
201187

202188
if key is not None:
203189
params['key'] = key
204-
205190
if required is not None:
206191
params['required'] = required
207-
208192
if default is not None:
209193
params['default'] = default
210-
211194
if array is not None:
212195
params['array'] = array
213-
214196
return self.client.call('post', path, {
215197
'content-type': 'application/json',
216198
}, params)
@@ -236,19 +218,14 @@ def create_enum_attribute(self, collection_id, key, elements, required, default
236218

237219
if key is not None:
238220
params['key'] = key
239-
240221
if elements is not None:
241222
params['elements'] = elements
242-
243223
if required is not None:
244224
params['required'] = required
245-
246225
if default is not None:
247226
params['default'] = default
248-
249227
if array is not None:
250228
params['array'] = array
251-
252229
return self.client.call('post', path, {
253230
'content-type': 'application/json',
254231
}, params)
@@ -271,22 +248,16 @@ def create_float_attribute(self, collection_id, key, required, min = None, max =
271248

272249
if key is not None:
273250
params['key'] = key
274-
275251
if required is not None:
276252
params['required'] = required
277-
278253
if min is not None:
279254
params['min'] = min
280-
281255
if max is not None:
282256
params['max'] = max
283-
284257
if default is not None:
285258
params['default'] = default
286-
287259
if array is not None:
288260
params['array'] = array
289-
290261
return self.client.call('post', path, {
291262
'content-type': 'application/json',
292263
}, params)
@@ -309,22 +280,16 @@ def create_integer_attribute(self, collection_id, key, required, min = None, max
309280

310281
if key is not None:
311282
params['key'] = key
312-
313283
if required is not None:
314284
params['required'] = required
315-
316285
if min is not None:
317286
params['min'] = min
318-
319287
if max is not None:
320288
params['max'] = max
321-
322289
if default is not None:
323290
params['default'] = default
324-
325291
if array is not None:
326292
params['array'] = array
327-
328293
return self.client.call('post', path, {
329294
'content-type': 'application/json',
330295
}, params)
@@ -347,16 +312,12 @@ def create_ip_attribute(self, collection_id, key, required, default = None, arra
347312

348313
if key is not None:
349314
params['key'] = key
350-
351315
if required is not None:
352316
params['required'] = required
353-
354317
if default is not None:
355318
params['default'] = default
356-
357319
if array is not None:
358320
params['array'] = array
359-
360321
return self.client.call('post', path, {
361322
'content-type': 'application/json',
362323
}, params)
@@ -382,19 +343,14 @@ def create_string_attribute(self, collection_id, key, size, required, default =
382343

383344
if key is not None:
384345
params['key'] = key
385-
386346
if size is not None:
387347
params['size'] = size
388-
389348
if required is not None:
390349
params['required'] = required
391-
392350
if default is not None:
393351
params['default'] = default
394-
395352
if array is not None:
396353
params['array'] = array
397-
398354
return self.client.call('post', path, {
399355
'content-type': 'application/json',
400356
}, params)
@@ -417,16 +373,12 @@ def create_url_attribute(self, collection_id, key, required, default = None, arr
417373

418374
if key is not None:
419375
params['key'] = key
420-
421376
if required is not None:
422377
params['required'] = required
423-
424378
if default is not None:
425379
params['default'] = default
426-
427380
if array is not None:
428381
params['array'] = array
429-
430382
return self.client.call('post', path, {
431383
'content-type': 'application/json',
432384
}, params)
@@ -520,16 +472,12 @@ def create_document(self, collection_id, document_id, data, read = None, write =
520472

521473
if document_id is not None:
522474
params['documentId'] = document_id
523-
524475
if data is not None:
525476
params['data'] = data
526-
527477
if read is not None:
528478
params['read'] = read
529-
530479
if write is not None:
531480
params['write'] = write
532-
533481
return self.client.call('post', path, {
534482
'content-type': 'application/json',
535483
}, params)
@@ -571,13 +519,10 @@ def update_document(self, collection_id, document_id, data, read = None, write =
571519

572520
if data is not None:
573521
params['data'] = data
574-
575522
if read is not None:
576523
params['read'] = read
577-
578524
if write is not None:
579525
params['write'] = write
580-
581526
return self.client.call('patch', path, {
582527
'content-type': 'application/json',
583528
}, params)
@@ -635,16 +580,12 @@ def create_index(self, collection_id, key, type, attributes, orders = None):
635580

636581
if key is not None:
637582
params['key'] = key
638-
639583
if type is not None:
640584
params['type'] = type
641-
642585
if attributes is not None:
643586
params['attributes'] = attributes
644-
645587
if orders is not None:
646588
params['orders'] = orders
647-
648589
return self.client.call('post', path, {
649590
'content-type': 'application/json',
650591
}, params)

0 commit comments

Comments
 (0)