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

Add models for corsRules and lifecycleRules instead of dicts #188

Open
mlech-reef opened this issue Feb 11, 2021 · 4 comments
Open

Add models for corsRules and lifecycleRules instead of dicts #188

mlech-reef opened this issue Feb 11, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mlech-reef
Copy link
Contributor

The models should have client-side data validation - https://github.com/samuelcolvin/pydantic can be simply used for that

@mpnowacki-reef
Copy link
Collaborator

After some discussion, this should be moved to https://github.com/Backblaze/b2-sdk-python/milestone/2

@mjurbanski-reef
Copy link
Collaborator

mjurbanski-reef commented Nov 8, 2023

LifecycleRules are now annotated as typed dicts. Runtime validation of this is available in CLI when optional dependencies are installed, namely, pydantic v2.

We are open to PRs adding similar type annotation for corsRules.

@colans
Copy link

colans commented Oct 16, 2024

Will this in any way help with Backblaze/terraform-provider-b2#85 as mentioned in Backblaze/terraform-provider-b2#3 ?

@mlech-reef
Copy link
Contributor Author

@colans this ticket is just about validating fileNamePrefix in the SDK (on the client side) without sending a request to the server if the payload is wrong. That parameter will be still explicitly required to contain an empty string as documented here - https://www.backblaze.com/docs/cloud-storage-lifecycle-rules - if you want to apply the rules to all the files in the bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants