-
Notifications
You must be signed in to change notification settings - Fork 320
[Storage] delete/set_immutability_policy for BlobClient
#3342
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
base: main
Are you sure you want to change the base?
[Storage] delete/set_immutability_policy for BlobClient
#3342
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
get/set_immutability_policy for BlobClientdelete/set_immutability_policy for BlobClient
…to fix up legal hold to point to versioned as well + get bicep updated to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds set_immutability_policy and delete_immutability_policy methods to BlobClient, enabling the management of immutability policies on blobs. It also introduces a mechanism to specify storage account types for testing, distinguishing between standard and versioned accounts.
Key changes include:
- Addition of new immutability policy methods to
BlobClientwithexpiryas a required parameter - Consolidation of
BlobImmutabilityPolicyModeandImmutabilityPolicyModeenums into a singleImmutabilityPolicyModeenum with lowercase string representation - Implementation of thread-local storage account selection for test helper functions
Reviewed changes
Copilot reviewed 6 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure_storage_blob_test/src/lib.rs | Adds StorageAccount enum and thread-local storage to allow tests to specify which storage account to use |
| sdk/storage/azure_storage_blob/tsp-location.yaml | Updates TypeSpec commit reference to reflect the new API specification |
| sdk/storage/azure_storage_blob/tests/blob_client.rs | Adds comprehensive test for immutability policy set/delete operations using versioned storage account |
| sdk/storage/azure_storage_blob/src/models/mod.rs | Updates model exports to include new options and remove deprecated types |
| sdk/storage/azure_storage_blob/src/generated/models/pub_models.rs | Renames BlobImmutabilityPolicyMode to ImmutabilityPolicyMode and removes unused result types |
| sdk/storage/azure_storage_blob/src/generated/models/method_options.rs | Removes immutability_policy_expiry field from options (moved to required parameter) |
| sdk/storage/azure_storage_blob/src/generated/models/header_traits.rs | Updates header trait methods to use unified ImmutabilityPolicyMode enum and removes obsolete result headers |
| sdk/storage/azure_storage_blob/src/generated/models/enums_serde.rs | Removes serialization for deprecated BlobImmutabilityPolicyMode enum |
| sdk/storage/azure_storage_blob/src/generated/models/enums_impl.rs | Removes BlobImmutabilityPolicyMode implementations and adds Mutable variant to ImmutabilityPolicyMode with lowercase string representation |
| sdk/storage/azure_storage_blob/src/generated/models/enums.rs | Removes BlobImmutabilityPolicyMode and enhances ImmutabilityPolicyMode with Mutable variant |
| sdk/storage/azure_storage_blob/src/generated/clients/blob_client.rs | Updates method signatures to accept expiry as required parameter and returns Response<(), NoFormat> instead of custom result types |
| sdk/storage/azure_storage_blob/src/clients/blob_client.rs | Exposes new public API methods for setting and deleting immutability policies |
| sdk/storage/azure_storage_blob/assets.json | Updates test assets tag to include new test recordings |
.tsp: [Storage]delete/set_immutability_modefor BlobClient TypeSpec Changes azure-rest-api-specs#38750Adds
set/delete_immutability_policyto BlobClientAdds a way to specify the Storage account type (since this test needs to be against a versioned account)