Skip to content
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

Helper methods for deleting file groups with their contents #248

Merged
merged 4 commits into from
Jul 12, 2023

Conversation

evgkirov
Copy link
Collaborator

@evgkirov evgkirov commented Jul 2, 2023

Description

Related issue: #198

Motivated by #196

Groups are unremovable. But the files in the group are. Some times user has a need to remove all files in a group and currently, the only way to do this is to iterate over files and use delete or batch delete method.
This makes code more complex and, potentially, increases number of requests to achieve the goal.

p.s.: Also, consider adding this as a core REST API functionality?

Changing the Uploadcare API is out of scope of this project. Helpers methods, however, have been implemented.

Example usage for Uploadcare:

uploadcare.delete_file_group_with_files("2e481e82-2e39-41be-a5a2-23802c6e341c~2") 

Example usage for FileGroup:

group = uploadcare.file_group("2e481e82-2e39-41be-a5a2-23802c6e341c~2")
group.delete_with_files()

Checklist

@evgkirov evgkirov linked an issue Jul 2, 2023 that may be closed by this pull request
@evgkirov evgkirov closed this Jul 12, 2023
@evgkirov evgkirov reopened this Jul 12, 2023
@evgkirov evgkirov merged commit 89a2f6a into main Jul 12, 2023
33 checks passed
@evgkirov evgkirov deleted the feature/198-delete_files_in_group branch July 12, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider a helper method, to remove all files in a group.
2 participants