Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## Next Release

- Fixes `claim.getNextPage` sending the `status` filter as `type` and dropping `status`
- Fixes `report.all` sending `type` as a query parameter and failing on an immutable params map
- Fixes `getNextPage` (claims, events, insurances, pickups, refunds, scan forms, shipments and trackers) dropping the `start_datetime` and `end_datetime` filters of the original `all` call
- Fixes `tracker.getNextPage` dropping the `tracking_codes` filter of the original `all` call

## v8.11.0 (2026-11-09)

- Adds `deliveryEvidence` property and `DeliveryEvidence` model to `Tracker` object
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/easypost/model/ClaimCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ public final class ClaimCollection extends PaginatedCollection<Claim> {

@Setter
private String type;

@Setter
private String status;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<Claim> claims, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -29,6 +37,13 @@ protected Map<String, Object> buildNextPageParameters(List<Claim> claims, Intege
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/easypost/model/EventCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

import com.easypost.exception.General.EndOfPaginationError;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class EventCollection extends PaginatedCollection<Event> {
private List<Event> events;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<Event> events, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -22,6 +29,13 @@ protected Map<String, Object> buildNextPageParameters(List<Event> events, Intege
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/easypost/model/InsuranceCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

import com.easypost.exception.General.EndOfPaginationError;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class InsuranceCollection extends PaginatedCollection<Insurance> {
private List<Insurance> insurances;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<Insurance> insurances, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -22,6 +29,13 @@ protected Map<String, Object> buildNextPageParameters(List<Insurance> insurances
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/easypost/model/PickupCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

import com.easypost.exception.General.EndOfPaginationError;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class PickupCollection extends PaginatedCollection<Pickup> {
private List<Pickup> pickups;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<Pickup> pickups, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -22,6 +29,13 @@ protected Map<String, Object> buildNextPageParameters(List<Pickup> pickups, Inte
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/easypost/model/RefundCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

import com.easypost.exception.General.EndOfPaginationError;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class RefundCollection extends PaginatedCollection<Refund> {
private List<Refund> refunds;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<Refund> refunds, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -22,6 +29,13 @@ protected Map<String, Object> buildNextPageParameters(List<Refund> refunds, Inte
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
14 changes: 14 additions & 0 deletions src/main/java/com/easypost/model/ScanFormCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

import com.easypost.exception.General.EndOfPaginationError;
import lombok.Getter;
import lombok.Setter;

@Getter
public final class ScanFormCollection extends PaginatedCollection<ScanForm> {
private List<ScanForm> scanForms;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected Map<String, Object> buildNextPageParameters(List<ScanForm> scanForms, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -22,6 +29,13 @@ protected Map<String, Object> buildNextPageParameters(List<ScanForm> scanForms,
parameters.put("page_size", pageSize);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
13 changes: 13 additions & 0 deletions src/main/java/com/easypost/model/ShipmentCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public class ShipmentCollection extends PaginatedCollection<Shipment> {
@Setter
private Boolean includeChildren;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected final Map<String, Object> buildNextPageParameters(List<Shipment> shipments, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -37,6 +43,13 @@ protected final Map<String, Object> buildNextPageParameters(List<Shipment> shipm
parameters.put("include_children", includeChildren);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
13 changes: 13 additions & 0 deletions src/main/java/com/easypost/model/TrackerCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public class TrackerCollection extends PaginatedCollection<Tracker> {
@Setter
private String carrier;

@Setter
private Object startDatetime;

@Setter
private Object endDatetime;

@Override
protected final Map<String, Object> buildNextPageParameters(List<Tracker> trackers, Integer pageSize)
throws EndOfPaginationError {
Expand All @@ -43,6 +49,13 @@ protected final Map<String, Object> buildNextPageParameters(List<Tracker> tracke
parameters.put("carrier", carrier);
}

if (startDatetime != null) {
parameters.put("start_datetime", startDatetime);
}
if (endDatetime != null) {
parameters.put("end_datetime", endDatetime);
}

return parameters;
}
}
7 changes: 4 additions & 3 deletions src/main/java/com/easypost/service/ClaimService.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.easypost.http.Requestor.RequestMethod;
import com.easypost.model.Claim;
import com.easypost.model.ClaimCollection;
import com.easypost.utils.InternalUtilities;

import lombok.SneakyThrows;

Expand Down Expand Up @@ -60,14 +61,14 @@ public Claim retrieve(final String id) throws EasyPostException {
public ClaimCollection all(final Map<String, Object> params) throws EasyPostException {
String type = (String) params.get("type");
String status = (String) params.get("status");
params.remove(type);
params.remove(status);
String endpoint = "claims";

ClaimCollection claimCollection =
Requestor.request(RequestMethod.GET, endpoint, params, ClaimCollection.class, client);
claimCollection.setType(type);
claimCollection.setType(status);
claimCollection.setStatus(status);
claimCollection.setStartDatetime(InternalUtilities.getOrDefault(params, "start_datetime", null));
claimCollection.setEndDatetime(InternalUtilities.getOrDefault(params, "end_datetime", null));

return claimCollection;
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/easypost/service/EventService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.easypost.model.Event;
import com.easypost.model.Payload;
import com.easypost.model.PayloadCollection;
import com.easypost.utils.InternalUtilities;
import lombok.SneakyThrows;

import java.util.List;
Expand Down Expand Up @@ -49,7 +50,12 @@ public Event retrieve(final String id) throws EasyPostException {
public EventCollection all(final Map<String, Object> params) throws EasyPostException {
String endpoint = "events";

return Requestor.request(RequestMethod.GET, endpoint, params, EventCollection.class, client);
EventCollection collection =
Requestor.request(RequestMethod.GET, endpoint, params, EventCollection.class, client);
collection.setStartDatetime(InternalUtilities.getOrDefault(params, "start_datetime", null));
collection.setEndDatetime(InternalUtilities.getOrDefault(params, "end_datetime", null));

return collection;
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/easypost/service/InsuranceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.easypost.http.Requestor.RequestMethod;
import com.easypost.model.InsuranceCollection;
import com.easypost.model.Insurance;
import com.easypost.utils.InternalUtilities;
import lombok.SneakyThrows;

import java.util.HashMap;
Expand Down Expand Up @@ -63,7 +64,12 @@ public Insurance retrieve(final String id) throws EasyPostException {
public InsuranceCollection all(final Map<String, Object> params) throws EasyPostException {
String endpoint = "insurances";

return Requestor.request(RequestMethod.GET, endpoint, params, InsuranceCollection.class, client);
InsuranceCollection collection =
Requestor.request(RequestMethod.GET, endpoint, params, InsuranceCollection.class, client);
collection.setStartDatetime(InternalUtilities.getOrDefault(params, "start_datetime", null));
collection.setEndDatetime(InternalUtilities.getOrDefault(params, "end_datetime", null));

return collection;
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/easypost/service/PickupService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.easypost.model.PickupCollection;
import com.easypost.model.Pickup;
import com.easypost.model.PickupRate;
import com.easypost.utils.InternalUtilities;
import lombok.SneakyThrows;

import java.util.HashMap;
Expand Down Expand Up @@ -35,7 +36,12 @@ public class PickupService {
public PickupCollection all(final Map<String, Object> params) throws EasyPostException {
String endpoint = "pickups";

return Requestor.request(RequestMethod.GET, endpoint, params, PickupCollection.class, client);
PickupCollection collection =
Requestor.request(RequestMethod.GET, endpoint, params, PickupCollection.class, client);
collection.setStartDatetime(InternalUtilities.getOrDefault(params, "start_datetime", null));
collection.setEndDatetime(InternalUtilities.getOrDefault(params, "end_datetime", null));

return collection;
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/easypost/service/RefundService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.easypost.http.Requestor.RequestMethod;
import com.easypost.model.RefundCollection;
import com.easypost.model.Refund;
import com.easypost.utils.InternalUtilities;
import lombok.SneakyThrows;

import java.util.Arrays;
Expand Down Expand Up @@ -67,7 +68,12 @@ public Refund retrieve(final String id) throws EasyPostException {
public RefundCollection all(final Map<String, Object> params) throws EasyPostException {
String endpoint = "refunds";

return Requestor.request(RequestMethod.GET, endpoint, params, RefundCollection.class, client);
RefundCollection collection =
Requestor.request(RequestMethod.GET, endpoint, params, RefundCollection.class, client);
collection.setStartDatetime(InternalUtilities.getOrDefault(params, "start_datetime", null));
collection.setEndDatetime(InternalUtilities.getOrDefault(params, "end_datetime", null));

return collection;
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/easypost/service/ReportService.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ public Report retrieve(final String id) throws EasyPostException {
*/
public ReportCollection all(final Map<String, Object> params) throws EasyPostException {
String type = (String) params.get("type");
params.remove(type);
Map<String, Object> requestParams = new HashMap<>(params);
requestParams.remove("type");
String endpoint = reportURL(type);

ReportCollection collection =
Requestor.request(RequestMethod.GET, endpoint, params, ReportCollection.class, client);
Requestor.request(RequestMethod.GET, endpoint, requestParams, ReportCollection.class, client);
// we store the type of reports in this collection, for use in pagination
collection.setType(type);
return collection;
Expand Down
Loading
Loading