diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0b80f7..31a767e6 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 + ## v6.7.3 (2024-09-17) - Corrects all API documentation link references to point to their new locations diff --git a/EasyPost.Tests/ServicesTests/TrackerServiceTest.cs b/EasyPost.Tests/ServicesTests/TrackerServiceTest.cs index 49ca5ed1..fc6146ac 100644 --- a/EasyPost.Tests/ServicesTests/TrackerServiceTest.cs +++ b/EasyPost.Tests/ServicesTests/TrackerServiceTest.cs @@ -34,23 +34,6 @@ public async Task TestCreate() Assert.Equal("pre_transit", tracker.Status); } - [Fact] - [CrudOperations.Create] - [Testing.Function] - public async Task TestCreateList() - { - UseVCR("create_list"); - - Exception? possibleException = await Record.ExceptionAsync(async () => await Client.Tracker.CreateList(new Dictionary - { - { "0", new Dictionary { { "tracking_code", "EZ1000000001" } } }, - { "1", new Dictionary { { "tracking_code", "EZ1000000002" } } }, - { "2", new Dictionary { { "tracking_code", "EZ1000000003" } } } - })); - - Assert.Null(possibleException); - } - [Fact] [CrudOperations.Read] [Testing.Function] diff --git a/EasyPost.Tests/ServicesTests/WithParameters/TrackerServiceTest.cs b/EasyPost.Tests/ServicesTests/WithParameters/TrackerServiceTest.cs index 2c0f30a6..a9563dbc 100644 --- a/EasyPost.Tests/ServicesTests/WithParameters/TrackerServiceTest.cs +++ b/EasyPost.Tests/ServicesTests/WithParameters/TrackerServiceTest.cs @@ -39,23 +39,6 @@ public async Task TestCreate() Assert.Equal("pre_transit", tracker.Status); } - [Fact] - [CrudOperations.Create] - [Testing.Function] - public async Task TestCreateList() - { - UseVCR("create_list"); - - Parameters.Tracker.CreateList parameters = new(); - parameters.AddTracker("EZ1000000001"); - parameters.AddTracker("EZ1000000002"); - parameters.AddTracker("EZ1000000003"); - - Exception? possibleException = await Record.ExceptionAsync(async () => await Client.Tracker.CreateList(parameters)); - - Assert.Null(possibleException); - } - [Fact] [CrudOperations.Read] [Testing.Function] diff --git a/EasyPost.Tests/cassettes/net/tracker_service/create_list.json b/EasyPost.Tests/cassettes/net/tracker_service/create_list.json deleted file mode 100644 index 6a31371e..00000000 --- a/EasyPost.Tests/cassettes/net/tracker_service/create_list.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "Duration": 19, - "RecordedAt": "2024-08-16T11:12:58.771422-06:00", - "Request": { - "Body": "{\"trackers\":{\"0\":{\"tracking_code\":\"EZ1000000001\"},\"1\":{\"tracking_code\":\"EZ1000000002\"},\"2\":{\"tracking_code\":\"EZ1000000003\"}}}", - "BodyContentType": "Json", - "ContentHeaders": { - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "125" - }, - "Method": "POST", - "RequestHeaders": { - "Authorization": "", - "User-Agent": "" - }, - "Uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "Response": { - "Body": "{}", - "BodyContentType": "Json", - "ContentHeaders": { - "Expires": "0", - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "2" - }, - "HttpVersion": "1.1", - "ResponseHeaders": { - "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": "8a4bf43a66bf889af42c842d004a4caf", - "Cache-Control": "no-store, no-cache, private", - "Pragma": "no-cache", - "x-runtime": "0.051369", - "x-node": "bigweb35nuq", - "x-version-label": "easypost-202408161634-c713989c9f-master", - "x-backend": "easypost", - "x-proxied": "intlb4nuq c0f5e722d1,extlb1nuq b6e1b5034c", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload" - }, - "Status": { - "Code": 200, - "Message": "OK" - } - } - } -] diff --git a/EasyPost.Tests/cassettes/net/tracker_service_with_parameters/create_list.json b/EasyPost.Tests/cassettes/net/tracker_service_with_parameters/create_list.json deleted file mode 100644 index b7d2218d..00000000 --- a/EasyPost.Tests/cassettes/net/tracker_service_with_parameters/create_list.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "Duration": 819, - "RecordedAt": "2024-08-16T11:13:00.205366-06:00", - "Request": { - "Body": "{\"trackers\":{\"0\":{\"tracking_code\":\"EZ1000000001\"},\"1\":{\"tracking_code\":\"EZ1000000002\"},\"2\":{\"tracking_code\":\"EZ1000000003\"}}}", - "BodyContentType": "Json", - "ContentHeaders": { - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "125" - }, - "Method": "POST", - "RequestHeaders": { - "Authorization": "", - "User-Agent": "" - }, - "Uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "Response": { - "Body": "{}", - "BodyContentType": "Json", - "ContentHeaders": { - "Expires": "0", - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "2" - }, - "HttpVersion": "1.1", - "ResponseHeaders": { - "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": "0580883766bf889cf42d14aa0048f04a", - "Cache-Control": "no-store, no-cache, private", - "Pragma": "no-cache", - "x-runtime": "0.072425", - "x-node": "bigweb39nuq", - "x-version-label": "easypost-202408161634-c713989c9f-master", - "x-backend": "easypost", - "x-proxied": "intlb4nuq c0f5e722d1,extlb2nuq b6e1b5034c", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload" - }, - "Status": { - "Code": 200, - "Message": "OK" - } - } - } -] diff --git a/EasyPost.Tests/cassettes/netstandard/tracker_service/create_list.json b/EasyPost.Tests/cassettes/netstandard/tracker_service/create_list.json deleted file mode 100644 index 4546865d..00000000 --- a/EasyPost.Tests/cassettes/netstandard/tracker_service/create_list.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "Duration": 745, - "RecordedAt": "2024-08-16T11:14:18.153101-06:00", - "Request": { - "Body": "{\"trackers\":{\"0\":{\"tracking_code\":\"EZ1000000001\"},\"1\":{\"tracking_code\":\"EZ1000000002\"},\"2\":{\"tracking_code\":\"EZ1000000003\"}}}", - "BodyContentType": "Json", - "ContentHeaders": { - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "125" - }, - "Method": "POST", - "RequestHeaders": { - "Authorization": "", - "User-Agent": "" - }, - "Uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "Response": { - "Body": "{}", - "BodyContentType": "Json", - "ContentHeaders": { - "Expires": "0", - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "2" - }, - "HttpVersion": "1.1", - "ResponseHeaders": { - "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": "0580883066bf88eaf0217d5700494af1", - "Cache-Control": "no-store, no-cache, private", - "Pragma": "no-cache", - "x-runtime": "0.048803", - "x-node": "bigweb32nuq", - "x-version-label": "easypost-202408161634-c713989c9f-master", - "x-backend": "easypost", - "x-canary": "direct", - "x-proxied": "intlb4nuq c0f5e722d1,extlb2nuq b6e1b5034c", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload" - }, - "Status": { - "Code": 200, - "Message": "OK" - } - } - } -] diff --git a/EasyPost.Tests/cassettes/netstandard/tracker_service_with_parameters/create_list.json b/EasyPost.Tests/cassettes/netstandard/tracker_service_with_parameters/create_list.json deleted file mode 100644 index 3f35a9cd..00000000 --- a/EasyPost.Tests/cassettes/netstandard/tracker_service_with_parameters/create_list.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "Duration": 153, - "RecordedAt": "2024-08-16T11:14:19.566034-06:00", - "Request": { - "Body": "{\"trackers\":{\"0\":{\"tracking_code\":\"EZ1000000001\"},\"1\":{\"tracking_code\":\"EZ1000000002\"},\"2\":{\"tracking_code\":\"EZ1000000003\"}}}", - "BodyContentType": "Json", - "ContentHeaders": { - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "125" - }, - "Method": "POST", - "RequestHeaders": { - "Authorization": "", - "User-Agent": "" - }, - "Uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "Response": { - "Body": "{}", - "BodyContentType": "Json", - "ContentHeaders": { - "Expires": "0", - "Content-Type": "application/json; charset=utf-8", - "Content-Length": "2" - }, - "HttpVersion": "1.1", - "ResponseHeaders": { - "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": "8a4bf43e66bf88ebf3fa158e004aaf93", - "Cache-Control": "no-store, no-cache, private", - "Pragma": "no-cache", - "x-runtime": "0.043512", - "x-node": "bigweb32nuq", - "x-version-label": "easypost-202408161634-c713989c9f-master", - "x-backend": "easypost", - "x-canary": "direct", - "x-proxied": "intlb4nuq c0f5e722d1,extlb1nuq b6e1b5034c", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload" - }, - "Status": { - "Code": 200, - "Message": "OK" - } - } - } -] diff --git a/EasyPost/Services/TrackerService.cs b/EasyPost/Services/TrackerService.cs index 1cf7618a..f7d21f82 100644 --- a/EasyPost/Services/TrackerService.cs +++ b/EasyPost/Services/TrackerService.cs @@ -62,34 +62,6 @@ public async Task Create(Parameters.Tracker.Create parameters, Cancella return await RequestAsync(Method.Post, "trackers", cancellationToken, parameters.ToDictionary()); } - /// - /// Create a list of s. - /// - /// A dictionary of tracking codes and carriers. - /// to use for the HTTP request. - /// true if successful, false otherwise. - [CrudOperations.Create] - [Obsolete("This method is deprecated. Please use TrackerService.Create() instead. This method will be removed in a future version.", false)] - public async Task CreateList(Dictionary parameters, CancellationToken cancellationToken = default) - { - parameters = parameters.Wrap("trackers"); - // This endpoint does not return a response, so we simply send the request and only throw an exception if the API returns an error. - await RequestAsync(Method.Post, "trackers/create_list", cancellationToken, parameters); - } - - /// - /// Create a list of s. - /// - /// Parameters to use to create the s. - /// to use for the HTTP request. - /// true if successful, false otherwise. - [CrudOperations.Create] - [Obsolete("This method is deprecated. Please use TrackerService.Create() instead. This method will be removed in a future version.", false)] - public async Task CreateList(Parameters.Tracker.CreateList parameters, CancellationToken cancellationToken = default) - { - await RequestAsync(Method.Post, "trackers/create_list", cancellationToken, parameters.ToDictionary()); - } - /// /// List all s. /// Related API documentation.