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: deprecate create_list function #219

Merged
merged 2 commits into from
Jun 14, 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
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
Loading