Add framework for typing query arguments to methods.
Review Request #14339 — Created Feb. 10, 2025 and submitted — Latest diff uploaded
This change adds some machinery for rewriting query argument names so we
can more easily deal with API endpoints that use hyphens in parameters.A couple new classes have been added for basic parameter lists for GET
operations on item and list resources, that include the built-in request
parameters that are supported for all resources.I've also added additional TypedDicts for existing resource subclasses
which have special parameters for their GET operations. This makes it so
something likeroot.get_review_requests(branch=False)
will pop up a
warning that thebranch
parameter must bestr
.
- Ran unit tests.
- Used a test script to verify that typing was correctly passed through
for methods that take kwargs for query parameters.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.
Commits
Files
rbtools/api/resource/base.py |
---|
rbtools/api/resource/diff.py |
---|
rbtools/api/resource/diff_file_attachment.py |
---|
rbtools/api/resource/draft_diff_commit.py |
---|
rbtools/api/resource/file_diff.py |
---|
rbtools/api/resource/mixins.py |
---|
rbtools/api/resource/review_request.py |
---|
rbtools/api/resource/root.py |
---|
rbtools/api/resource/validate_diff_commit.py |
---|