All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.workos.usermanagement.builders.CreateMagicAuthOptionsBuilder.kt Maven / Gradle / Ivy

Go to download

The WorkOS Kotlin library provides convenient access to the WorkOS API from applications written in JVM compatible languages.

There is a newer version: 4.9.0
Show newest version
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