From 4336f281d8d176bb4b94020756a77bc4c16fe25e Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:55:29 -0600 Subject: [PATCH] chore: remove create_list tracker endpoint function --- CHANGELOG.md | 4 ++ lib/EasyPost/Service/TrackerService.php | 20 ------- test/EasyPost/TrackerTest.php | 21 ------- test/cassettes/trackers/createList.yml | 80 ------------------------- 4 files changed, 4 insertions(+), 121 deletions(-) delete mode 100644 test/cassettes/trackers/createList.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3d552c..960b117d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/EasyPost/Service/TrackerService.php b/lib/EasyPost/Service/TrackerService.php index a2cb13cc..90f4d1a3 100644 --- a/lib/EasyPost/Service/TrackerService.php +++ b/lib/EasyPost/Service/TrackerService.php @@ -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); - } } diff --git a/test/EasyPost/TrackerTest.php b/test/EasyPost/TrackerTest.php index 408057eb..4c4f9474 100644 --- a/test/EasyPost/TrackerTest.php +++ b/test/EasyPost/TrackerTest.php @@ -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'); - } - } } diff --git a/test/cassettes/trackers/createList.yml b/test/cassettes/trackers/createList.yml deleted file mode 100644 index 4c93ec65..00000000 --- a/test/cassettes/trackers/createList.yml +++ /dev/null @@ -1,80 +0,0 @@ - -- - request: - method: POST - url: 'https://api.easypost.com/v2/trackers/create_list' - headers: - Host: api.easypost.com - Expect: '' - Accept-Encoding: '' - Accept: application/json - Authorization: '' - Content-Type: application/json - User-Agent: '' - body: '{"trackers":{"tracker0":{"tracking_code":"EZ1000000001"},"tracker1":{"tracking_code":"EZ1000000002"},"tracker2":{"tracking_code":"EZ1000000003"}}}' - response: - status: - code: 200 - message: OK - headers: - x-frame-options: SAMEORIGIN - x-xss-protection: '1; mode=block' - x-content-type-options: nosniff - x-download-options: noopen - x-permitted-cross-domain-policies: none - referrer-policy: strict-origin-when-cross-origin - x-ep-request-uuid: e181587666bcec24e2b9043e00872369 - cache-control: 'private, no-cache, no-store' - pragma: no-cache - expires: '0' - content-type: 'application/json; charset=utf-8' - content-length: '2' - x-runtime: '0.055886' - x-node: bigweb35nuq - x-version-label: easypost-202408141633-8ef9a7bcc9-master - x-backend: easypost - x-proxied: ['intlb4nuq c0f5e722d1', 'extlb2nuq b6e1b5034c'] - strict-transport-security: 'max-age=31536000; includeSubDomains; preload' - body: '[]' - curl_info: - url: 'https://api.easypost.com/v2/trackers/create_list' - content_type: 'application/json; charset=utf-8' - http_code: 200 - header_size: 686 - request_size: 465 - filetime: -1 - ssl_verify_result: 0 - redirect_count: 0 - total_time: 0.165462 - namelookup_time: 0.002068 - connect_time: 0.034594 - pretransfer_time: 0.073559 - size_upload: 146.0 - size_download: 2.0 - speed_download: 12.0 - speed_upload: 882.0 - download_content_length: 2.0 - upload_content_length: 146.0 - starttransfer_time: 0.16544 - redirect_time: 0.0 - redirect_url: '' - primary_ip: 169.62.110.130 - certinfo: { } - primary_port: 443 - local_ip: 192.168.1.75 - local_port: 52869 - http_version: 2 - protocol: 2 - ssl_verifyresult: 0 - scheme: https - appconnect_time_us: 73465 - connect_time_us: 34594 - namelookup_time_us: 2068 - pretransfer_time_us: 73559 - redirect_time_us: 0 - starttransfer_time_us: 165440 - total_time_us: 165462 - effective_method: POST - capath: '' - cainfo: '' - index: 0