Skip to content

Commit cb26fe6

Browse files
authored
[chore] Fix "All" parameter sets (#545)
- Add missing "sort" parameter for batch list parameter set - Mark unused parameters for various list endpoints as "obsolete" - Handle de/serializing enums in parameter sets - Replace outdated docstrings with links to web docs
1 parent 7202a83 commit cb26fe6

File tree

19 files changed

+145
-80
lines changed

19 files changed

+145
-80
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## Next Release
4+
5+
- Mark some unused parameters for various `All` functions as obsolete
6+
- These will be removed in a later version. It is recommended to stop using these parameters immediately.
7+
38
## v6.1.0 (2024-01-08)
49

510
- Add `AllChildren` and `GetNextPageOfChildren` functions to `User` service

EasyPost.Tests/Fixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ internal static ParameterSets.Batch.All All(Dictionary<string, object>? fixture)
210210
AfterId = fixture.GetOrNull<string>("after_id"),
211211
StartDatetime = fixture.GetOrNull<string>("start_datetime"),
212212
EndDatetime = fixture.GetOrNull<string>("end_datetime"),
213+
Sort = fixture.GetOrNullEnum<SortDirection>("sort"),
213214
};
214215
}
215216
}

EasyPost.Tests/ServicesTests/BatchServiceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public async Task TestAll()
4040
{
4141
UseVCR("all");
4242

43-
BatchCollection batchCollection = await Client.Batch.All(new Dictionary<string, object> { { "page_size", Fixtures.PageSize } });
43+
BatchCollection batchCollection = await Client.Batch.All(new Dictionary<string, object> { { "page_size", Fixtures.PageSize }, { "sort", "asc" } });
4444

4545
List<Batch> batches = batchCollection.Batches;
4646

EasyPost.Tests/ServicesTests/WithParameters/BatchServiceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task TestAll()
4444
{
4545
UseVCR("all");
4646

47-
Dictionary<string, object> data = new Dictionary<string, object> { { "page_size", Fixtures.PageSize } };
47+
Dictionary<string, object> data = new Dictionary<string, object> { { "page_size", Fixtures.PageSize }, { "sort", "asc" } };
4848

4949
Parameters.Batch.All parameters = Fixtures.Parameters.Batches.All(data);
5050

EasyPost.Tests/cassettes/net/batch_service/all.json

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

0 commit comments

Comments
 (0)