
com.workos.usermanagement.builders.CreateMagicAuthOptionsBuilder.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.
package com.workos.usermanagement.builders
import com.workos.usermanagement.types.CreateMagicAuthOptions
/**
* Builder for options when creating a Magic Auth code.
*
* @param email The email address of the user.
* @param invitationToken The token of an invitation, if required.
*/
class CreateMagicAuthOptionsBuilder @JvmOverloads constructor(
private var email: String,
private var invitationToken: String? = null,
) {
/**
* Invitation Token
*/
fun invitationToken(value: String) = apply { invitationToken = value }
/**
* Generates the CreateMagicAuthOptions object.
*/
fun build(): CreateMagicAuthOptions {
return CreateMagicAuthOptions(
email = this.email,
invitationToken = this.invitationToken,
)
}
/**
* @suppress
*/
companion object {
@JvmStatic
fun create(email: String): CreateMagicAuthOptionsBuilder {
return CreateMagicAuthOptionsBuilder(email)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy