Skip to content

Commit

Permalink
Merge pull request #590 from EasyPost/remove_create_list
Browse files Browse the repository at this point in the history
chore: remove create_list tracker endpoint function
  • Loading branch information
Justintime50 authored Sep 23, 2024
2 parents 18d9b31 + abbc91d commit e5375e7
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 269 deletions.
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
17 changes: 0 additions & 17 deletions EasyPost.Tests/ServicesTests/WithParameters/TrackerServiceTest.cs
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

0 comments on commit e5375e7

Please sign in to comment.