|
2 | 2 |
|
3 | 3 | Use the following guide to assist in the upgrade process of the `easypost-csharp` library between major versions.
|
4 | 4 |
|
| 5 | +- [Upgrading from 6.x to 7.0](#upgrading-from-6x-to-70) |
5 | 6 | - [Upgrading from 5.x to 6.0](#upgrading-from-5x-to-60)
|
6 | 7 | - [Upgrading from 4.x to 5.0](#upgrading-from-4x-to-50)
|
7 | 8 | - [Upgrading from 3.x to 4.x](#upgrading-from-3x-to-40)
|
8 | 9 | - [Upgrading from 2.x to 3.0](#upgrading-from-2x-to-30)
|
9 | 10 |
|
| 11 | +## Upgrading from 6.x to 7.0 |
| 12 | + |
| 13 | +### 7.0 High Impact Changes |
| 14 | + |
| 15 | +- [.NET Support](#70-net-support) |
| 16 | +- [Error Parsing](#70-error-parsing) |
| 17 | + |
| 18 | +### 7.0 Medium Impact Changes |
| 19 | + |
| 20 | +- [Deprecations](#70-deprecations) |
| 21 | + |
| 22 | +## 7.0 .NET Support |
| 23 | + |
| 24 | +*Likelihood of Impact: **High*** |
| 25 | + |
| 26 | +.NET Framework 4.7.2+ now required. |
| 27 | + |
| 28 | +## 7.0 Error Parsing |
| 29 | + |
| 30 | +*Likelihood of Impact: **High*** |
| 31 | + |
| 32 | +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. |
| 33 | + |
| 34 | +The `Error` model has been removed since it is unused and we directly assign properties of an error response to the `ApiError` type. |
| 35 | + |
| 36 | +The `PaymentRefund` now uses a list of `FieldError` instead of `Error` for the `errors` field. |
| 37 | + |
| 38 | +## 7.0 Deprecations |
| 39 | + |
| 40 | +The following parameters, functions, and classes have been removed: |
| 41 | + |
| 42 | +- `EasyPost.Models.API.DeliveryDateForZipPairEstimate.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.DeliveryDateForZipPairEstimate.TimeInTransitDetails` instead) |
| 43 | +- `EasyPost.Models.API.Options.BillReceiverAccount` property (use `EasyPost.Models.API.Options.Payment` instead) |
| 44 | +- `EasyPost.Models.API.Options.BillReceiverPostalCode` property (use `EasyPost.Models.API.Options.Payment` instead) |
| 45 | +- `EasyPost.Models.API.Options.BillThirdPartyAccount` property (use `EasyPost.Models.API.Options.Payment` instead) |
| 46 | +- `EasyPost.Models.API.Options.BillThirdPartyCountry` property (use `EasyPost.Models.API.Options.Payment` instead) |
| 47 | +- `EasyPost.Models.API.Options.BillThirdPartyPostalCode` property (use `EasyPost.Models.API.Options.Payment` instead) |
| 48 | +- `EasyPost.Models.API.Rate.EstDeliveryDays` property (use `EasyPost.Models.API.Rate.DeliveryDays` instead) |
| 49 | +- `EasyPost.Models.API.SmartRate.EstDeliveryDays` property (use `EasyPost.Models.API.SmartRate.DeliveryDays` instead) |
| 50 | +- `EasyPost.Models.API.RateWithEstimatedDeliveryDate.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.RateWithEstimatedDeliveryDate.TimeInTransitDetails` instead) |
| 51 | +- `EasyPost.Models.API.RecommendShipDateForShipmentResult.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.RecommendShipDateForShipmentResult.TimeInTransitDetails` instead) |
| 52 | +- `EasyPost.Models.API.ShipDateForZipPairRecommendation.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.ShipDateForZipPairRecommendation.TimeInTransitDetails` instead) |
| 53 | +- `EasyPost.Models.API.Tracker.TrackingUpdatedAt` property (use `EasyPost.Models.API.Tracker.UpdatedAt` instead) |
| 54 | +- `EasyPost.Models.API.TimeInTransitDetails` class (use `EasyPost.Models.API.TimeInTransitDetailsForDeliveryDateEstimate` instead) |
| 55 | +- `EasyPost.Parameters.Tracker.CreateList` class (related function was removed in v6.8.0) |
| 56 | +- `EasyPost.Constants.CarrierAccounts.FedExAccount` variable (use `EasyPost.Models.API.CarrierAccountType.FedEx` instead) |
| 57 | +- `EasyPost.Constants.CarrierAccounts.UpsAccount` variable (use `EasyPost.Models.API.CarrierAccountType.Ups` instead) |
| 58 | + |
10 | 59 | ## Upgrading from 5.x to 6.0
|
11 | 60 |
|
| 61 | +**NOTICE:** v6 is deprecated. |
| 62 | + |
12 | 63 | ### 6.0 High Impact Changes
|
13 | 64 |
|
14 | 65 | - [.NET Support](#60-net-support)
|
@@ -95,11 +146,13 @@ purchasedPickup = await myClient.Pickup.Buy(pickup.Id); // need to capture the u
|
95 | 146 | The process of configuring a `Client` has been overhauled to allow for more flexibility in the configuration process.
|
96 | 147 |
|
97 | 148 | Old method:
|
| 149 | + |
98 | 150 | ```csharp
|
99 | 151 | Client myClient = new Client("my_api_key");
|
100 | 152 | ```
|
101 | 153 |
|
102 | 154 | New method:
|
| 155 | + |
103 | 156 | ```csharp
|
104 | 157 | Client myClient = new Client(new ClientConfiguration("my_api_key"));
|
105 | 158 | ```
|
@@ -151,11 +204,13 @@ Some exception types have been consolidated or altered:
|
151 | 204 | The Parameter objects introduced in [`v4.5.0`](CHANGELOG.md#v450-2023-03-22) have been moved out of beta. As a result, the classes are available in a different namespace.
|
152 | 205 |
|
153 | 206 | Old namespace:
|
| 207 | + |
154 | 208 | ```csharp
|
155 | 209 | var parameters = new EasyPost.BetaFeatures.Parameters.Addresses.Create();
|
156 | 210 | ```
|
157 | 211 |
|
158 | 212 | New namespace:
|
| 213 | + |
159 | 214 | ```csharp
|
160 | 215 | var parameters = new EasyPost.Parameters.Address.Create();
|
161 | 216 | ```
|
|
0 commit comments