Skip to content

Commit aa71613

Browse files
Justintime50claude
andauthored
feat: delete tracker (#373)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 57819f3 commit aa71613

File tree

4 files changed

+208
-0
lines changed

4 files changed

+208
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `apiKey.delete`
88
- `apiKey.enable`
99
- `apiKey.disable`
10+
- Adds a `tracker.delete` function
1011

1112
## v8.5.1 (2026-01-08)
1213

src/main/java/com/easypost/service/TrackerService.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,16 @@ public TrackerCollection retrieveBatch(final Map<String, Object> params) throws
116116

117117
return trackerCollection;
118118
}
119+
120+
/**
121+
* Delete a Tracker object.
122+
*
123+
* @param id ID of the Tracker to delete.
124+
* @throws EasyPostException when the request fails.
125+
*/
126+
public void delete(final String id) throws EasyPostException {
127+
String endpoint = String.format("trackers/%s", id);
128+
129+
Requestor.request(RequestMethod.DELETE, endpoint, null, Tracker.class, client);
130+
}
119131
}

src/test/cassettes/tracker/delete.json

Lines changed: 180 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/java/com/easypost/TrackerTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,19 @@ public void testRetrieveBatch() throws EasyPostException {
228228

229229
assertTrue(trackersList.stream().allMatch(singleTracker -> singleTracker != null));
230230
}
231+
232+
/**
233+
* Test deleting a tracker.
234+
*
235+
* @throws EasyPostException when the request fails.
236+
*/
237+
@Test
238+
public void testDelete() throws EasyPostException {
239+
vcr.setUpTest("delete");
240+
241+
Tracker tracker = createBasicTracker();
242+
243+
// Nothing gets returned here, simply ensure no error gets raised
244+
vcr.client.tracker.delete(tracker.getId());
245+
}
231246
}

0 commit comments

Comments
 (0)