Method: Appwrite::Users#create
- Defined in:
- lib/appwrite/services/users.rb
#create(user_id:, email:, password:, name: nil) ⇒ User
Create a new user.
50 51 52 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 |
# File 'lib/appwrite/services/users.rb', line 50 def create(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 path = '/users' params = { userId: user_id, email: email, password: password, name: name, } headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: path, headers: headers, params: params, response_type: Models::User ) end |