@@ -57,19 +57,14 @@ def create_collection(self, collection_id, name, permission, read, write):
57
57
58
58
if collection_id is not None :
59
59
params ['collectionId' ] = collection_id
60
-
61
60
if name is not None :
62
61
params ['name' ] = name
63
-
64
62
if permission is not None :
65
63
params ['permission' ] = permission
66
-
67
64
if read is not None :
68
65
params ['read' ] = read
69
-
70
66
if write is not None :
71
67
params ['write' ] = write
72
-
73
68
return self .client .call ('post' , path , {
74
69
'content-type' : 'application/json' ,
75
70
}, params )
@@ -106,19 +101,14 @@ def update_collection(self, collection_id, name, permission, read = None, write
106
101
107
102
if name is not None :
108
103
params ['name' ] = name
109
-
110
104
if permission is not None :
111
105
params ['permission' ] = permission
112
-
113
106
if read is not None :
114
107
params ['read' ] = read
115
-
116
108
if write is not None :
117
109
params ['write' ] = write
118
-
119
110
if enabled is not None :
120
111
params ['enabled' ] = enabled
121
-
122
112
return self .client .call ('put' , path , {
123
113
'content-type' : 'application/json' ,
124
114
}, params )
@@ -169,16 +159,12 @@ def create_boolean_attribute(self, collection_id, key, required, default = None,
169
159
170
160
if key is not None :
171
161
params ['key' ] = key
172
-
173
162
if required is not None :
174
163
params ['required' ] = required
175
-
176
164
if default is not None :
177
165
params ['default' ] = default
178
-
179
166
if array is not None :
180
167
params ['array' ] = array
181
-
182
168
return self .client .call ('post' , path , {
183
169
'content-type' : 'application/json' ,
184
170
}, params )
@@ -201,16 +187,12 @@ def create_email_attribute(self, collection_id, key, required, default = None, a
201
187
202
188
if key is not None :
203
189
params ['key' ] = key
204
-
205
190
if required is not None :
206
191
params ['required' ] = required
207
-
208
192
if default is not None :
209
193
params ['default' ] = default
210
-
211
194
if array is not None :
212
195
params ['array' ] = array
213
-
214
196
return self .client .call ('post' , path , {
215
197
'content-type' : 'application/json' ,
216
198
}, params )
@@ -236,19 +218,14 @@ def create_enum_attribute(self, collection_id, key, elements, required, default
236
218
237
219
if key is not None :
238
220
params ['key' ] = key
239
-
240
221
if elements is not None :
241
222
params ['elements' ] = elements
242
-
243
223
if required is not None :
244
224
params ['required' ] = required
245
-
246
225
if default is not None :
247
226
params ['default' ] = default
248
-
249
227
if array is not None :
250
228
params ['array' ] = array
251
-
252
229
return self .client .call ('post' , path , {
253
230
'content-type' : 'application/json' ,
254
231
}, params )
@@ -271,22 +248,16 @@ def create_float_attribute(self, collection_id, key, required, min = None, max =
271
248
272
249
if key is not None :
273
250
params ['key' ] = key
274
-
275
251
if required is not None :
276
252
params ['required' ] = required
277
-
278
253
if min is not None :
279
254
params ['min' ] = min
280
-
281
255
if max is not None :
282
256
params ['max' ] = max
283
-
284
257
if default is not None :
285
258
params ['default' ] = default
286
-
287
259
if array is not None :
288
260
params ['array' ] = array
289
-
290
261
return self .client .call ('post' , path , {
291
262
'content-type' : 'application/json' ,
292
263
}, params )
@@ -309,22 +280,16 @@ def create_integer_attribute(self, collection_id, key, required, min = None, max
309
280
310
281
if key is not None :
311
282
params ['key' ] = key
312
-
313
283
if required is not None :
314
284
params ['required' ] = required
315
-
316
285
if min is not None :
317
286
params ['min' ] = min
318
-
319
287
if max is not None :
320
288
params ['max' ] = max
321
-
322
289
if default is not None :
323
290
params ['default' ] = default
324
-
325
291
if array is not None :
326
292
params ['array' ] = array
327
-
328
293
return self .client .call ('post' , path , {
329
294
'content-type' : 'application/json' ,
330
295
}, params )
@@ -347,16 +312,12 @@ def create_ip_attribute(self, collection_id, key, required, default = None, arra
347
312
348
313
if key is not None :
349
314
params ['key' ] = key
350
-
351
315
if required is not None :
352
316
params ['required' ] = required
353
-
354
317
if default is not None :
355
318
params ['default' ] = default
356
-
357
319
if array is not None :
358
320
params ['array' ] = array
359
-
360
321
return self .client .call ('post' , path , {
361
322
'content-type' : 'application/json' ,
362
323
}, params )
@@ -382,19 +343,14 @@ def create_string_attribute(self, collection_id, key, size, required, default =
382
343
383
344
if key is not None :
384
345
params ['key' ] = key
385
-
386
346
if size is not None :
387
347
params ['size' ] = size
388
-
389
348
if required is not None :
390
349
params ['required' ] = required
391
-
392
350
if default is not None :
393
351
params ['default' ] = default
394
-
395
352
if array is not None :
396
353
params ['array' ] = array
397
-
398
354
return self .client .call ('post' , path , {
399
355
'content-type' : 'application/json' ,
400
356
}, params )
@@ -417,16 +373,12 @@ def create_url_attribute(self, collection_id, key, required, default = None, arr
417
373
418
374
if key is not None :
419
375
params ['key' ] = key
420
-
421
376
if required is not None :
422
377
params ['required' ] = required
423
-
424
378
if default is not None :
425
379
params ['default' ] = default
426
-
427
380
if array is not None :
428
381
params ['array' ] = array
429
-
430
382
return self .client .call ('post' , path , {
431
383
'content-type' : 'application/json' ,
432
384
}, params )
@@ -520,16 +472,12 @@ def create_document(self, collection_id, document_id, data, read = None, write =
520
472
521
473
if document_id is not None :
522
474
params ['documentId' ] = document_id
523
-
524
475
if data is not None :
525
476
params ['data' ] = data
526
-
527
477
if read is not None :
528
478
params ['read' ] = read
529
-
530
479
if write is not None :
531
480
params ['write' ] = write
532
-
533
481
return self .client .call ('post' , path , {
534
482
'content-type' : 'application/json' ,
535
483
}, params )
@@ -571,13 +519,10 @@ def update_document(self, collection_id, document_id, data, read = None, write =
571
519
572
520
if data is not None :
573
521
params ['data' ] = data
574
-
575
522
if read is not None :
576
523
params ['read' ] = read
577
-
578
524
if write is not None :
579
525
params ['write' ] = write
580
-
581
526
return self .client .call ('patch' , path , {
582
527
'content-type' : 'application/json' ,
583
528
}, params )
@@ -635,16 +580,12 @@ def create_index(self, collection_id, key, type, attributes, orders = None):
635
580
636
581
if key is not None :
637
582
params ['key' ] = key
638
-
639
583
if type is not None :
640
584
params ['type' ] = type
641
-
642
585
if attributes is not None :
643
586
params ['attributes' ] = attributes
644
-
645
587
if orders is not None :
646
588
params ['orders' ] = orders
647
-
648
589
return self .client .call ('post' , path , {
649
590
'content-type' : 'application/json' ,
650
591
}, params )
0 commit comments