com.workos.usermanagement.builders.CreateUserOptionsBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of workos Show documentation
Show all versions of workos Show documentation
The WorkOS Kotlin library provides convenient access to the WorkOS API from applications written in JVM compatible languages.
The newest version!
package com.workos.usermanagement.builders
import com.workos.usermanagement.types.CreateUserOptions
import com.workos.usermanagement.types.PasswordHashTypeEnumType
/**
* Builder for options when creating a user.
*
* @param email The email address of the user.
* @param password The password to set for the user.
* @param passwordHash The hashed password to set for the user. Mutually exclusive with password.
* @param passwordHashType The algorithm originally used to hash the password, used when providing a password_hash.
* @param firstName The first name of the user.
* @param lastName The last name of the user.
* @param emailVerified Whether the user’s email address was previously verified.
*/
class CreateUserOptionsBuilder @JvmOverloads constructor(
val email: String,
override var password: String? = null,
override var passwordHash: String? = null,
override var passwordHashType: PasswordHashTypeEnumType? = null,
override var firstName: String? = null,
override var lastName: String? = null,
override var emailVerified: Boolean? = null,
) : AbstractUserOptionsBuilder(
password,
passwordHash,
passwordHashType,
firstName,
lastName,
emailVerified
) {
/**
* Generates the CreateUserOptions object.
*/
override fun build(): CreateUserOptions {
return CreateUserOptions(
email = this.email,
password = this.password,
passwordHash = this.passwordHash,
passwordHashType = this.passwordHashType,
firstName = this.firstName,
lastName = this.lastName,
emailVerified = this.emailVerified,
)
}
/**
* @suppress
*/
companion object {
@JvmStatic
fun create(email: String): CreateUserOptionsBuilder {
return CreateUserOptionsBuilder(email)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy