package at.procon.eventhub.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;

public record EventHubPackageIngestRequest(
        @JsonProperty("package")
        @Valid @NotNull EventHubPackageRequest packageInfo,

        @Valid @NotEmpty List<EventHubEventDto> events
) {
    public EventHubPackageIngestRequest {
        events = events == null ? List.of() : List.copyOf(events);
    }
}
