Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes for v7 #606

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
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
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# CHANGELOG

# v6.9.0 (2024-11-19)
# v7.0.0 (TBD)

- Drop explicit support for .NET 5.0
- Add explicit support for .NET 9.0
- Remove previously-marked obsolete parameter, functions and classes:
- `EasyPost.Models.API.DeliveryDateForZipPairEstimate.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.DeliveryDateForZipPairEstimate.TimeInTransitDetails` instead)
- `EasyPost.Models.API.Options.BillReceiverAccount` property (use `EasyPost.Models.API.Options.Payment` instead)
- `EasyPost.Models.API.Options.BillReceiverPostalCode` property (use `EasyPost.Models.API.Options.Payment` instead)
- `EasyPost.Models.API.Options.BillThirdPartyAccount` property (use `EasyPost.Models.API.Options.Payment` instead)
- `EasyPost.Models.API.Options.BillThirdPartyCountry` property (use `EasyPost.Models.API.Options.Payment` instead)
- `EasyPost.Models.API.Options.BillThirdPartyPostalCode` property (use `EasyPost.Models.API.Options.Payment` instead)
- `EasyPost.Models.API.Rate.EstDeliveryDays` property (use `EasyPost.Models.API.Rate.DeliveryDays` instead)
- `EasyPost.Models.API.SmartRate.EstDeliveryDays` property (use `EasyPost.Models.API.SmartRate.DeliveryDays` instead)
- `EasyPost.Models.API.RateWithEstimatedDeliveryDate.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.RateWithEstimatedDeliveryDate.TimeInTransitDetails` instead)
- `EasyPost.Models.API.RecommendShipDateForShipmentResult.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.RecommendShipDateForShipmentResult.TimeInTransitDetails` instead)
- `EasyPost.Models.API.ShipDateForZipPairRecommendation.EasyPostTimeInTransitData` property (use `EasyPost.Models.API.ShipDateForZipPairRecommendation.TimeInTransitDetails` instead)
- `EasyPost.Models.API.Tracker.TrackingUpdatedAt` property (use `EasyPost.Models.API.Tracker.UpdatedAt` instead)
- `EasyPost.Models.API.TimeInTransitDetails` class (use `EasyPost.Models.API.TimeInTransitDetailsForDeliveryDateEstimate` instead)
- `EasyPost.Parameters.Tracker.All.TrackingCode` property (use `EasyPost.Parameters.Tracker.All.TrackingCodes` instead)
- `EasyPost.Parameters.Tracker.CreateList` class (related function was removed in v6.8.0)
- `EasyPost.Constants.CarrierAccounts.FedExAccount` variable (use `EasyPost.Models.API.CarrierAccountType.FedEx` instead)
- `EasyPost.Constants.CarrierAccounts.UpsAccount` variable (use `EasyPost.Models.API.CarrierAccountType.Ups` instead)
- Add missing `CheckDeliveryAddress` parameter for `Claim.Create` parameter set
- Handle enums when running parameter interdependency checks

# v6.9.0 (2024-11-22)

- Add missing `CheckDeliveryAddress` parameter for `Claim.Create` parameter set
- Handle enums when running parameter interdependency checks
Expand Down
2 changes: 0 additions & 2 deletions EasyPost.Integration/Basics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public void UserCanLocallyConstructResponseObject()
var supportedFeature = new SupportedFeature();
var taxIdentifier = new TaxIdentifier();
var timeInTransit = new TimeInTransit();
var timeInTransitDetails = new TimeInTransitDetails();
var timeInTransitDetailsForDeliveryDateEstimate = new TimeInTransitDetailsForDeliveryDateEstimate();
var timeInTransitDetailsByDeliveryDate = new TimeInTransitDetailsForShipDateRecommendation();
var tracker = new Tracker();
Expand Down Expand Up @@ -155,7 +154,6 @@ public void UserCanConstructParameterSets()
var taxIdentifierCreateParameters = new EasyPost.Parameters.TaxIdentifier.Create();
var trackerCreateParameters = new EasyPost.Parameters.Tracker.Create();
var trackerAllParameters = new EasyPost.Parameters.Tracker.All();
var trackerCreateListParameters = new EasyPost.Parameters.Tracker.CreateList();
var userCreateChildParameters = new EasyPost.Parameters.User.CreateChild();
var userAllChildrenParameters = new EasyPost.Parameters.User.AllChildren();
var userUpdateParameters = new EasyPost.Parameters.User.Update();
Expand Down
13 changes: 11 additions & 2 deletions EasyPost.Tests/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ internal static Dictionary<string, object> BasicPickup
{
Dictionary<string, object> fixture = GetFixtureStructure().Pickups.Basic;

const string pickupDate = "2024-08-21";
const string pickupDate = "2024-11-21";

fixture!.AddOrUpdate(pickupDate, "min_datetime");
fixture!.AddOrUpdate(pickupDate, "max_datetime");
Expand Down Expand Up @@ -759,14 +759,23 @@ internal static ParameterSets.Tracker.All All(Dictionary<string, object>? fixtur
{
fixture ??= new Dictionary<string, object>();

// Account for fixture migration from tracking_code to tracking_codes
List<string>? trackingCodes = fixture.GetOrNull<List<string>>("tracking_codes");

string? trackingCode = fixture.GetOrNull<string>("tracking_code");
if (trackingCodes == null && trackingCode != null)
{
trackingCodes = [trackingCode];
}

return new ParameterSets.Tracker.All
{
PageSize = fixture.GetOrNullInt("page_size"),
BeforeId = fixture.GetOrNull<string>("before_id"),
AfterId = fixture.GetOrNull<string>("after_id"),
StartDatetime = fixture.GetOrNull<string>("start_datetime"),
EndDatetime = fixture.GetOrNull<string>("end_datetime"),
TrackingCode = fixture.GetOrNull<string>("tracking_code"),
TrackingCodes = trackingCodes,
Carrier = fixture.GetOrNull<string>("carrier"),
};
}
Expand Down
8 changes: 4 additions & 4 deletions EasyPost.Tests/ServicesTests/ShipmentServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,10 @@ public async Task TestRetrieveEstimatedDeliveryDates()
foreach (var rate in ratesWithEstimatedDeliveryDates)
{
// Deprecated property
Assert.NotNull(rate.EasyPostTimeInTransitData);
Assert.NotNull(rate.EasyPostTimeInTransitData.EasyPostEstimatedDeliveryDate);
Assert.NotNull(rate.EasyPostTimeInTransitData.DaysInTransit);
Assert.NotNull(rate.EasyPostTimeInTransitData.PlannedShipDate);
Assert.NotNull(rate.TimeInTransitDetails);
Assert.NotNull(rate.TimeInTransitDetails.EasyPostEstimatedDeliveryDate);
Assert.NotNull(rate.TimeInTransitDetails.DaysInTransit);
Assert.NotNull(rate.TimeInTransitDetails.PlannedShipDate);

// Replacement property, same data
Assert.NotNull(rate.TimeInTransitDetails);
Expand Down
6 changes: 3 additions & 3 deletions EasyPost.Tests/ServicesTests/TrackerServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public async Task TestAllParameterHandOff()
UseVCR("all_parameter_hand_off");

Dictionary<string, object> filters = new Dictionary<string, object> {
{ "tracking_code", "0" },
{ "tracking_codes", new List<string> { "0" } },
{ "carrier", "test_carrier" },
};

TrackerCollection trackerCollection = await Client.Tracker.All(filters);

Assert.Equal(filters["tracking_code"], ((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCode);
Assert.Equal(filters["tracking_codes"], ((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCodes);
Assert.Equal(filters["carrier"], ((Parameters.Tracker.All)trackerCollection.Filters!).Carrier);
}

Expand Down Expand Up @@ -127,7 +127,7 @@ public async Task TestGetNextPageParameterHandOff()

Parameters.Tracker.All filtersForNextPage = trackerCollection.BuildNextPageParameters<Parameters.Tracker.All>(trackerCollection.Trackers);

Assert.Equal(((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCode, filtersForNextPage.TrackingCode);
Assert.Equal(((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCodes, filtersForNextPage.TrackingCodes);
Assert.Equal(((Parameters.Tracker.All)trackerCollection.Filters!).Carrier, filtersForNextPage.Carrier);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ public async Task TestEstimatedDeliveryDates()

foreach (var rate in ratesWithEstimatedDeliveryDates)
{
Assert.NotNull(rate.EasyPostTimeInTransitData);
Assert.NotNull(rate.EasyPostTimeInTransitData.EasyPostEstimatedDeliveryDate);
Assert.NotNull(rate.EasyPostTimeInTransitData.DaysInTransit);
Assert.NotNull(rate.EasyPostTimeInTransitData.PlannedShipDate);
Assert.NotNull(rate.TimeInTransitDetails);
Assert.NotNull(rate.TimeInTransitDetails.EasyPostEstimatedDeliveryDate);
Assert.NotNull(rate.TimeInTransitDetails.DaysInTransit);
Assert.NotNull(rate.TimeInTransitDetails.PlannedShipDate);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public async Task TestRecommendShipDate()
{
Assert.NotNull(estimate.Carrier);
Assert.NotNull(estimate.Service);
Assert.NotNull(estimate.EasyPostTimeInTransitData);
Assert.NotNull(estimate.EasyPostTimeInTransitData.DaysInTransit);
Assert.NotNull(estimate.EasyPostTimeInTransitData.DaysInTransit.Percentile75);
Assert.NotNull(estimate.TimeInTransitDetails);
Assert.NotNull(estimate.TimeInTransitDetails.DaysInTransit);
Assert.NotNull(estimate.TimeInTransitDetails.DaysInTransit.Percentile75);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task TestAllParameterHandOff()

Parameters.Tracker.All filters = new()
{
TrackingCode = "0",
TrackingCodes = ["0"],
Carrier = "test_carrier",
};

Expand All @@ -88,7 +88,7 @@ public async Task TestAllParameterHandOff()
};
trackerCollection.Trackers.Add(fakeTracker);

Assert.Equal(filters.TrackingCode, ((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCode);
Assert.Equal(filters.TrackingCodes, ((Parameters.Tracker.All)trackerCollection.Filters!).TrackingCodes);
Assert.Equal(filters.Carrier, ((Parameters.Tracker.All)trackerCollection.Filters!).Carrier);
}

Expand Down
Loading
Loading