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

it.auties.whatsapp.model.response.ContactStatusResponse Maven / Gradle / Ivy

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

import it.auties.whatsapp.model.request.Node;
import it.auties.whatsapp.util.Clock;
import lombok.NonNull;

import java.time.ZonedDateTime;
import java.util.NoSuchElementException;

public record ContactStatusResponse(@NonNull String status, @NonNull ZonedDateTime timestamp) implements ResponseWrapper {
    public ContactStatusResponse(@NonNull Node source) {
        this(
                source.contentAsString().orElseThrow(() -> new NoSuchElementException("Missing status")),
                Clock.parseSeconds(source.attributes().getLong("t"))
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy