be.looorent.ponto.client.http.SynchronizationMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ponto-client Show documentation
Show all versions of ponto-client Show documentation
Client library for Ponto (https://myponto.com)
The newest version!
package be.looorent.ponto.client.http;
import be.looorent.ponto.synchronization.ResourceType;
import be.looorent.ponto.synchronization.Synchronization;
import be.looorent.ponto.synchronization.SynchronizationStatus;
import be.looorent.ponto.synchronization.SynchronizationSubtype;
import lombok.Value;
import java.time.Instant;
import java.util.Collection;
import java.util.UUID;
class SynchronizationMapping {
@Value
static class Data implements JsonMapping {
private UUID id;
private Attributes attributes;
@Override
public Synchronization toEntity() {
return new Synchronization(
id,
attributes.getStatus(),
attributes.getSubtype(),
attributes.getCreatedAt(),
attributes.getUpdatedAt(),
attributes.getResourceId(),
attributes.getResourceType(),
attributes.getErrors()
);
}
}
@Value
static class Attributes {
private SynchronizationStatus status;
private SynchronizationSubtype subtype;
private Instant createdAt;
private Instant updatedAt;
private UUID resourceId;
private ResourceType resourceType;
private Collection