appwrite 5.0.0 → 7.0.0.pre.RC2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +32 -11
  3. data/lib/appwrite/id.rb +11 -0
  4. data/lib/appwrite/input_file.rb +33 -0
  5. data/lib/appwrite/models/account.rb +82 -0
  6. data/lib/appwrite/models/algo_argon2.rb +37 -0
  7. data/lib/appwrite/models/algo_bcrypt.rb +22 -0
  8. data/lib/appwrite/models/algo_md5.rb +22 -0
  9. data/lib/appwrite/models/algo_phpass.rb +22 -0
  10. data/lib/appwrite/models/algo_scrypt.rb +42 -0
  11. data/lib/appwrite/models/algo_scrypt_modified.rb +37 -0
  12. data/lib/appwrite/models/algo_sha.rb +22 -0
  13. data/lib/appwrite/models/attribute_datetime.rb +57 -0
  14. data/lib/appwrite/models/bucket.rb +25 -25
  15. data/lib/appwrite/models/collection.rb +25 -15
  16. data/lib/appwrite/models/database.rb +42 -0
  17. data/lib/appwrite/models/database_list.rb +32 -0
  18. data/lib/appwrite/models/deployment.rb +10 -5
  19. data/lib/appwrite/models/document.rb +15 -10
  20. data/lib/appwrite/models/execution.rb +20 -10
  21. data/lib/appwrite/models/file.rb +15 -15
  22. data/lib/appwrite/models/function.rb +12 -12
  23. data/lib/appwrite/models/index.rb +1 -1
  24. data/lib/appwrite/models/membership.rb +10 -0
  25. data/lib/appwrite/models/session.rb +5 -0
  26. data/lib/appwrite/models/team.rb +10 -5
  27. data/lib/appwrite/models/token.rb +5 -0
  28. data/lib/appwrite/models/user.rb +35 -0
  29. data/lib/appwrite/models/variable.rb +52 -0
  30. data/lib/appwrite/models/variable_list.rb +32 -0
  31. data/lib/appwrite/permission.rb +21 -0
  32. data/lib/appwrite/query.rb +43 -14
  33. data/lib/appwrite/role.rb +31 -0
  34. data/lib/appwrite/services/account.rb +250 -103
  35. data/lib/appwrite/services/avatars.rb +73 -56
  36. data/lib/appwrite/services/databases.rb +1425 -0
  37. data/lib/appwrite/services/functions.rb +381 -176
  38. data/lib/appwrite/services/health.rb +34 -10
  39. data/lib/appwrite/services/locale.rb +25 -7
  40. data/lib/appwrite/services/storage.rb +195 -193
  41. data/lib/appwrite/services/teams.rb +138 -128
  42. data/lib/appwrite/services/users.rb +610 -130
  43. data/lib/appwrite.rb +19 -2
  44. metadata +22 -6
  45. data/lib/appwrite/file.rb +0 -17
  46. data/lib/appwrite/services/database.rb +0 -1047
@@ -3,16 +3,21 @@
3
3
  module Appwrite
4
4
  class Account < Service
5
5
 
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
6
10
  # Get currently logged in user data as JSON object.
7
11
  #
8
12
  #
9
- # @return [User]
13
+ # @return [Account]
10
14
  def get()
15
+
11
16
  path = '/account'
12
17
 
13
18
  params = {
14
19
  }
15
-
20
+
16
21
  headers = {
17
22
  "content-type": 'application/json',
18
23
  }
@@ -22,10 +27,11 @@ module Appwrite
22
27
  path: path,
23
28
  headers: headers,
24
29
  params: params,
25
- response_type: Models::User
30
+ response_type: Models::Account
26
31
  )
27
32
  end
28
33
 
34
+
29
35
  # Update currently logged in user account email address. After changing user
30
36
  # address, the user confirmation status will get reset. A new confirmation
31
37
  # email is not sent automatically however you can use the send confirmation
@@ -35,18 +41,11 @@ module Appwrite
35
41
  # one, by passing an email address and a new password.
36
42
  #
37
43
  #
38
- # @param [string] email User email.
39
- # @param [string] password User password. Must be at least 8 chars.
44
+ # @param [String] email User email.
45
+ # @param [String] password User password. Must be at least 8 chars.
40
46
  #
41
- # @return [User]
47
+ # @return [Account]
42
48
  def update_email(email:, password:)
43
- if email.nil?
44
- raise Appwrite::Exception.new('Missing required parameter: "email"')
45
- end
46
-
47
- if password.nil?
48
- raise Appwrite::Exception.new('Missing required parameter: "password"')
49
- end
50
49
 
51
50
  path = '/account/email'
52
51
 
@@ -54,35 +53,43 @@ module Appwrite
54
53
  email: email,
55
54
  password: password,
56
55
  }
57
-
56
+
58
57
  headers = {
59
58
  "content-type": 'application/json',
60
59
  }
60
+ if email.nil?
61
+ raise Appwrite::Exception.new('Missing required parameter: "email"')
62
+ end
63
+
64
+ if password.nil?
65
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
66
+ end
67
+
61
68
 
62
69
  @client.call(
63
70
  method: 'PATCH',
64
71
  path: path,
65
72
  headers: headers,
66
73
  params: params,
67
- response_type: Models::User
74
+ response_type: Models::Account
68
75
  )
69
76
  end
70
77
 
78
+
71
79
  # Get currently logged in user list of latest security activity logs. Each
72
80
  # log returns user IP address, location and date and time of log.
73
81
  #
74
- # @param [number] limit Maximum number of logs to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
75
- # @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
82
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset
76
83
  #
77
84
  # @return [LogList]
78
- def get_logs(limit: nil, offset: nil)
85
+ def get_logs(queries: nil)
86
+
79
87
  path = '/account/logs'
80
88
 
81
89
  params = {
82
- limit: limit,
83
- offset: offset,
90
+ queries: queries,
84
91
  }
85
-
92
+
86
93
  headers = {
87
94
  "content-type": 'application/json',
88
95
  }
@@ -96,47 +103,47 @@ module Appwrite
96
103
  )
97
104
  end
98
105
 
106
+
99
107
  # Update currently logged in user account name.
100
108
  #
101
- # @param [string] name User name. Max length: 128 chars.
109
+ # @param [String] name User name. Max length: 128 chars.
102
110
  #
103
- # @return [User]
111
+ # @return [Account]
104
112
  def update_name(name:)
105
- if name.nil?
106
- raise Appwrite::Exception.new('Missing required parameter: "name"')
107
- end
108
113
 
109
114
  path = '/account/name'
110
115
 
111
116
  params = {
112
117
  name: name,
113
118
  }
114
-
119
+
115
120
  headers = {
116
121
  "content-type": 'application/json',
117
122
  }
123
+ if name.nil?
124
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
125
+ end
126
+
118
127
 
119
128
  @client.call(
120
129
  method: 'PATCH',
121
130
  path: path,
122
131
  headers: headers,
123
132
  params: params,
124
- response_type: Models::User
133
+ response_type: Models::Account
125
134
  )
126
135
  end
127
136
 
137
+
128
138
  # Update currently logged in user password. For validation, user is required
129
139
  # to pass in the new password, and the old password. For users created with
130
140
  # OAuth, Team Invites and Magic URL, oldPassword is optional.
131
141
  #
132
- # @param [string] password New user password. Must be at least 8 chars.
133
- # @param [string] old_password Current user password. Must be at least 8 chars.
142
+ # @param [String] password New user password. Must be at least 8 chars.
143
+ # @param [String] old_password Current user password. Must be at least 8 chars.
134
144
  #
135
- # @return [User]
145
+ # @return [Account]
136
146
  def update_password(password:, old_password: nil)
137
- if password.nil?
138
- raise Appwrite::Exception.new('Missing required parameter: "password"')
139
- end
140
147
 
141
148
  path = '/account/password'
142
149
 
@@ -144,30 +151,77 @@ module Appwrite
144
151
  password: password,
145
152
  oldPassword: old_password,
146
153
  }
154
+
155
+ headers = {
156
+ "content-type": 'application/json',
157
+ }
158
+ if password.nil?
159
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
160
+ end
161
+
147
162
 
163
+ @client.call(
164
+ method: 'PATCH',
165
+ path: path,
166
+ headers: headers,
167
+ params: params,
168
+ response_type: Models::Account
169
+ )
170
+ end
171
+
172
+
173
+ # Update the currently logged in user's phone number. After updating the
174
+ # phone number, the phone verification status will be reset. A confirmation
175
+ # SMS is not sent automatically, however you can use the [POST
176
+ # /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)
177
+ # endpoint to send a confirmation SMS.
178
+ #
179
+ # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
180
+ # @param [String] password User password. Must be at least 8 chars.
181
+ #
182
+ # @return [Account]
183
+ def update_phone(phone:, password:)
184
+
185
+ path = '/account/phone'
186
+
187
+ params = {
188
+ phone: phone,
189
+ password: password,
190
+ }
191
+
148
192
  headers = {
149
193
  "content-type": 'application/json',
150
194
  }
195
+ if phone.nil?
196
+ raise Appwrite::Exception.new('Missing required parameter: "phone"')
197
+ end
198
+
199
+ if password.nil?
200
+ raise Appwrite::Exception.new('Missing required parameter: "password"')
201
+ end
202
+
151
203
 
152
204
  @client.call(
153
205
  method: 'PATCH',
154
206
  path: path,
155
207
  headers: headers,
156
208
  params: params,
157
- response_type: Models::User
209
+ response_type: Models::Account
158
210
  )
159
211
  end
160
212
 
213
+
161
214
  # Get currently logged in user preferences as a key-value object.
162
215
  #
163
216
  #
164
217
  # @return [Preferences]
165
218
  def get_prefs()
219
+
166
220
  path = '/account/prefs'
167
221
 
168
222
  params = {
169
223
  }
170
-
224
+
171
225
  headers = {
172
226
  "content-type": 'application/json',
173
227
  }
@@ -181,37 +235,40 @@ module Appwrite
181
235
  )
182
236
  end
183
237
 
238
+
184
239
  # Update currently logged in user account preferences. The object you pass is
185
240
  # stored as is, and replaces any previous value. The maximum allowed prefs
186
241
  # size is 64kB and throws error if exceeded.
187
242
  #
188
- # @param [object] prefs Prefs key-value JSON object.
243
+ # @param [Hash] prefs Prefs key-value JSON object.
189
244
  #
190
- # @return [User]
245
+ # @return [Account]
191
246
  def update_prefs(prefs:)
192
- if prefs.nil?
193
- raise Appwrite::Exception.new('Missing required parameter: "prefs"')
194
- end
195
247
 
196
248
  path = '/account/prefs'
197
249
 
198
250
  params = {
199
251
  prefs: prefs,
200
252
  }
201
-
253
+
202
254
  headers = {
203
255
  "content-type": 'application/json',
204
256
  }
257
+ if prefs.nil?
258
+ raise Appwrite::Exception.new('Missing required parameter: "prefs"')
259
+ end
260
+
205
261
 
206
262
  @client.call(
207
263
  method: 'PATCH',
208
264
  path: path,
209
265
  headers: headers,
210
266
  params: params,
211
- response_type: Models::User
267
+ response_type: Models::Account
212
268
  )
213
269
  end
214
270
 
271
+
215
272
  # Sends the user an email with a temporary secret key for password reset.
216
273
  # When the user clicks the confirmation link he is redirected back to your
217
274
  # app password reset URL with the secret key and email address values
@@ -221,18 +278,11 @@ module Appwrite
221
278
  # complete the process. The verification link sent to the user's email
222
279
  # address is valid for 1 hour.
223
280
  #
224
- # @param [string] email User email.
225
- # @param [string] url URL to redirect the user back to your app from the recovery 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.
281
+ # @param [String] email User email.
282
+ # @param [String] url URL to redirect the user back to your app from the recovery 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.
226
283
  #
227
284
  # @return [Token]
228
285
  def create_recovery(email:, url:)
229
- if email.nil?
230
- raise Appwrite::Exception.new('Missing required parameter: "email"')
231
- end
232
-
233
- if url.nil?
234
- raise Appwrite::Exception.new('Missing required parameter: "url"')
235
- end
236
286
 
237
287
  path = '/account/recovery'
238
288
 
@@ -240,10 +290,18 @@ module Appwrite
240
290
  email: email,
241
291
  url: url,
242
292
  }
243
-
293
+
244
294
  headers = {
245
295
  "content-type": 'application/json',
246
296
  }
297
+ if email.nil?
298
+ raise Appwrite::Exception.new('Missing required parameter: "email"')
299
+ end
300
+
301
+ if url.nil?
302
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
303
+ end
304
+
247
305
 
248
306
  @client.call(
249
307
  method: 'POST',
@@ -254,6 +312,7 @@ module Appwrite
254
312
  )
255
313
  end
256
314
 
315
+
257
316
  # Use this endpoint to complete the user account password reset. Both the
258
317
  # **userId** and **secret** arguments will be passed as query parameters to
259
318
  # the redirect URL you have provided when sending your request to the [POST
@@ -264,13 +323,26 @@ module Appwrite
264
323
  # the only valid redirect URLs are the ones from domains you have set when
265
324
  # adding your platforms in the console interface.
266
325
  #
267
- # @param [string] user_id User ID.
268
- # @param [string] secret Valid reset token.
269
- # @param [string] password New user password. Must be at least 8 chars.
270
- # @param [string] password_again Repeat new user password. Must be at least 8 chars.
326
+ # @param [String] user_id User ID.
327
+ # @param [String] secret Valid reset token.
328
+ # @param [String] password New user password. Must be at least 8 chars.
329
+ # @param [String] password_again Repeat new user password. Must be at least 8 chars.
271
330
  #
272
331
  # @return [Token]
273
332
  def update_recovery(user_id:, secret:, password:, password_again:)
333
+
334
+ path = '/account/recovery'
335
+
336
+ params = {
337
+ userId: user_id,
338
+ secret: secret,
339
+ password: password,
340
+ passwordAgain: password_again,
341
+ }
342
+
343
+ headers = {
344
+ "content-type": 'application/json',
345
+ }
274
346
  if user_id.nil?
275
347
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
276
348
  end
@@ -287,18 +359,6 @@ module Appwrite
287
359
  raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"')
288
360
  end
289
361
 
290
- path = '/account/recovery'
291
-
292
- params = {
293
- userId: user_id,
294
- secret: secret,
295
- password: password,
296
- passwordAgain: password_again,
297
- }
298
-
299
- headers = {
300
- "content-type": 'application/json',
301
- }
302
362
 
303
363
  @client.call(
304
364
  method: 'PUT',
@@ -309,17 +369,19 @@ module Appwrite
309
369
  )
310
370
  end
311
371
 
372
+
312
373
  # Get currently logged in user list of active sessions across different
313
374
  # devices.
314
375
  #
315
376
  #
316
377
  # @return [SessionList]
317
378
  def get_sessions()
379
+
318
380
  path = '/account/sessions'
319
381
 
320
382
  params = {
321
383
  }
322
-
384
+
323
385
  headers = {
324
386
  "content-type": 'application/json',
325
387
  }
@@ -333,17 +395,19 @@ module Appwrite
333
395
  )
334
396
  end
335
397
 
398
+
336
399
  # Delete all sessions from the user account and remove any sessions cookies
337
400
  # from the end client.
338
401
  #
339
402
  #
340
403
  # @return []
341
404
  def delete_sessions()
405
+
342
406
  path = '/account/sessions'
343
407
 
344
408
  params = {
345
409
  }
346
-
410
+
347
411
  headers = {
348
412
  "content-type": 'application/json',
349
413
  }
@@ -356,26 +420,28 @@ module Appwrite
356
420
  )
357
421
  end
358
422
 
423
+
359
424
  # Use this endpoint to get a logged in user's session using a Session ID.
360
425
  # Inputting 'current' will return the current session being used.
361
426
  #
362
- # @param [string] session_id Session ID. Use the string &#039;current&#039; to get the current device session.
427
+ # @param [String] session_id Session ID. Use the string 'current' to get the current device session.
363
428
  #
364
429
  # @return [Session]
365
430
  def get_session(session_id:)
366
- if session_id.nil?
367
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
368
- end
369
431
 
370
432
  path = '/account/sessions/{sessionId}'
371
- .gsub('{sessionId}', session_id)
372
433
 
373
434
  params = {
374
435
  }
375
-
436
+
376
437
  headers = {
377
438
  "content-type": 'application/json',
378
439
  }
440
+ if session_id.nil?
441
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
442
+ end
443
+
444
+ .gsub('{sessionId}', session_id)
379
445
 
380
446
  @client.call(
381
447
  method: 'GET',
@@ -386,27 +452,29 @@ module Appwrite
386
452
  )
387
453
  end
388
454
 
455
+
389
456
  # Access tokens have limited lifespan and expire to mitigate security risks.
390
457
  # If session was created using an OAuth provider, this route can be used to
391
458
  # "refresh" the access token.
392
459
  #
393
- # @param [string] session_id Session ID. Use the string &#039;current&#039; to update the current device session.
460
+ # @param [String] session_id Session ID. Use the string 'current' to update the current device session.
394
461
  #
395
462
  # @return [Session]
396
463
  def update_session(session_id:)
397
- if session_id.nil?
398
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
399
- end
400
464
 
401
465
  path = '/account/sessions/{sessionId}'
402
- .gsub('{sessionId}', session_id)
403
466
 
404
467
  params = {
405
468
  }
406
-
469
+
407
470
  headers = {
408
471
  "content-type": 'application/json',
409
472
  }
473
+ if session_id.nil?
474
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
475
+ end
476
+
477
+ .gsub('{sessionId}', session_id)
410
478
 
411
479
  @client.call(
412
480
  method: 'PATCH',
@@ -417,28 +485,30 @@ module Appwrite
417
485
  )
418
486
  end
419
487
 
488
+
420
489
  # Use this endpoint to log out the currently logged in user from all their
421
490
  # account sessions across all of their different devices. When using the
422
491
  # Session ID argument, only the unique session ID provided is deleted.
423
492
  #
424
493
  #
425
- # @param [string] session_id Session ID. Use the string &#039;current&#039; to delete the current device session.
494
+ # @param [String] session_id Session ID. Use the string 'current' to delete the current device session.
426
495
  #
427
496
  # @return []
428
497
  def delete_session(session_id:)
429
- if session_id.nil?
430
- raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
431
- end
432
498
 
433
499
  path = '/account/sessions/{sessionId}'
434
- .gsub('{sessionId}', session_id)
435
500
 
436
501
  params = {
437
502
  }
438
-
503
+
439
504
  headers = {
440
505
  "content-type": 'application/json',
441
506
  }
507
+ if session_id.nil?
508
+ raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
509
+ end
510
+
511
+ .gsub('{sessionId}', session_id)
442
512
 
443
513
  @client.call(
444
514
  method: 'DELETE',
@@ -448,18 +518,20 @@ module Appwrite
448
518
  )
449
519
  end
450
520
 
521
+
451
522
  # Block the currently logged in user account. Behind the scene, the user
452
523
  # record is not deleted but permanently blocked from any access. To
453
524
  # completely delete a user, use the Users API instead.
454
525
  #
455
526
  #
456
- # @return [User]
527
+ # @return [Account]
457
528
  def update_status()
529
+
458
530
  path = '/account/status'
459
531
 
460
532
  params = {
461
533
  }
462
-
534
+
463
535
  headers = {
464
536
  "content-type": 'application/json',
465
537
  }
@@ -469,10 +541,11 @@ module Appwrite
469
541
  path: path,
470
542
  headers: headers,
471
543
  params: params,
472
- response_type: Models::User
544
+ response_type: Models::Account
473
545
  )
474
546
  end
475
547
 
548
+
476
549
  # Use this endpoint to send a verification message to your user email address
477
550
  # to confirm they are the valid owners of that address. Both the **userId**
478
551
  # and **secret** arguments will be passed as query parameters to the URL you
@@ -480,8 +553,8 @@ module Appwrite
480
553
  # should redirect the user back to your app and allow you to complete the
481
554
  # verification process by verifying both the **userId** and **secret**
482
555
  # parameters. Learn more about how to [complete the verification
483
- # process](/docs/client/account#accountUpdateVerification). The verification
484
- # link sent to the user's email address is valid for 7 days.
556
+ # process](/docs/client/account#accountUpdateEmailVerification). The
557
+ # verification link sent to the user's email address is valid for 7 days.
485
558
  #
486
559
  # Please note that in order to avoid a [Redirect
487
560
  # Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
@@ -489,23 +562,24 @@ module Appwrite
489
562
  # adding your platforms in the console interface.
490
563
  #
491
564
  #
492
- # @param [string] url URL to redirect the user back to your app from the verification 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.
565
+ # @param [String] url URL to redirect the user back to your app from the verification 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.
493
566
  #
494
567
  # @return [Token]
495
568
  def create_verification(url:)
496
- if url.nil?
497
- raise Appwrite::Exception.new('Missing required parameter: "url"')
498
- end
499
569
 
500
570
  path = '/account/verification'
501
571
 
502
572
  params = {
503
573
  url: url,
504
574
  }
505
-
575
+
506
576
  headers = {
507
577
  "content-type": 'application/json',
508
578
  }
579
+ if url.nil?
580
+ raise Appwrite::Exception.new('Missing required parameter: "url"')
581
+ end
582
+
509
583
 
510
584
  @client.call(
511
585
  method: 'POST',
@@ -516,16 +590,28 @@ module Appwrite
516
590
  )
517
591
  end
518
592
 
593
+
519
594
  # Use this endpoint to complete the user email verification process. Use both
520
595
  # the **userId** and **secret** parameters that were attached to your app URL
521
596
  # to verify the user email ownership. If confirmed this route will return a
522
597
  # 200 status code.
523
598
  #
524
- # @param [string] user_id User ID.
525
- # @param [string] secret Valid verification token.
599
+ # @param [String] user_id User ID.
600
+ # @param [String] secret Valid verification token.
526
601
  #
527
602
  # @return [Token]
528
603
  def update_verification(user_id:, secret:)
604
+
605
+ path = '/account/verification'
606
+
607
+ params = {
608
+ userId: user_id,
609
+ secret: secret,
610
+ }
611
+
612
+ headers = {
613
+ "content-type": 'application/json',
614
+ }
529
615
  if user_id.nil?
530
616
  raise Appwrite::Exception.new('Missing required parameter: "userId"')
531
617
  end
@@ -534,16 +620,76 @@ module Appwrite
534
620
  raise Appwrite::Exception.new('Missing required parameter: "secret"')
535
621
  end
536
622
 
537
- path = '/account/verification'
623
+
624
+ @client.call(
625
+ method: 'PUT',
626
+ path: path,
627
+ headers: headers,
628
+ params: params,
629
+ response_type: Models::Token
630
+ )
631
+ end
632
+
633
+
634
+ # Use this endpoint to send a verification SMS to the currently logged in
635
+ # user. This endpoint is meant for use after updating a user's phone number
636
+ # using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)
637
+ # endpoint. Learn more about how to [complete the verification
638
+ # process](/docs/client/account#accountUpdatePhoneVerification). The
639
+ # verification code sent to the user's phone number is valid for 15 minutes.
640
+ #
641
+ #
642
+ # @return [Token]
643
+ def create_phone_verification()
644
+
645
+ path = '/account/verification/phone'
646
+
647
+ params = {
648
+ }
649
+
650
+ headers = {
651
+ "content-type": 'application/json',
652
+ }
653
+
654
+ @client.call(
655
+ method: 'POST',
656
+ path: path,
657
+ headers: headers,
658
+ params: params,
659
+ response_type: Models::Token
660
+ )
661
+ end
662
+
663
+
664
+ # Use this endpoint to complete the user phone verification process. Use the
665
+ # **userId** and **secret** that were sent to your user's phone number to
666
+ # verify the user email ownership. If confirmed this route will return a 200
667
+ # status code.
668
+ #
669
+ # @param [String] user_id User ID.
670
+ # @param [String] secret Valid verification token.
671
+ #
672
+ # @return [Token]
673
+ def update_phone_verification(user_id:, secret:)
674
+
675
+ path = '/account/verification/phone'
538
676
 
539
677
  params = {
540
678
  userId: user_id,
541
679
  secret: secret,
542
680
  }
543
-
681
+
544
682
  headers = {
545
683
  "content-type": 'application/json',
546
684
  }
685
+ if user_id.nil?
686
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
687
+ end
688
+
689
+ if secret.nil?
690
+ raise Appwrite::Exception.new('Missing required parameter: "secret"')
691
+ end
692
+
547
693
 
548
694
  @client.call(
549
695
  method: 'PUT',
@@ -554,5 +700,6 @@ module Appwrite
554
700
  )
555
701
  end
556
702
 
703
+
557
704
  end
558
705
  end