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 #351

Merged
merged 1 commit 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

## v7.4.2 (2024-08-16)

- Fixes an issue with how query params were sent when using the `addCreditCard` function
Expand Down
20 changes: 0 additions & 20 deletions lib/EasyPost/Service/TrackerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,4 @@ public function create(mixed $params = null): mixed

return self::createResource(self::serviceModelClassName(self::class), $params);
}

/**
* Create a list of trackers.
*
* @param mixed $params
* @return void
* @deprecated
*/
public function createList(mixed $params = null): void
{
if (!isset($params['trackers']) || !is_array($params['trackers'])) {
$clone = $params;
unset($params);
$params = ['trackers' => $clone];
}

$url = self::classUrl(self::serviceModelClassName(self::class));

Requestor::request($this->client, 'post', $url . '/create_list', $params);
}
}
21 changes: 0 additions & 21 deletions test/EasyPost/TrackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,4 @@ public function testGetNextPage(): void
throw $error;
}
}

/**
* Tests that we can create a list of bulk trackers with one request.
*/
public function testCreateList(): void
{
TestUtil::setupCassette('trackers/createList.yml');

try {
// PHP is dumb and tries to make indexed arrays into a list instead of an object.
// Naming the index for PHP is the workaround.
self::$client->tracker->createList([
'tracker0' => ['tracking_code' => 'EZ1000000001'],
'tracker1' => ['tracking_code' => 'EZ1000000002'],
'tracker2' => ['tracking_code' => 'EZ1000000003'],
]);
$this->assertTrue(true);
} catch (\Exception $exception) {
$this->fail('Exception thrown when we expected no error');
}
}
}
80 changes: 0 additions & 80 deletions test/cassettes/trackers/createList.yml

This file was deleted.

Loading