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

it.auties.whatsapp.model.signal.auth.Companion Maven / Gradle / Ivy

There is a newer version: 2.7.2
Show newest version
package it.auties.whatsapp.model.signal.auth;

import com.fasterxml.jackson.annotation.JsonCreator;
import it.auties.protobuf.base.ProtobufMessage;
import it.auties.protobuf.base.ProtobufName;
import it.auties.protobuf.base.ProtobufProperty;
import it.auties.whatsapp.model.sync.HistorySyncConfig;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;
import lombok.extern.jackson.Jacksonized;

import java.util.Arrays;

import static it.auties.protobuf.base.ProtobufType.*;

@AllArgsConstructor
@Data
@Builder
@Jacksonized
@Accessors(fluent = true)
@ProtobufName("DeviceProps")
public class Companion implements ProtobufMessage {
    @ProtobufProperty(index = 1, type = STRING)
    private String os;

    @ProtobufProperty(index = 2, type = MESSAGE, implementation = Version.class)
    private Version version;

    @ProtobufProperty(index = 3, type = MESSAGE, implementation = Companion.CompanionPropsPlatformType.class)
    private CompanionPropsPlatformType platformType;

    @ProtobufProperty(index = 4, type = BOOL)
    private boolean requireFullSync;

    @ProtobufProperty(index = 5, name = "historySyncConfig", type = MESSAGE)
    private HistorySyncConfig historySyncConfig;

    @AllArgsConstructor
    @Accessors(fluent = true)
    @ProtobufName("PlatformType")
    public enum CompanionPropsPlatformType implements ProtobufMessage{
        UNKNOWN(0),
        CHROME(1),
        FIREFOX(2),
        INTERNET_EXPLORER(3),
        OPERA(4),
        SAFARI(5),
        EDGE(6),
        DESKTOP(7),
        IPAD(8),
        ANDROID_TABLET(9),
        PORTAL(10),
        PORTAL_PLUS(11),
        PORTAL_TV(12),
        TCL_TV(13);
        
        @Getter
        private final int index;

        @JsonCreator
        public static CompanionPropsPlatformType of(int index) {
            return Arrays.stream(values()).filter(entry -> entry.index() == index).findFirst().orElse(null);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy