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#APP_CLIENT}
*/
@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 numberWithoutPrefix
*/
SMS("sms"),
/**
* A call will be received from the associated phone numberWithoutPrefix
*/
CALL("voice");
@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);
}
}