package com.airlock.iam.common.domain.service.event;

import com.airlock.iam.base.api.domain.model.event.EventId;
import com.airlock.iam.base.api.domain.model.event.EventType;
import com.airlock.iam.common.api.domain.model.event.EventData;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.List;

public interface EventOutboxRepository {
   void insert(EventOutboxRepository.EventOutboxInsertData var1);

   void deleteByEventIds(Collection<EventId> var1);

   List<EventData> getNext(int var1);

   int count();

   record EventOutboxInsertData(EventId eventId, EventType eventType, EventData.EventPayload payload, int tieBreaker) {
      @SuppressFBWarnings(justification = "generated code")
      public static EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder builder() {
         return new EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder();
      }

      @SuppressFBWarnings(justification = "generated code")
      public static class EventOutboxInsertDataBuilder {
         @SuppressFBWarnings(justification = "generated code")
         private EventId eventId;
         @SuppressFBWarnings(justification = "generated code")
         private EventType eventType;
         @SuppressFBWarnings(justification = "generated code")
         private EventData.EventPayload payload;
         @SuppressFBWarnings(justification = "generated code")
         private int tieBreaker;

         @SuppressFBWarnings(justification = "generated code")
         EventOutboxInsertDataBuilder() {
         }

         @SuppressFBWarnings(justification = "generated code")
         public EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder eventId(EventId eventId) {
            this.eventId = eventId;
            return this;
         }

         @SuppressFBWarnings(justification = "generated code")
         public EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder eventType(EventType eventType) {
            this.eventType = eventType;
            return this;
         }

         @SuppressFBWarnings(justification = "generated code")
         public EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder payload(EventData.EventPayload payload) {
            this.payload = payload;
            return this;
         }

         @SuppressFBWarnings(justification = "generated code")
         public EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder tieBreaker(int tieBreaker) {
            this.tieBreaker = tieBreaker;
            return this;
         }

         @SuppressFBWarnings(justification = "generated code")
         public EventOutboxRepository.EventOutboxInsertData build() {
            return new EventOutboxRepository.EventOutboxInsertData(this.eventId, this.eventType, this.payload, this.tieBreaker);
         }

         @SuppressFBWarnings(justification = "generated code")
         @Override
         public String toString() {
            return "EventOutboxRepository.EventOutboxInsertData.EventOutboxInsertDataBuilder(eventId="
               + this.eventId
               + ", eventType="
               + this.eventType
               + ", payload="
               + this.payload
               + ", tieBreaker="
               + this.tieBreaker
               + ")";
         }
      }
   }
}
