Open mlech-reef opened 3 years ago
After some discussion, this should be moved to https://github.com/Backblaze/b2-sdk-python/milestone/2
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.
Will this in any way help with https://github.com/Backblaze/terraform-provider-b2/issues/85 as mentioned in https://github.com/Backblaze/terraform-provider-b2/issues/3 ?
@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.
The models should have client-side data validation - https://github.com/samuelcolvin/pydantic can be simply used for that