@@ -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