Skip to content

Commit

Permalink
[chore] Fix "All" parameter sets (#545)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
nwithan8 committed Feb 7, 2024
1 parent 7202a83 commit cb26fe6
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 80 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## Next Release

- Mark some unused parameters for various `All` functions as obsolete
- These will be removed in a later version. It is recommended to stop using these parameters immediately.

## v6.1.0 (2024-01-08)

- Add `AllChildren` and `GetNextPageOfChildren` functions to `User` service
Expand Down
1 change: 1 addition & 0 deletions EasyPost.Tests/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ internal static ParameterSets.Batch.All All(Dictionary<string, object>? fixture)
AfterId = fixture.GetOrNull<string>("after_id"),
StartDatetime = fixture.GetOrNull<string>("start_datetime"),
EndDatetime = fixture.GetOrNull<string>("end_datetime"),
Sort = fixture.GetOrNullEnum<SortDirection>("sort"),
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.Tests/ServicesTests/BatchServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task TestAll()
{
UseVCR("all");

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

List<Batch> batches = batchCollection.Batches;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task TestAll()
{
UseVCR("all");

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

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

Expand Down
21 changes: 10 additions & 11 deletions EasyPost.Tests/cassettes/net/batch_service/all.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cb26fe6

Please sign in to comment.