diff --git a/ksef-api/src/main/java/io/alapierre/ksef/client/iterator/SessionQueryResponseAdapter.java b/ksef-api/src/main/java/io/alapierre/ksef/client/iterator/SessionQueryResponseAdapter.java new file mode 100644 index 0000000..d190d22 --- /dev/null +++ b/ksef-api/src/main/java/io/alapierre/ksef/client/iterator/SessionQueryResponseAdapter.java @@ -0,0 +1,36 @@ +package io.alapierre.ksef.client.iterator; + +import io.alapierre.ksef.client.model.rest.auth.SessionStatus; +import lombok.RequiredArgsConstructor; + +import java.util.List; + +/** + * @author Adrian Lapierre {@literal al@alapierre.io} + * Copyrights by original author 2023.10.12 + */ +@RequiredArgsConstructor +public class SessionQueryResponseAdapter implements PageableResult { + + private final SessionStatus sessionStatus; + + @Override + public int getNumberOfElements() { + return sessionStatus.getNumberOfElements(); + } + + @Override + public int getPageSize() { + return sessionStatus.getPageSize(); + } + + @Override + public int getPageOffset() { + return sessionStatus.getPageOffset(); + } + + @Override + public List getItems() { + return sessionStatus.getInvoiceStatusList(); + } +}