Class: Appwrite::Users
- Defined in:
- lib/appwrite/services/users.rb
Instance Method Summary collapse
-
#create(user_id:, email: nil, phone: nil, password: nil, name: nil) ⇒ User
Create a new user.
-
#create_argon2_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user.
-
#create_bcrypt_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user.
-
#create_jwt(user_id:, session_id: nil, duration: nil) ⇒ Jwt
Use this endpoint to create a JSON Web Token for user by its unique ID.
-
#create_md5_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user.
-
#create_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Generate recovery codes used as backup for MFA flow for User ID.
-
#create_ph_pass_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user.
-
#create_scrypt_modified_user(user_id:, email:, password:, password_salt:, password_salt_separator:, password_signer_key:, name: nil) ⇒ User
Create a new user.
-
#create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu:, password_memory:, password_parallel:, password_length:, name: nil) ⇒ User
Create a new user.
-
#create_session(user_id:) ⇒ Session
Creates a session for a user.
-
#create_sha_user(user_id:, email:, password:, password_version: nil, name: nil) ⇒ User
Create a new user.
-
#create_target(user_id:, target_id:, provider_type:, identifier:, provider_id: nil, name: nil) ⇒ Target
Create a messaging target.
-
#create_token(user_id:, length: nil, expire: nil) ⇒ Token
Returns a token with a secret key for creating a session.
-
#delete(user_id:) ⇒ Object
Delete a user by its unique ID, thereby releasing it's ID.
-
#delete_identity(identity_id:) ⇒ Object
Delete an identity by its unique ID.
-
#delete_mfa_authenticator(user_id:, type:) ⇒ Object
Delete an authenticator app.
-
#delete_passkey(user_id:, passkey_id:) ⇒ Object
Delete a passkey from a user, for example when a device is lost.
-
#delete_session(user_id:, session_id:) ⇒ Object
Delete a user sessions by its unique ID.
-
#delete_sessions(user_id:) ⇒ Object
Delete all user's sessions by using the user's unique ID.
-
#delete_target(user_id:, target_id:) ⇒ Object
Delete a messaging target.
-
#get(user_id:) ⇒ User
Get a user by its unique ID.
-
#get_mfa_challenge(user_id:, challenge_id:) ⇒ MfaChallengeSecret
Get a custom MFA challenge for a user, including the code to be delivered through your own channel.
-
#get_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Get recovery codes that can be used as backup for MFA flow by User ID.
-
#get_passkey(user_id:, passkey_id:) ⇒ Passkey
Get a verified passkey of a user by its unique ID.
-
#get_prefs(user_id:) ⇒ Preferences
Get the user preferences by its unique ID.
-
#get_target(user_id:, target_id:) ⇒ Target
Get a user's push notification target by ID.
-
#initialize(client) ⇒ Users
constructor
A new instance of Users.
-
#list(queries: nil, search: nil, total: nil) ⇒ UserList
Get a list of all the project's users.
-
#list_identities(queries: nil, search: nil, total: nil) ⇒ IdentityList
Get identities for all users.
-
#list_memberships(user_id:, queries: nil, search: nil, total: nil) ⇒ MembershipList
Get the user membership list by its unique ID.
-
#list_mfa_factors(user_id:) ⇒ MfaFactors
List the factors available on the account to be used as a MFA challange.
-
#list_passkeys(user_id:, queries: nil, total: nil) ⇒ PasskeyList
Get the list of verified passkeys registered by a user.
-
#list_sessions(user_id:, total: nil) ⇒ SessionList
Get the user sessions list by its unique ID.
-
#list_targets(user_id:, queries: nil, total: nil) ⇒ TargetList
List the messaging targets that are associated with a user.
-
#update_email(user_id:, email:) ⇒ User
Update the user email by its unique ID.
-
#update_email_verification(user_id:, email_verification:) ⇒ User
Update the user email verification status by its unique ID.
-
#update_impersonator(user_id:, impersonator:) ⇒ User
Enable or disable whether a user can impersonate other users.
-
#update_labels(user_id:, labels:) ⇒ User
Update the user labels by its unique ID.
-
#update_mfa(user_id:, mfa:) ⇒ User
Enable or disable MFA on a user account.
-
#update_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Regenerate recovery codes that can be used as backup for MFA flow by User ID.
-
#update_name(user_id:, name:) ⇒ User
Update the user name by its unique ID.
-
#update_passkey(user_id:, passkey_id:, name:) ⇒ Passkey
Rename a passkey of a user.
-
#update_password(user_id:, password:) ⇒ User
Update the user password by its unique ID.
-
#update_phone(user_id:, number:) ⇒ User
Update the user phone by its unique ID.
-
#update_phone_verification(user_id:, phone_verification:) ⇒ User
Update the user phone verification status by its unique ID.
-
#update_prefs(user_id:, prefs:) ⇒ Preferences
Update the user preferences by its unique ID.
-
#update_status(user_id:, status:) ⇒ User
Update the user status by its unique ID.
-
#update_target(user_id:, target_id:, identifier: nil, provider_id: nil, name: nil) ⇒ Target
Update a messaging target.
Constructor Details
#initialize(client) ⇒ Users
Returns a new instance of Users.
5 6 7 |
# File 'lib/appwrite/services/users.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#create(user_id:, email: nil, phone: nil, password: nil, name: nil) ⇒ User
Create a new user.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/appwrite/services/users.rb', line 53 def create( user_id:, email: nil, phone: nil, password: nil, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users' api_params = { userId: user_id, email: email, phone: phone, password: password, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_argon2_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the Argon2 algorithm. Use the POST /users endpoint to create users with a plain text password.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/appwrite/services/users.rb', line 100 def create_argon2_user( user_id:, email:, password:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/argon2' api_params = { userId: user_id, email: email, password: password, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_bcrypt_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the Bcrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/appwrite/services/users.rb', line 153 def create_bcrypt_user( user_id:, email:, password:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/bcrypt' api_params = { userId: user_id, email: email, password: password, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_jwt(user_id:, session_id: nil, duration: nil) ⇒ Jwt
Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
# File 'lib/appwrite/services/users.rb', line 749 def create_jwt( user_id:, session_id: nil, duration: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/jwts' .gsub('{userId}', @client.encode_path(user_id)) api_params = { sessionId: session_id, duration: duration, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::Jwt ) end |
#create_md5_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the MD5 algorithm. Use the POST /users endpoint to create users with a plain text password.
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/appwrite/services/users.rb', line 271 def create_md5_user( user_id:, email:, password:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/md5' api_params = { userId: user_id, email: email, password: password, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in createMfaChallenge method by client SDK.
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 |
# File 'lib/appwrite/services/users.rb', line 1092 def create_mfa_recovery_codes( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/mfa/recovery-codes' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::MfaRecoveryCodes ) end |
#create_ph_pass_user(user_id:, email:, password:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the PHPass algorithm. Use the POST /users endpoint to create users with a plain text password.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/appwrite/services/users.rb', line 324 def create_ph_pass_user( user_id:, email:, password:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/phpass' api_params = { userId: user_id, email: email, password: password, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_scrypt_modified_user(user_id:, email:, password:, password_salt:, password_salt_separator:, password_signer_key:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the Scrypt Modified algorithm. Use the POST /users endpoint to create users with a plain text password.
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/appwrite/services/users.rb', line 469 def create_scrypt_modified_user( user_id:, email:, password:, password_salt:, password_salt_separator:, password_signer_key:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end if password_salt.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') end if password_salt_separator.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordSaltSeparator"') end if password_signer_key.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordSignerKey"') end api_path = '/users/scrypt-modified' api_params = { userId: user_id, email: email, password: password, passwordSalt: password_salt, passwordSaltSeparator: password_salt_separator, passwordSignerKey: password_signer_key, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu:, password_memory:, password_parallel:, password_length:, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/appwrite/services/users.rb', line 382 def create_scrypt_user( user_id:, email:, password:, password_salt:, password_cpu:, password_memory:, password_parallel:, password_length:, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end if password_salt.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordSalt"') end if password_cpu.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordCpu"') end if password_memory.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordMemory"') end if password_parallel.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordParallel"') end if password_length.nil? raise Appwrite::Exception.new('Missing required parameter: "passwordLength"') end api_path = '/users/scrypt' api_params = { userId: user_id, email: email, password: password, passwordSalt: password_salt, passwordCpu: password_cpu, passwordMemory: password_memory, passwordParallel: password_parallel, passwordLength: password_length, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_session(user_id:) ⇒ Session
Creates a session for a user. Returns an immediately usable session object.
If you want to generate a token for a custom authentication flow, use the POST /users/userId/tokens endpoint.
1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 |
# File 'lib/appwrite/services/users.rb', line 1519 def create_session( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/sessions' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::Session ) end |
#create_sha_user(user_id:, email:, password:, password_version: nil, name: nil) ⇒ User
Create a new user. Password provided must be hashed with the SHA algorithm. Use the POST /users endpoint to create users with a plain text password.
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/appwrite/services/users.rb', line 541 def create_sha_user( user_id:, email:, password:, password_version: nil, name: nil ) if user_id.nil? raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/sha' api_params = { userId: user_id, email: email, password: password, passwordVersion: password_version, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#create_target(user_id:, target_id:, provider_type:, identifier:, provider_id: nil, name: nil) ⇒ Target
Create a messaging target.
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 |
# File 'lib/appwrite/services/users.rb', line 1704 def create_target( user_id:, target_id:, provider_type:, identifier:, provider_id: nil, name: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if target_id.nil? raise Appwrite::Exception.new('Missing required parameter: "targetId"') end if provider_type.nil? raise Appwrite::Exception.new('Missing required parameter: "providerType"') end if identifier.nil? raise Appwrite::Exception.new('Missing required parameter: "identifier"') end api_path = '/users/{userId}/targets' .gsub('{userId}', @client.encode_path(user_id)) api_params = { targetId: target_id, providerType: provider_type, identifier: identifier, providerId: provider_id, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::Target ) end |
#create_token(user_id:, length: nil, expire: nil) ⇒ Token
Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the PUT /account/sessions/token endpoint to complete the login process.
1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 |
# File 'lib/appwrite/services/users.rb', line 1890 def create_token( user_id:, length: nil, expire: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/tokens' .gsub('{userId}', @client.encode_path(user_id)) api_params = { length: length, expire: expire, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::Token ) end |
#delete(user_id:) ⇒ Object
Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the updateStatus endpoint instead.
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 |
# File 'lib/appwrite/services/users.rb', line 626 def delete( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_identity(identity_id:) ⇒ Object
Delete an identity by its unique ID.
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/appwrite/services/users.rb', line 234 def delete_identity( identity_id: ) if identity_id.nil? || identity_id == '' raise Appwrite::Exception.new('Missing required parameter: "identityId"') end api_path = '/users/identities/{identityId}' .gsub('{identityId}', @client.encode_path(identity_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_mfa_authenticator(user_id:, type:) ⇒ Object
Delete an authenticator app.
913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 |
# File 'lib/appwrite/services/users.rb', line 913 def delete_mfa_authenticator( user_id:, type: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if type.nil? raise Appwrite::Exception.new('Missing required parameter: "type"') end api_path = '/users/{userId}/mfa/authenticators/{type}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{type}', @client.encode_path(type)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_passkey(user_id:, passkey_id:) ⇒ Object
Delete a passkey from a user, for example when a device is lost. The passkey can no longer be used to sign in.
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 |
# File 'lib/appwrite/services/users.rb', line 1289 def delete_passkey( user_id:, passkey_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if passkey_id.nil? || passkey_id == '' raise Appwrite::Exception.new('Missing required parameter: "passkeyId"') end api_path = '/users/{userId}/passkeys/{passkeyId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{passkeyId}', @client.encode_path(passkey_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_session(user_id:, session_id:) ⇒ Object
Delete a user sessions by its unique ID.
1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 |
# File 'lib/appwrite/services/users.rb', line 1583 def delete_session( user_id:, session_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if session_id.nil? || session_id == '' raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end api_path = '/users/{userId}/sessions/{sessionId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{sessionId}', @client.encode_path(session_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_sessions(user_id:) ⇒ Object
Delete all user's sessions by using the user's unique ID.
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 |
# File 'lib/appwrite/services/users.rb', line 1551 def delete_sessions( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/sessions' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_target(user_id:, target_id:) ⇒ Object
Delete a messaging target.
1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 |
# File 'lib/appwrite/services/users.rb', line 1847 def delete_target( user_id:, target_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if target_id.nil? || target_id == '' raise Appwrite::Exception.new('Missing required parameter: "targetId"') end api_path = '/users/{userId}/targets/{targetId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{targetId}', @client.encode_path(target_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#get(user_id:) ⇒ User
Get a user by its unique ID.
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
# File 'lib/appwrite/services/users.rb', line 590 def get( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#get_mfa_challenge(user_id:, challenge_id:) ⇒ MfaChallengeSecret
Get a custom MFA challenge for a user, including the code to be delivered through your own channel.
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 |
# File 'lib/appwrite/services/users.rb', line 952 def get_mfa_challenge( user_id:, challenge_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if challenge_id.nil? || challenge_id == '' raise Appwrite::Exception.new('Missing required parameter: "challengeId"') end api_path = '/users/{userId}/mfa/challenges/{challengeId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{challengeId}', @client.encode_path(challenge_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::MfaChallengeSecret ) end |
#get_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using createMfaRecoveryCodes method.
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 |
# File 'lib/appwrite/services/users.rb', line 1023 def get_mfa_recovery_codes( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/mfa/recovery-codes' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::MfaRecoveryCodes ) end |
#get_passkey(user_id:, passkey_id:) ⇒ Passkey
Get a verified passkey of a user by its unique ID.
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 |
# File 'lib/appwrite/services/users.rb', line 1203 def get_passkey( user_id:, passkey_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if passkey_id.nil? || passkey_id == '' raise Appwrite::Exception.new('Missing required parameter: "passkeyId"') end api_path = '/users/{userId}/passkeys/{passkeyId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{passkeyId}', @client.encode_path(passkey_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::Passkey ) end |
#get_prefs(user_id:) ⇒ Preferences
Get the user preferences by its unique ID.
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 |
# File 'lib/appwrite/services/users.rb', line 1406 def get_prefs( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/prefs' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::Preferences ) end |
#get_target(user_id:, target_id:) ⇒ Target
Get a user's push notification target by ID.
1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 |
# File 'lib/appwrite/services/users.rb', line 1760 def get_target( user_id:, target_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if target_id.nil? || target_id == '' raise Appwrite::Exception.new('Missing required parameter: "targetId"') end api_path = '/users/{userId}/targets/{targetId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{targetId}', @client.encode_path(target_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::Target ) end |
#list(queries: nil, search: nil, total: nil) ⇒ UserList
Get a list of all the project's users. You can use the query params to filter your results.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/appwrite/services/users.rb', line 17 def list( queries: nil, search: nil, total: nil ) api_path = '/users' api_params = { queries: queries, search: search, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::UserList ) end |
#list_identities(queries: nil, search: nil, total: nil) ⇒ IdentityList
Get identities for all users.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/appwrite/services/users.rb', line 202 def list_identities( queries: nil, search: nil, total: nil ) api_path = '/users/identities' api_params = { queries: queries, search: search, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::IdentityList ) end |
#list_memberships(user_id:, queries: nil, search: nil, total: nil) ⇒ MembershipList
Get the user membership list by its unique ID.
834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/appwrite/services/users.rb', line 834 def list_memberships( user_id:, queries: nil, search: nil, total: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/memberships' .gsub('{userId}', @client.encode_path(user_id)) api_params = { queries: queries, search: search, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::MembershipList ) end |
#list_mfa_factors(user_id:) ⇒ MfaFactors
List the factors available on the account to be used as a MFA challange.
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
# File 'lib/appwrite/services/users.rb', line 989 def list_mfa_factors( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/mfa/factors' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::MfaFactors ) end |
#list_passkeys(user_id:, queries: nil, total: nil) ⇒ PasskeyList
Get the list of verified passkeys registered by a user.
1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 |
# File 'lib/appwrite/services/users.rb', line 1166 def list_passkeys( user_id:, queries: nil, total: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/passkeys' .gsub('{userId}', @client.encode_path(user_id)) api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::PasskeyList ) end |
#list_sessions(user_id:, total: nil) ⇒ SessionList
Get the user sessions list by its unique ID.
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 |
# File 'lib/appwrite/services/users.rb', line 1480 def list_sessions( user_id:, total: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/sessions' .gsub('{userId}', @client.encode_path(user_id)) api_params = { total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::SessionList ) end |
#list_targets(user_id:, queries: nil, total: nil) ⇒ TargetList
List the messaging targets that are associated with a user.
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 |
# File 'lib/appwrite/services/users.rb', line 1663 def list_targets( user_id:, queries: nil, total: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/targets' .gsub('{userId}', @client.encode_path(user_id)) api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::TargetList ) end |
#update_email(user_id:, email:) ⇒ User
Update the user email by its unique ID.
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 |
# File 'lib/appwrite/services/users.rb', line 658 def update_email( user_id:, email: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email.nil? raise Appwrite::Exception.new('Missing required parameter: "email"') end api_path = '/users/{userId}/email' .gsub('{userId}', @client.encode_path(user_id)) api_params = { email: email, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_email_verification(user_id:, email_verification:) ⇒ User
Update the user email verification status by its unique ID.
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 |
# File 'lib/appwrite/services/users.rb', line 1928 def update_email_verification( user_id:, email_verification: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if email_verification.nil? raise Appwrite::Exception.new('Missing required parameter: "emailVerification"') end api_path = '/users/{userId}/verification' .gsub('{userId}', @client.encode_path(user_id)) api_params = { emailVerification: email_verification, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_impersonator(user_id:, impersonator:) ⇒ User
Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. Account endpoints are read-only while impersonating: they report the target's account, and anything that would change it is refused, so an impersonator cannot alter the target's credentials or delete their account.
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
# File 'lib/appwrite/services/users.rb', line 706 def update_impersonator( user_id:, impersonator: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if impersonator.nil? raise Appwrite::Exception.new('Missing required parameter: "impersonator"') end api_path = '/users/{userId}/impersonator' .gsub('{userId}', @client.encode_path(user_id)) api_params = { impersonator: impersonator, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_labels(user_id:, labels:) ⇒ User
Update the user labels by its unique ID.
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the Permissions docs for more info.
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 |
# File 'lib/appwrite/services/users.rb', line 792 def update_labels( user_id:, labels: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if labels.nil? raise Appwrite::Exception.new('Missing required parameter: "labels"') end api_path = '/users/{userId}/labels' .gsub('{userId}', @client.encode_path(user_id)) api_params = { labels: labels, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PUT', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_mfa(user_id:, mfa:) ⇒ User
Enable or disable MFA on a user account.
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 |
# File 'lib/appwrite/services/users.rb', line 873 def update_mfa( user_id:, mfa: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if mfa.nil? raise Appwrite::Exception.new('Missing required parameter: "mfa"') end api_path = '/users/{userId}/mfa' .gsub('{userId}', @client.encode_path(user_id)) api_params = { mfa: mfa, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_mfa_recovery_codes(user_id:) ⇒ MfaRecoveryCodes
Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/appwrite/services/users.rb', line 1057 def update_mfa_recovery_codes( user_id: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end api_path = '/users/{userId}/mfa/recovery-codes' .gsub('{userId}', @client.encode_path(user_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PUT', path: api_path, headers: api_headers, params: api_params, response_type: Models::MfaRecoveryCodes ) end |
#update_name(user_id:, name:) ⇒ User
Update the user name by its unique ID.
1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 |
# File 'lib/appwrite/services/users.rb', line 1125 def update_name( user_id:, name: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end api_path = '/users/{userId}/name' .gsub('{userId}', @client.encode_path(user_id)) api_params = { name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_passkey(user_id:, passkey_id:, name:) ⇒ Passkey
Rename a passkey of a user.
1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 |
# File 'lib/appwrite/services/users.rb', line 1242 def update_passkey( user_id:, passkey_id:, name: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if passkey_id.nil? || passkey_id == '' raise Appwrite::Exception.new('Missing required parameter: "passkeyId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end api_path = '/users/{userId}/passkeys/{passkeyId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{passkeyId}', @client.encode_path(passkey_id)) api_params = { name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::Passkey ) end |
#update_password(user_id:, password:) ⇒ User
Update the user password by its unique ID.
1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 |
# File 'lib/appwrite/services/users.rb', line 1327 def update_password( user_id:, password: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if password.nil? raise Appwrite::Exception.new('Missing required parameter: "password"') end api_path = '/users/{userId}/password' .gsub('{userId}', @client.encode_path(user_id)) api_params = { password: password, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_phone(user_id:, number:) ⇒ User
Update the user phone by its unique ID.
1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 |
# File 'lib/appwrite/services/users.rb', line 1367 def update_phone( user_id:, number: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if number.nil? raise Appwrite::Exception.new('Missing required parameter: "number"') end api_path = '/users/{userId}/phone' .gsub('{userId}', @client.encode_path(user_id)) api_params = { number: number, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_phone_verification(user_id:, phone_verification:) ⇒ User
Update the user phone verification status by its unique ID.
1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 |
# File 'lib/appwrite/services/users.rb', line 1968 def update_phone_verification( user_id:, phone_verification: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if phone_verification.nil? raise Appwrite::Exception.new('Missing required parameter: "phoneVerification"') end api_path = '/users/{userId}/verification/phone' .gsub('{userId}', @client.encode_path(user_id)) api_params = { phoneVerification: phone_verification, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_prefs(user_id:, prefs:) ⇒ Preferences
Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 |
# File 'lib/appwrite/services/users.rb', line 1440 def update_prefs( user_id:, prefs: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if prefs.nil? raise Appwrite::Exception.new('Missing required parameter: "prefs"') end api_path = '/users/{userId}/prefs' .gsub('{userId}', @client.encode_path(user_id)) api_params = { prefs: prefs, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::Preferences ) end |
#update_status(user_id:, status:) ⇒ User
Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 |
# File 'lib/appwrite/services/users.rb', line 1622 def update_status( user_id:, status: ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if status.nil? raise Appwrite::Exception.new('Missing required parameter: "status"') end api_path = '/users/{userId}/status' .gsub('{userId}', @client.encode_path(user_id)) api_params = { status: status, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::User ) end |
#update_target(user_id:, target_id:, identifier: nil, provider_id: nil, name: nil) ⇒ Target
Update a messaging target.
1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 |
# File 'lib/appwrite/services/users.rb', line 1801 def update_target( user_id:, target_id:, identifier: nil, provider_id: nil, name: nil ) if user_id.nil? || user_id == '' raise Appwrite::Exception.new('Missing required parameter: "userId"') end if target_id.nil? || target_id == '' raise Appwrite::Exception.new('Missing required parameter: "targetId"') end api_path = '/users/{userId}/targets/{targetId}' .gsub('{userId}', @client.encode_path(user_id)) .gsub('{targetId}', @client.encode_path(target_id)) api_params = { identifier: identifier, providerId: provider_id, name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::Target ) end |