appwrite 9.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,20 +17,20 @@ module Appwrite
17
17
  def list_buckets(queries: nil, search: nil)
18
18
  api_path = '/storage/buckets'
19
19
 
20
- params = {
20
+ api_params = {
21
21
  queries: queries,
22
22
  search: search,
23
23
  }
24
24
 
25
- headers = {
25
+ api_headers = {
26
26
  "content-type": 'application/json',
27
27
  }
28
28
 
29
29
  @client.call(
30
30
  method: 'GET',
31
31
  path: api_path,
32
- headers: headers,
33
- params: params,
32
+ headers: api_headers,
33
+ params: api_params,
34
34
  response_type: Models::BucketList
35
35
  )
36
36
  end
@@ -61,7 +61,7 @@ module Appwrite
61
61
  raise Appwrite::Exception.new('Missing required parameter: "name"')
62
62
  end
63
63
 
64
- params = {
64
+ api_params = {
65
65
  bucketId: bucket_id,
66
66
  name: name,
67
67
  permissions: permissions,
@@ -74,15 +74,15 @@ module Appwrite
74
74
  antivirus: antivirus,
75
75
  }
76
76
 
77
- headers = {
77
+ api_headers = {
78
78
  "content-type": 'application/json',
79
79
  }
80
80
 
81
81
  @client.call(
82
82
  method: 'POST',
83
83
  path: api_path,
84
- headers: headers,
85
- params: params,
84
+ headers: api_headers,
85
+ params: api_params,
86
86
  response_type: Models::Bucket
87
87
  )
88
88
  end
@@ -102,18 +102,18 @@ module Appwrite
102
102
  raise Appwrite::Exception.new('Missing required parameter: "bucketId"')
103
103
  end
104
104
 
105
- params = {
105
+ api_params = {
106
106
  }
107
107
 
108
- headers = {
108
+ api_headers = {
109
109
  "content-type": 'application/json',
110
110
  }
111
111
 
112
112
  @client.call(
113
113
  method: 'GET',
114
114
  path: api_path,
115
- headers: headers,
116
- params: params,
115
+ headers: api_headers,
116
+ params: api_params,
117
117
  response_type: Models::Bucket
118
118
  )
119
119
  end
@@ -145,7 +145,7 @@ module Appwrite
145
145
  raise Appwrite::Exception.new('Missing required parameter: "name"')
146
146
  end
147
147
 
148
- params = {
148
+ api_params = {
149
149
  name: name,
150
150
  permissions: permissions,
151
151
  fileSecurity: file_security,
@@ -157,15 +157,15 @@ module Appwrite
157
157
  antivirus: antivirus,
158
158
  }
159
159
 
160
- headers = {
160
+ api_headers = {
161
161
  "content-type": 'application/json',
162
162
  }
163
163
 
164
164
  @client.call(
165
165
  method: 'PUT',
166
166
  path: api_path,
167
- headers: headers,
168
- params: params,
167
+ headers: api_headers,
168
+ params: api_params,
169
169
  response_type: Models::Bucket
170
170
  )
171
171
  end
@@ -184,18 +184,18 @@ module Appwrite
184
184
  raise Appwrite::Exception.new('Missing required parameter: "bucketId"')
185
185
  end
186
186
 
187
- params = {
187
+ api_params = {
188
188
  }
189
189
 
190
- headers = {
190
+ api_headers = {
191
191
  "content-type": 'application/json',
192
192
  }
193
193
 
194
194
  @client.call(
195
195
  method: 'DELETE',
196
196
  path: api_path,
197
- headers: headers,
198
- params: params,
197
+ headers: api_headers,
198
+ params: api_params,
199
199
  )
200
200
  end
201
201
 
@@ -216,20 +216,20 @@ module Appwrite
216
216
  raise Appwrite::Exception.new('Missing required parameter: "bucketId"')
217
217
  end
218
218
 
219
- params = {
219
+ api_params = {
220
220
  queries: queries,
221
221
  search: search,
222
222
  }
223
223
 
224
- headers = {
224
+ api_headers = {
225
225
  "content-type": 'application/json',
226
226
  }
227
227
 
228
228
  @client.call(
229
229
  method: 'GET',
230
230
  path: api_path,
231
- headers: headers,
232
- params: params,
231
+ headers: api_headers,
232
+ params: api_params,
233
233
  response_type: Models::FileList
234
234
  )
235
235
  end
@@ -276,13 +276,13 @@ module Appwrite
276
276
  raise Appwrite::Exception.new('Missing required parameter: "file"')
277
277
  end
278
278
 
279
- params = {
279
+ api_params = {
280
280
  fileId: file_id,
281
281
  file: file,
282
282
  permissions: permissions,
283
283
  }
284
284
 
285
- headers = {
285
+ api_headers = {
286
286
  "content-type": 'multipart/form-data',
287
287
  }
288
288
 
@@ -291,8 +291,8 @@ module Appwrite
291
291
 
292
292
  @client.chunked_upload(
293
293
  path: api_path,
294
- headers: headers,
295
- params: params,
294
+ headers: api_headers,
295
+ params: api_params,
296
296
  param_name: param_name,
297
297
  id_param_name: id_param_name,
298
298
  on_progress: on_progress,
@@ -321,18 +321,18 @@ module Appwrite
321
321
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
322
322
  end
323
323
 
324
- params = {
324
+ api_params = {
325
325
  }
326
326
 
327
- headers = {
327
+ api_headers = {
328
328
  "content-type": 'application/json',
329
329
  }
330
330
 
331
331
  @client.call(
332
332
  method: 'GET',
333
333
  path: api_path,
334
- headers: headers,
335
- params: params,
334
+ headers: api_headers,
335
+ params: api_params,
336
336
  response_type: Models::File
337
337
  )
338
338
  end
@@ -360,20 +360,20 @@ module Appwrite
360
360
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
361
361
  end
362
362
 
363
- params = {
363
+ api_params = {
364
364
  name: name,
365
365
  permissions: permissions,
366
366
  }
367
367
 
368
- headers = {
368
+ api_headers = {
369
369
  "content-type": 'application/json',
370
370
  }
371
371
 
372
372
  @client.call(
373
373
  method: 'PUT',
374
374
  path: api_path,
375
- headers: headers,
376
- params: params,
375
+ headers: api_headers,
376
+ params: api_params,
377
377
  response_type: Models::File
378
378
  )
379
379
  end
@@ -399,18 +399,18 @@ module Appwrite
399
399
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
400
400
  end
401
401
 
402
- params = {
402
+ api_params = {
403
403
  }
404
404
 
405
- headers = {
405
+ api_headers = {
406
406
  "content-type": 'application/json',
407
407
  }
408
408
 
409
409
  @client.call(
410
410
  method: 'DELETE',
411
411
  path: api_path,
412
- headers: headers,
413
- params: params,
412
+ headers: api_headers,
413
+ params: api_params,
414
414
  )
415
415
  end
416
416
 
@@ -436,18 +436,18 @@ module Appwrite
436
436
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
437
437
  end
438
438
 
439
- params = {
439
+ api_params = {
440
440
  }
441
441
 
442
- headers = {
442
+ api_headers = {
443
443
  "content-type": 'application/json',
444
444
  }
445
445
 
446
446
  @client.call(
447
447
  method: 'GET',
448
448
  path: api_path,
449
- headers: headers,
450
- params: params,
449
+ headers: api_headers,
450
+ params: api_params,
451
451
  )
452
452
  end
453
453
 
@@ -486,7 +486,7 @@ module Appwrite
486
486
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
487
487
  end
488
488
 
489
- params = {
489
+ api_params = {
490
490
  width: width,
491
491
  height: height,
492
492
  gravity: gravity,
@@ -500,15 +500,15 @@ module Appwrite
500
500
  output: output,
501
501
  }
502
502
 
503
- headers = {
503
+ api_headers = {
504
504
  "content-type": 'application/json',
505
505
  }
506
506
 
507
507
  @client.call(
508
508
  method: 'GET',
509
509
  path: api_path,
510
- headers: headers,
511
- params: params,
510
+ headers: api_headers,
511
+ params: api_params,
512
512
  )
513
513
  end
514
514
 
@@ -534,18 +534,18 @@ module Appwrite
534
534
  raise Appwrite::Exception.new('Missing required parameter: "fileId"')
535
535
  end
536
536
 
537
- params = {
537
+ api_params = {
538
538
  }
539
539
 
540
- headers = {
540
+ api_headers = {
541
541
  "content-type": 'application/json',
542
542
  }
543
543
 
544
544
  @client.call(
545
545
  method: 'GET',
546
546
  path: api_path,
547
- headers: headers,
548
- params: params,
547
+ headers: api_headers,
548
+ params: api_params,
549
549
  )
550
550
  end
551
551
 
@@ -17,20 +17,20 @@ module Appwrite
17
17
  def list(queries: nil, search: nil)
18
18
  api_path = '/teams'
19
19
 
20
- params = {
20
+ api_params = {
21
21
  queries: queries,
22
22
  search: search,
23
23
  }
24
24
 
25
- headers = {
25
+ api_headers = {
26
26
  "content-type": 'application/json',
27
27
  }
28
28
 
29
29
  @client.call(
30
30
  method: 'GET',
31
31
  path: api_path,
32
- headers: headers,
33
- params: params,
32
+ headers: api_headers,
33
+ params: api_params,
34
34
  response_type: Models::TeamList
35
35
  )
36
36
  end
@@ -56,21 +56,21 @@ module Appwrite
56
56
  raise Appwrite::Exception.new('Missing required parameter: "name"')
57
57
  end
58
58
 
59
- params = {
59
+ api_params = {
60
60
  teamId: team_id,
61
61
  name: name,
62
62
  roles: roles,
63
63
  }
64
64
 
65
- headers = {
65
+ api_headers = {
66
66
  "content-type": 'application/json',
67
67
  }
68
68
 
69
69
  @client.call(
70
70
  method: 'POST',
71
71
  path: api_path,
72
- headers: headers,
73
- params: params,
72
+ headers: api_headers,
73
+ params: api_params,
74
74
  response_type: Models::Team
75
75
  )
76
76
  end
@@ -89,18 +89,18 @@ module Appwrite
89
89
  raise Appwrite::Exception.new('Missing required parameter: "teamId"')
90
90
  end
91
91
 
92
- params = {
92
+ api_params = {
93
93
  }
94
94
 
95
- headers = {
95
+ api_headers = {
96
96
  "content-type": 'application/json',
97
97
  }
98
98
 
99
99
  @client.call(
100
100
  method: 'GET',
101
101
  path: api_path,
102
- headers: headers,
103
- params: params,
102
+ headers: api_headers,
103
+ params: api_params,
104
104
  response_type: Models::Team
105
105
  )
106
106
  end
@@ -124,19 +124,19 @@ module Appwrite
124
124
  raise Appwrite::Exception.new('Missing required parameter: "name"')
125
125
  end
126
126
 
127
- params = {
127
+ api_params = {
128
128
  name: name,
129
129
  }
130
130
 
131
- headers = {
131
+ api_headers = {
132
132
  "content-type": 'application/json',
133
133
  }
134
134
 
135
135
  @client.call(
136
136
  method: 'PUT',
137
137
  path: api_path,
138
- headers: headers,
139
- params: params,
138
+ headers: api_headers,
139
+ params: api_params,
140
140
  response_type: Models::Team
141
141
  )
142
142
  end
@@ -156,18 +156,18 @@ module Appwrite
156
156
  raise Appwrite::Exception.new('Missing required parameter: "teamId"')
157
157
  end
158
158
 
159
- params = {
159
+ api_params = {
160
160
  }
161
161
 
162
- headers = {
162
+ api_headers = {
163
163
  "content-type": 'application/json',
164
164
  }
165
165
 
166
166
  @client.call(
167
167
  method: 'DELETE',
168
168
  path: api_path,
169
- headers: headers,
170
- params: params,
169
+ headers: api_headers,
170
+ params: api_params,
171
171
  )
172
172
  end
173
173
 
@@ -188,20 +188,20 @@ module Appwrite
188
188
  raise Appwrite::Exception.new('Missing required parameter: "teamId"')
189
189
  end
190
190
 
191
- params = {
191
+ api_params = {
192
192
  queries: queries,
193
193
  search: search,
194
194
  }
195
195
 
196
- headers = {
196
+ api_headers = {
197
197
  "content-type": 'application/json',
198
198
  }
199
199
 
200
200
  @client.call(
201
201
  method: 'GET',
202
202
  path: api_path,
203
- headers: headers,
204
- params: params,
203
+ headers: api_headers,
204
+ params: api_params,
205
205
  response_type: Models::MembershipList
206
206
  )
207
207
  end
@@ -231,14 +231,14 @@ module Appwrite
231
231
  #
232
232
  # @param [String] team_id Team ID.
233
233
  # @param [Array] roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
234
- # @param [String] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
235
234
  # @param [String] email Email of the new team member.
236
235
  # @param [String] user_id ID of the user to be added to a team.
237
236
  # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
237
+ # @param [String] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
238
238
  # @param [String] name Name of the new team member. Max length: 128 chars.
239
239
  #
240
240
  # @return [Membership]
241
- def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: nil, name: nil)
241
+ def create_membership(team_id:, roles:, email: nil, user_id: nil, phone: nil, url: nil, name: nil)
242
242
  api_path = '/teams/{teamId}/memberships'
243
243
  .gsub('{teamId}', team_id)
244
244
 
@@ -250,11 +250,7 @@ module Appwrite
250
250
  raise Appwrite::Exception.new('Missing required parameter: "roles"')
251
251
  end
252
252
 
253
- if url.nil?
254
- raise Appwrite::Exception.new('Missing required parameter: "url"')
255
- end
256
-
257
- params = {
253
+ api_params = {
258
254
  email: email,
259
255
  userId: user_id,
260
256
  phone: phone,
@@ -263,15 +259,15 @@ module Appwrite
263
259
  name: name,
264
260
  }
265
261
 
266
- headers = {
262
+ api_headers = {
267
263
  "content-type": 'application/json',
268
264
  }
269
265
 
270
266
  @client.call(
271
267
  method: 'POST',
272
268
  path: api_path,
273
- headers: headers,
274
- params: params,
269
+ headers: api_headers,
270
+ params: api_params,
275
271
  response_type: Models::Membership
276
272
  )
277
273
  end
@@ -297,18 +293,18 @@ module Appwrite
297
293
  raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
298
294
  end
299
295
 
300
- params = {
296
+ api_params = {
301
297
  }
302
298
 
303
- headers = {
299
+ api_headers = {
304
300
  "content-type": 'application/json',
305
301
  }
306
302
 
307
303
  @client.call(
308
304
  method: 'GET',
309
305
  path: api_path,
310
- headers: headers,
311
- params: params,
306
+ headers: api_headers,
307
+ params: api_params,
312
308
  response_type: Models::Membership
313
309
  )
314
310
  end
@@ -341,19 +337,19 @@ module Appwrite
341
337
  raise Appwrite::Exception.new('Missing required parameter: "roles"')
342
338
  end
343
339
 
344
- params = {
340
+ api_params = {
345
341
  roles: roles,
346
342
  }
347
343
 
348
- headers = {
344
+ api_headers = {
349
345
  "content-type": 'application/json',
350
346
  }
351
347
 
352
348
  @client.call(
353
349
  method: 'PATCH',
354
350
  path: api_path,
355
- headers: headers,
356
- params: params,
351
+ headers: api_headers,
352
+ params: api_params,
357
353
  response_type: Models::Membership
358
354
  )
359
355
  end
@@ -380,18 +376,18 @@ module Appwrite
380
376
  raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
381
377
  end
382
378
 
383
- params = {
379
+ api_params = {
384
380
  }
385
381
 
386
- headers = {
382
+ api_headers = {
387
383
  "content-type": 'application/json',
388
384
  }
389
385
 
390
386
  @client.call(
391
387
  method: 'DELETE',
392
388
  path: api_path,
393
- headers: headers,
394
- params: params,
389
+ headers: api_headers,
390
+ params: api_params,
395
391
  )
396
392
  end
397
393
 
@@ -431,20 +427,20 @@ module Appwrite
431
427
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
432
428
  end
433
429
 
434
- params = {
430
+ api_params = {
435
431
  userId: user_id,
436
432
  secret: secret,
437
433
  }
438
434
 
439
- headers = {
435
+ api_headers = {
440
436
  "content-type": 'application/json',
441
437
  }
442
438
 
443
439
  @client.call(
444
440
  method: 'PATCH',
445
441
  path: api_path,
446
- headers: headers,
447
- params: params,
442
+ headers: api_headers,
443
+ params: api_params,
448
444
  response_type: Models::Membership
449
445
  )
450
446
  end
@@ -465,18 +461,18 @@ module Appwrite
465
461
  raise Appwrite::Exception.new('Missing required parameter: "teamId"')
466
462
  end
467
463
 
468
- params = {
464
+ api_params = {
469
465
  }
470
466
 
471
- headers = {
467
+ api_headers = {
472
468
  "content-type": 'application/json',
473
469
  }
474
470
 
475
471
  @client.call(
476
472
  method: 'GET',
477
473
  path: api_path,
478
- headers: headers,
479
- params: params,
474
+ headers: api_headers,
475
+ params: api_params,
480
476
  response_type: Models::Preferences
481
477
  )
482
478
  end
@@ -502,19 +498,19 @@ module Appwrite
502
498
  raise Appwrite::Exception.new('Missing required parameter: "prefs"')
503
499
  end
504
500
 
505
- params = {
501
+ api_params = {
506
502
  prefs: prefs,
507
503
  }
508
504
 
509
- headers = {
505
+ api_headers = {
510
506
  "content-type": 'application/json',
511
507
  }
512
508
 
513
509
  @client.call(
514
510
  method: 'PUT',
515
511
  path: api_path,
516
- headers: headers,
517
- params: params,
512
+ headers: api_headers,
513
+ params: api_params,
518
514
  response_type: Models::Preferences
519
515
  )
520
516
  end