it.auties.whatsapp.model.mobile.VerificationCodeMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of whatsappweb4j Show documentation
Show all versions of whatsappweb4j Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
package it.auties.whatsapp.model.mobile;
import com.fasterxml.jackson.annotation.JsonCreator;
import it.auties.whatsapp.api.ClientType;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.Accessors;
import java.util.Arrays;
/**
* The constants of this enumerated type describe the various types of verification that can be used to receive the OTP required for an {@link ClientType#MOBILE}
*/
@AllArgsConstructor
@Accessors(fluent = true)
public enum VerificationCodeMethod {
/**
* Do not ask for a new verification code as you already have one
*/
NONE("none"),
/**
* An SMS containing the code will be sent to the associated phone number
*/
SMS("sms"),
/**
* A call will be received from the associated phone number
*/
CALL("voice"),
/**
* A message containing the OTP will be sent via Whatsapp to an active device
*/
WHATSAPP("email_otp");
@Getter
private final String type;
@JsonCreator
public static VerificationCodeMethod of(String name) {
return Arrays.stream(values())
.filter(entry -> entry.type().equalsIgnoreCase(name))
.findFirst()
.orElse(null);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy