Skip to content

Commit

Permalink
chore: remove create_list tracker endpoint function
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Sep 23, 2024
1 parent 00de74f commit 4336f28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 121 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

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

0 comments on commit 4336f28

Please sign in to comment.