feat(folders): wrap folder contents list and unlink endpoints#199
Open
Valyrian-Code wants to merge 1 commit into
Open
feat(folders): wrap folder contents list and unlink endpoints#199Valyrian-Code wants to merge 1 commit into
Valyrian-Code wants to merge 1 commit into
Conversation
Refs fossology#52. Adds two Folders methods: - list_folder_contents() -> GET /folders/{id}/contents, returning a list[FolderContent] (id / content / removable) - unlink_folder_content() -> PUT /folders/contents/{contentId}/unlink Adds the FolderContent model to obj.py following the existing from_json convention. list_folder_contents() raises AuthorizationError on HTTP 403, consistent with the other folder endpoints. Verified against Fossology 4.4.0 (API 1.6.1) running in a container: all 5 tests pass (live listing, mocked 403/404 for the listing, and mocked success/404 for the unlink). Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #52.
Adds wrappers for the folder-contents endpoints:
list_folder_contents(folder)→GET /folders/{id}/contents— returns alist[FolderContent](id/content/removable)unlink_folder_content(content_id)→PUT /folders/contents/{contentId}/unlinkAdds the
FolderContentmodel toobj.pyfollowing the existingfrom_jsonconvention.list_folder_contents()raisesAuthorizationErroron HTTP 403, consistent with the other folder endpoints.API details
Verified against Fossology 4.4.0 (API 1.6.1) running in a container.
Tests
All 5 pass live: live listing of a folder's contents, mocked 403/404 for the listing, and mocked success/404 for the unlink.
ruffandmypypass.