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

chore: remove create_list tracker endpoint function #590

Merged
merged 2 commits into from
Sep 23, 2024
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next Release

- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API

## v6.7.3 (2024-09-17)

- Corrects all API documentation link references to point to their new locations
Expand Down
17 changes: 0 additions & 17 deletions EasyPost.Tests/ServicesTests/TrackerServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ public async Task TestCreate()
Assert.Equal("pre_transit", tracker.Status);
}

[Fact]
[CrudOperations.Create]
[Testing.Function]
public async Task TestCreateList()
{
UseVCR("create_list");

Exception? possibleException = await Record.ExceptionAsync(async () => await Client.Tracker.CreateList(new Dictionary<string, object>
{
{ "0", new Dictionary<string, object> { { "tracking_code", "EZ1000000001" } } },
{ "1", new Dictionary<string, object> { { "tracking_code", "EZ1000000002" } } },
{ "2", new Dictionary<string, object> { { "tracking_code", "EZ1000000003" } } }
}));

Assert.Null(possibleException);
}

[Fact]
[CrudOperations.Read]
[Testing.Function]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ public async Task TestCreate()
Assert.Equal("pre_transit", tracker.Status);
}

[Fact]
[CrudOperations.Create]
[Testing.Function]
public async Task TestCreateList()
{
UseVCR("create_list");

Parameters.Tracker.CreateList parameters = new();
parameters.AddTracker("EZ1000000001");
parameters.AddTracker("EZ1000000002");
parameters.AddTracker("EZ1000000003");

Exception? possibleException = await Record.ExceptionAsync(async () => await Client.Tracker.CreateList(parameters));

Assert.Null(possibleException);
}

[Fact]
[CrudOperations.Read]
[Testing.Function]
Expand Down
51 changes: 0 additions & 51 deletions EasyPost.Tests/cassettes/net/tracker_service/create_list.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions EasyPost/Services/TrackerService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -62,34 +61,6 @@ public async Task<Tracker> Create(Parameters.Tracker.Create parameters, Cancella
return await RequestAsync<Tracker>(Method.Post, "trackers", cancellationToken, parameters.ToDictionary());
}

/// <summary>
/// Create a list of <see cref="Tracker"/>s.
/// </summary>
/// <param name="parameters">A dictionary of tracking codes and carriers.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/> to use for the HTTP request.</param>
/// <returns><c>true</c> if successful, <c>false</c> otherwise.</returns>
[CrudOperations.Create]
[Obsolete("This method is deprecated. Please use TrackerService.Create() instead. This method will be removed in a future version.", false)]
public async Task CreateList(Dictionary<string, object> parameters, CancellationToken cancellationToken = default)
{
parameters = parameters.Wrap("trackers");
// This endpoint does not return a response, so we simply send the request and only throw an exception if the API returns an error.
await RequestAsync(Method.Post, "trackers/create_list", cancellationToken, parameters);
}

/// <summary>
/// Create a list of <see cref="Tracker"/>s.
/// </summary>
/// <param name="parameters">Parameters to use to create the <see cref="Tracker"/>s.</param>
/// <param name="cancellationToken"><see cref="CancellationToken"/> to use for the HTTP request.</param>
/// <returns><c>true</c> if successful, <c>false</c> otherwise.</returns>
[CrudOperations.Create]
[Obsolete("This method is deprecated. Please use TrackerService.Create() instead. This method will be removed in a future version.", false)]
public async Task CreateList(Parameters.Tracker.CreateList parameters, CancellationToken cancellationToken = default)
{
await RequestAsync(Method.Post, "trackers/create_list", cancellationToken, parameters.ToDictionary());
}

/// <summary>
/// List all <see cref="Tracker"/>s.
/// <a href="https://docs.easypost.com/docs/trackers#retrieve-all-trackers">Related API documentation</a>.
Expand Down
Loading