Skip to content

Commit

Permalink
Merge pull request #219 from EasyPost/deprecate_tracker_list
Browse files Browse the repository at this point in the history
chore: deprecate create_list function
  • Loading branch information
Justintime50 committed Jun 14, 2024
2 parents 6e2387c + 416e3d1 commit 60588f3
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 229 deletions.
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 2714 files
130 changes: 76 additions & 54 deletions tests/cassettes/TestOrderBuyRate.yaml

Large diffs are not rendered by default.

70 changes: 40 additions & 30 deletions tests/cassettes/TestOrderCreate.yaml

Large diffs are not rendered by default.

134 changes: 76 additions & 58 deletions tests/cassettes/TestOrderGetRates.yaml

Large diffs are not rendered by default.

70 changes: 40 additions & 30 deletions tests/cassettes/TestOrderLowestRate.yaml

Large diffs are not rendered by default.

130 changes: 76 additions & 54 deletions tests/cassettes/TestOrderRetrieve.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ func (c *ClientTests) TestOrderLowestRate() {
lowestRate, err := client.LowestOrderRate(order)
require.NoError(err)
assert.Equal("GroundAdvantage", lowestRate.Service)
assert.Equal("5.93", lowestRate.Rate)
assert.Equal("11.33", lowestRate.Rate)
assert.Equal("USPS", lowestRate.Carrier)

// Test lowest rate with service filter (this rate is higher than the lowest but should filter)
lowestRate, err = client.LowestOrderRateWithCarrierAndService(order, nil, []string{"Priority"})
require.NoError(err)
assert.Equal("Priority", lowestRate.Service)
assert.Equal("6.95", lowestRate.Rate)
assert.Equal("13.79", lowestRate.Rate)
assert.Equal("USPS", lowestRate.Carrier)

// Test lowest rate with carrier filter (should error due to bad carrier)
Expand Down
4 changes: 4 additions & 0 deletions tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ func (c *Client) CreateTrackerWithContext(ctx context.Context, opts *CreateTrack

// CreateTrackerList asynchronously creates multiple trackers.
// Input a map of maps that contains multiple tracking codes
//
// Deprecated: Use the CreateTracker function instead. CreateTrackerList will be removed in a future release.
func (c *Client) CreateTrackerList(param map[string]interface{}) (bool, error) {
// The data structure must look like the following when calling the API:
// {
Expand All @@ -172,6 +174,8 @@ func (c *Client) CreateTrackerList(param map[string]interface{}) (bool, error) {
// CreateTrackerListWithContext performs the same operation as
// CreateTrackerList, but allows specifying a context that can interrupt the
// request.
//
// Deprecated: Use the CreateTracker function instead. CreateTrackerList will be removed in a future release.
func (c *Client) CreateTrackerListWithContext(ctx context.Context, param map[string]interface{}) (bool, error) {
req := map[string]interface{}{"trackers": param}
// This endpoint does not return a response, so we return true here
Expand Down

0 comments on commit 60588f3

Please sign in to comment.