diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8bf21543..7b3c3c79e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,8 @@
# CHANGELOG
-## Next Release
+## v8.0.0 (2025-04-28)
+
+See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-7x-to-80) for more details.
- Adds `WebhookCustomHeader` model, allowing `custom_headers` to be passed when creating/updating a webhook
- Adds the following functions to assist ReferralCustomers add credit cards and bank accounts:
@@ -11,19 +13,23 @@
- Adds missing tracker props
- Adds `tracking_codes` param to tracker index endpoint
- Routes `AmazonShippingAccount` to the correct endpoint
+- Corrects payload wrapping for updating a webhook
- Fixes error parsing
- Allows for alternative format of `errors` field (previously we deserialized the `errors` field into a list of `Error` objects; however, sometimes the errors are simply a list of strings. This change make the `errors` field a list of `Object` allowing for either the new `FieldError` object or a list of strings. Users will need to check for the type of error returned and handle appropriately)
- Removed the unused `Error` model
- Added an explicit `AddressVerificationFieldError` model
- The `BetaPaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field
- Removes deprecated functions
- - `TimeInTransit.getSmartRateAccuracy` (use `TimeInTransit.getSmartrateAccuracy` instead)
- `paymentMethod.all` (use `billing.retrievePaymentMethods` instead)
- - `shipment.getSmartrates` (use `shipment.smartrates` instead)
- - String overload for `shipment.lowestSmartRate`, 3rd param requires a valid `SmartrateAccuracy`
- `user.apiKeys` (use `apiKey.retrieveApiKeysForUser` instead)
- - `utilities.getLowestSmartRate` (use `utilities.findLowestSmartrate` instead)
-- Corrects payload wrapping for updating a webhook
+- Replaces deprecated functions
+ - `shipment.lowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`)
+ - `utilities.findLowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`)
+- Renames
+ - `SmartrateAccuracy` is now `SmartRateAccuracy`
+ - `SmartrateCollection` is now `SmartRateCollection`
+ - `shipment.smartrates` is now `shipment.smartRates`
+ - `TimeInTransit.getBySmartrateAccuracy` is now `TimeInTransit.getSmartRateAccuracy`
- Bumps dependencies
## v7.4.4 (2025-01-03)
@@ -79,6 +85,8 @@
## v7.0.0 (2023-12-06)
+See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-6x-to-70) for more details.
+
- Removes `withCarbonOffset` parameter from `create`, `buy`, and `regenerateRates` functions of the Shipment service as EasyPost now offers Carbon Neutral shipments by default for free
- Removes the undocumented `createAndBuy` function from the Batch service. The proper usage is to create a batch first and buy it separately
- Changes return type of `all()` in webhook service from `WebhookCollection` to `a list of webhooks`
@@ -149,6 +157,8 @@
## v6.0.0 (2023-01-05)
+See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-5x-to-60) for more details.
+
Includes all the changes from `v6.0.0-rc1` listed below in addition to the following:
- All constants are now defined in the top-level `Constants` class (`com.easypost.Constants`)
@@ -292,7 +302,7 @@ Includes all the changes from `v6.0.0-rc1` listed below in addition to the follo
## v5.0.0 (2022-01-14)
-Upgrading major versions of this project? Refer to the [Upgrade Guide](UPGRADE_GUIDE.md).
+See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-4x-to-50) for more details.
- Bump minimum Java version from 1.5 to 8
- Changed PUT/POST request bodies from url-form encoded to JSON encoded
diff --git a/README.md b/README.md
index ce8bcbb3f..fd6d2e95d 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Add this to your project's POM:
com.easyposteasypost-api-client
- 7.4.4
+ 8.0.0
```
@@ -25,7 +25,7 @@ Add this to your project's POM:
Add this to your project's build file:
```groovy
-implementation "com.easypost:easypost-api-client:7.4.4"
+implementation "com.easypost:easypost-api-client:8.0.0"
```
**NOTE:** [Google Gson](http://code.google.com/p/google-gson/) is required.
diff --git a/UPGRADE_GUIDE.md b/UPGRADE_GUIDE.md
index b4a5a3703..22efd4799 100644
--- a/UPGRADE_GUIDE.md
+++ b/UPGRADE_GUIDE.md
@@ -2,12 +2,55 @@
Use the following guide to assist in the upgrade process of the `easypost-java` library between major versions.
+- [Upgrading from 7.x to 8.x](#upgrading-from-7x-to-80)
- [Upgrading from 6.x to 7.x](#upgrading-from-6x-to-70)
- [Upgrading from 5.x to 6.0](#upgrading-from-5x-to-60)
- [Upgrading from 4.x to 5.0](#upgrading-from-4x-to-50)
+## Upgrading from 7.x to 8.0
+
+### 8.0 High Impact Changes
+
+- [Error Parsing](#80-error-parsing)
+
+### 8.0 Medium Impact Changes
+
+- [Deprecations](#80-deprecations)
+
+## 8.0 Error Parsing
+
+*Likelihood of Impact: **High***
+
+The `errors` key of an error response can return either a list of `FieldError` objects or a list of strings. The error parsing has been expanded to include both formats. As such, you will now need to check for the format of the `errors` field and handle the errors appropriately for the type that is returned.
+
+The `Error` model has been removed since it is unused and we directly assign properties of an error response to the `ApiError` type.
+
+The `BetaPaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field.
+
+See the `CHANGELOG` for more details.
+
+## 8.0 Deprecations
+
+*Likelihood of Impact: **Medium***
+
+The following functions have changed:
+
+- Removed deprecated functions
+ - `paymentMethod.all` (use `billing.retrievePaymentMethods` instead)
+ - `user.apiKeys` (use `apiKey.retrieveApiKeysForUser` instead)
+- Changed deprecated functions
+ - `shipment.lowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`)
+ - `utilities.findLowestSmartRate` (3rd param expects a valid `SmartRateAccuracy`)
+- Renames
+ - `SmartrateAccuracy` is now `SmartRateAccuracy`
+ - `SmartrateCollection` is now `SmartRateCollection`
+ - `shipment.smartrates` is now `shipment.smartRates`
+ - `TimeInTransit.getBySmartrateAccuracy` is now `TimeInTransit.getSmartRateAccuracy`
+
## Upgrading from 6.x to 7.0
+**NOTICE:** v7 is deprecated.
+
### 7.0 High Impact Changes
- [Carbon Offset Removed](#70-carbon-offset-removed)
diff --git a/VERSION b/VERSION
index 4e61aeef9..ae9a76b92 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.4.4
+8.0.0
diff --git a/pom.xml b/pom.xml
index 6ad2f5ab2..f5d54eef8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.easyposteasypost-api-client
- 7.4.4
+ 8.0.0jarcom.easypost:easypost-api-client
diff --git a/src/main/java/com/easypost/Constants.java b/src/main/java/com/easypost/Constants.java
index 53a6c68f5..5485932de 100644
--- a/src/main/java/com/easypost/Constants.java
+++ b/src/main/java/com/easypost/Constants.java
@@ -5,8 +5,8 @@
import com.easypost.model.AddressVerification;
import com.easypost.model.AddressVerificationDeserializer;
import com.easypost.model.ErrorDeserializer;
-import com.easypost.model.SmartrateCollection;
-import com.easypost.model.SmartrateCollectionDeserializer;
+import com.easypost.model.SmartRateCollection;
+import com.easypost.model.SmartRateCollectionDeserializer;
import com.easypost.model.StatelessRate;
import com.easypost.model.StatelessRateDeserializer;
import com.easypost.model.Webhook;
@@ -83,7 +83,7 @@ public abstract static class Http {
public static final Gson GSON = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.registerTypeAdapter(HashMap.class, new HashMapSerializer())
- .registerTypeAdapter(SmartrateCollection.class, new SmartrateCollectionDeserializer())
+ .registerTypeAdapter(SmartRateCollection.class, new SmartRateCollectionDeserializer())
.registerTypeAdapter(APIException.class, new ErrorDeserializer())
.registerTypeAdapter(AddressVerification.class, new AddressVerificationDeserializer())
.registerTypeAdapter(StatelessRate[].class, new StatelessRateDeserializer())
diff --git a/src/main/java/com/easypost/model/AddressVerificationDeserializer.java b/src/main/java/com/easypost/model/AddressVerificationDeserializer.java
index 1523fe4c8..2986edd44 100644
--- a/src/main/java/com/easypost/model/AddressVerificationDeserializer.java
+++ b/src/main/java/com/easypost/model/AddressVerificationDeserializer.java
@@ -18,11 +18,12 @@ public final class AddressVerificationDeserializer implements JsonDeserializer {
/**
- * Recursively traverse an error JSON element and its sub-element(s), and extracts all
+ * Recursively traverse an error JSON element and its sub-element(s), and
+ * extracts all
* error string values found into the specified string list.
*
- * @param element the JSON element to traverse
+ * @param element the JSON element to traverse
* @param messagesList the list of strings to append found values to
*/
private void traverseJsonElement(JsonElement element, ArrayList messagesList) {
@@ -45,11 +46,12 @@ private void traverseJsonElement(JsonElement element, ArrayList messages
* @param typeOfT Type of the object to deserialize.
* @param context Deserialization context.
* @return Deserialized APIException object.
- * @throws JsonParseException if the JSON object is not a valid SmartrateCollection.
+ * @throws JsonParseException if the JSON object is not a valid
+ * SmartRateCollection.
*/
@Override
public APIException deserialize(final JsonElement json, final Type typeOfT,
- final JsonDeserializationContext context) throws JsonParseException {
+ final JsonDeserializationContext context) throws JsonParseException {
JsonObject jo = json.getAsJsonObject();
String message = null;
@@ -83,7 +85,6 @@ public APIException deserialize(final JsonElement json, final Type typeOfT,
}
JsonElement errorsAsJson = errorData.get("errors");
- List