it.auties.whatsapp.model.action.ContactAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cobalt Show documentation
Show all versions of cobalt Show documentation
Standalone fully-featured Whatsapp Web API for Java and Kotlin
package it.auties.whatsapp.model.action;
import it.auties.protobuf.annotation.ProtobufMessageName;
import it.auties.protobuf.annotation.ProtobufProperty;
import it.auties.protobuf.model.ProtobufType;
import it.auties.whatsapp.model.sync.PatchType;
import java.util.Optional;
/**
* A model clas that represents a new contact push name
*/
@ProtobufMessageName("SyncActionValue.ContactAction")
public record ContactAction(
@ProtobufProperty(index = 1, type = ProtobufType.STRING)
Optional fullName,
@ProtobufProperty(index = 2, type = ProtobufType.STRING)
Optional firstName,
@ProtobufProperty(index = 3, type = ProtobufType.STRING)
Optional lidJid
) implements Action {
/**
* Returns the name of this contact
*
* @return an optional
*/
public Optional name() {
return fullName.or(this::firstName);
}
/**
* The name of this action
*
* @return a non-null string
*/
@Override
public String indexName() {
return "contact";
}
/**
* The version of this action
*
* @return a non-null string
*/
@Override
public int actionVersion() {
return 2;
}
/**
* The type of this action
*
* @return a non-null string
*/
@Override
public PatchType actionType() {
return null;
}
}