-
Couldn't load subscription status.
- Fork 31
feat: add streamed-list-objects endpoint #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (69.56%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
+ Coverage 69.49% 69.56% +0.07%
==========================================
Files 133 135 +2
Lines 10554 10839 +285
==========================================
+ Hits 7334 7540 +206
- Misses 3220 3299 +79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
590f561 to
cfed381
Compare
cfed381 to
9eeb5d0
Compare
Description
This introduces support for OpenFGA's
POST /stores/{store_id}/streamed-list-objectsendpoint.The pull request introduces:
streamed_list_objects()method to the SDK client, simplifying the handling of the streaming endpoint for developers.stream()method to the async/sync REST clients, which supports handling of streaming/chunked HTTP network requests.build_request()method to the async/sync REST clients to handle the request-building steps shared by therequest()andstream()methods.handle_response_exception()method to the async/sync REST clients to handle the HTTP response exception processing shared between therequest()andstream()methods._accumulate_json_lines()private method to the async/sync REST clients to help collect and reassemble partially delivered packets from streaming/chunked HTTP network requests. This method is used bystream().streamed_list_objects_responseandstream_result_of_streamed_list_objects_responsemodels./example/streamed-list-objectsexample app, demonstrating usage through both the asynchronous and synchronous clients.READMEto demonstrate usage.pytest-asynciodependency to simplify working with async method tests.test/rest_test.pyandtest/sync/rest_test.pytest suites to target all methods in the refactored classes. It includes tests for the new streaming APIs.It changes:
_streamingparameter on appropriate methods, which helps direct the flow ofrequest()method of the async/sync REST clients.And removes:
GET(),HEAD(),OPTIONS(),POST(),PUT(),PATCH(),andDELETE()helper methods from the async/sync REST clients, to streamline the class and reduce redundant code.Usage Example:
Using the async client:
You can also review the new
/example/streamed-list-objects/asynchronous.py(orsynchronous.py) app for a more detailed usage demo.References
This code is generated using the SDK Generator; the pull request, including these changes, can be reviewed at its repository here: openfga/sdk-generator#469
The relevant issue for tracking this feature can be found her: openfga/sdk-generator#76
Review Checklist
main