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

it.auties.whatsapp.model.mobile.VerificationCodeMethod Maven / Gradle / Ivy

There is a newer version: 2.7.2
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy