From eb3de152b53ac2e427b04146d8edac5adf19a053 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 16 Sep 2025 14:10:43 -0700 Subject: [PATCH 1/6] Add exists() for BlobClient ContainerClient, add test case in existing tests, re-record --- sdk/storage/azure_storage_blob/assets.json | 2 +- .../azure_storage_blob/src/clients/blob_client.rs | 9 +++++++++ .../src/clients/blob_container_client.rs | 9 +++++++++ sdk/storage/azure_storage_blob/tests/blob_client.rs | 5 ++++- .../azure_storage_blob/tests/blob_container_client.rs | 2 ++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure_storage_blob/assets.json b/sdk/storage/azure_storage_blob/assets.json index 4f9a9f3d8e7..de40fbe04ad 100644 --- a/sdk/storage/azure_storage_blob/assets.json +++ b/sdk/storage/azure_storage_blob/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "rust", - "Tag": "rust/azure_storage_blob_f9b39b45b4", + "Tag": "rust/azure_storage_blob_fc6c153d44", "TagPrefix": "rust/azure_storage_blob" } \ No newline at end of file diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs index 8dd69275d71..652c6e5fa9c 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs @@ -355,4 +355,13 @@ impl BlobClient { ) -> Result> { self.client.get_account_info(options).await } + + /// Returns `true` if a blob exists, and returns `false` otherwise. + /// + /// # Arguments + /// + /// * `options` - Optional configuration for the request. + pub async fn exists(&self) -> bool { + self.get_properties(None).await.is_ok() + } } diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs index 2853763a0c8..d3d4473db15 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs @@ -275,4 +275,13 @@ impl BlobContainerClient { ) -> Result> { self.client.get_account_info(options).await } + + /// Returns `true` if a container exists, and returns `false` otherwise. + /// + /// # Arguments + /// + /// * `options` - Optional configuration for the request. + pub async fn exists(&self) -> bool { + self.get_properties(None).await.is_ok() + } } diff --git a/sdk/storage/azure_storage_blob/tests/blob_client.rs b/sdk/storage/azure_storage_blob/tests/blob_client.rs index 54ece2643d2..39acb822aa0 100644 --- a/sdk/storage/azure_storage_blob/tests/blob_client.rs +++ b/sdk/storage/azure_storage_blob/tests/blob_client.rs @@ -26,14 +26,16 @@ async fn test_get_blob_properties(ctx: TestContext) -> Result<(), Box let container_client = get_container_client(recording, false).await?; let blob_client = container_client.blob_client(get_blob_name(recording)); - // Invalid Container Scenario + // Container Doesn't Exist Scenario let response = blob_client.get_properties(None).await; // Assert let error = response.unwrap_err().http_status(); assert_eq!(StatusCode::NotFound, error.unwrap()); + assert!(!blob_client.exists().await); container_client.create_container(None).await?; + assert!(!blob_client.exists().await); create_test_blob(&blob_client, None, None).await?; // No Option Scenario @@ -49,6 +51,7 @@ async fn test_get_blob_properties(ctx: TestContext) -> Result<(), Box assert_eq!(17, content_length.unwrap()); assert!(etag.is_some()); assert!(creation_time.is_some()); + assert!(blob_client.exists().await); container_client.delete_container(None).await?; Ok(()) diff --git a/sdk/storage/azure_storage_blob/tests/blob_container_client.rs b/sdk/storage/azure_storage_blob/tests/blob_container_client.rs index 1b372ca5e2b..3bcdf658196 100644 --- a/sdk/storage/azure_storage_blob/tests/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/tests/blob_container_client.rs @@ -43,6 +43,7 @@ async fn test_get_container_properties(ctx: TestContext) -> Result<(), Box Result<(), Box Date: Tue, 16 Sep 2025 14:15:23 -0700 Subject: [PATCH 2/6] docstring nit --- sdk/storage/azure_storage_blob/src/clients/blob_client.rs | 2 +- .../azure_storage_blob/src/clients/blob_container_client.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs index 652c6e5fa9c..6bae4aca045 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs @@ -356,7 +356,7 @@ impl BlobClient { self.client.get_account_info(options).await } - /// Returns `true` if a blob exists, and returns `false` otherwise. + /// Returns `true` if the blob exists, and returns `false` otherwise. /// /// # Arguments /// diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs index d3d4473db15..d6f85e478de 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs @@ -276,7 +276,7 @@ impl BlobContainerClient { self.client.get_account_info(options).await } - /// Returns `true` if a container exists, and returns `false` otherwise. + /// Returns `true` if the container exists, and returns `false` otherwise. /// /// # Arguments /// From 152a0316101af325aa516fa00e18f226f0c11412 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 16 Sep 2025 14:53:04 -0700 Subject: [PATCH 3/6] Docstring nit --- sdk/storage/azure_storage_blob/src/clients/blob_client.rs | 4 ---- .../azure_storage_blob/src/clients/blob_container_client.rs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs index 6bae4aca045..282f2d723f6 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs @@ -357,10 +357,6 @@ impl BlobClient { } /// Returns `true` if the blob exists, and returns `false` otherwise. - /// - /// # Arguments - /// - /// * `options` - Optional configuration for the request. pub async fn exists(&self) -> bool { self.get_properties(None).await.is_ok() } diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs index d6f85e478de..4ad1fc7deff 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs @@ -277,10 +277,6 @@ impl BlobContainerClient { } /// Returns `true` if the container exists, and returns `false` otherwise. - /// - /// # Arguments - /// - /// * `options` - Optional configuration for the request. pub async fn exists(&self) -> bool { self.get_properties(None).await.is_ok() } From 02ff14ec8f318987b094c1a4bbdd15157ed57ccb Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 17 Sep 2025 20:58:55 +0000 Subject: [PATCH 4/6] More closely match .NET implementation --- .../src/clients/blob_client.rs | 19 +++++++++++++++---- .../src/clients/blob_container_client.rs | 19 +++++++++++++++---- .../azure_storage_blob/tests/blob_client.rs | 6 +++--- .../tests/blob_container_client.rs | 4 ++-- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs index 282f2d723f6..d4fb9aa7992 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs @@ -24,9 +24,10 @@ use crate::{ }; use azure_core::{ credentials::TokenCredential, + error::ErrorKind, http::{ policies::{BearerTokenCredentialPolicy, Policy}, - JsonFormat, NoFormat, RequestContent, Response, Url, XmlFormat, + JsonFormat, NoFormat, RequestContent, Response, StatusCode, Url, XmlFormat, }, Bytes, Result, }; @@ -356,8 +357,18 @@ impl BlobClient { self.client.get_account_info(options).await } - /// Returns `true` if the blob exists, and returns `false` otherwise. - pub async fn exists(&self) -> bool { - self.get_properties(None).await.is_ok() + /// Returns `true` if the blob exists, `false` if the blob does not exist, and propagates all other errors. + pub async fn exists(&self) -> Result { + match self.client.get_properties(None).await { + Ok(_) => Ok(true), + Err(e) if e.http_status() == Some(StatusCode::NotFound) => match e.kind() { + ErrorKind::HttpResponse { + error_code: Some(error_code), + .. + } if error_code == "BlobNotFound" || error_code == "ContainerNotFound" => Ok(false), + _ => Ok(false), + }, + Err(e) => Err(e), + } } } diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs index 4ad1fc7deff..332f2237d5a 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs @@ -23,9 +23,10 @@ use crate::{ }; use azure_core::{ credentials::TokenCredential, + error::ErrorKind, http::{ policies::{BearerTokenCredentialPolicy, Policy}, - NoFormat, PageIterator, Pager, Response, Url, XmlFormat, + NoFormat, PageIterator, Pager, Response, StatusCode, Url, XmlFormat, }, Result, }; @@ -276,8 +277,18 @@ impl BlobContainerClient { self.client.get_account_info(options).await } - /// Returns `true` if the container exists, and returns `false` otherwise. - pub async fn exists(&self) -> bool { - self.get_properties(None).await.is_ok() + /// Returns `true` if the container exists, `false` if the container does not exist, and propagates all other errors. + pub async fn exists(&self) -> Result { + match self.client.get_properties(None).await { + Ok(_) => Ok(true), + Err(e) if e.http_status() == Some(StatusCode::NotFound) => match e.kind() { + ErrorKind::HttpResponse { + error_code: Some(error_code), + .. + } if error_code == "ContainerNotFound" => Ok(false), + _ => Ok(false), + }, + Err(e) => Err(e), + } } } diff --git a/sdk/storage/azure_storage_blob/tests/blob_client.rs b/sdk/storage/azure_storage_blob/tests/blob_client.rs index 39acb822aa0..7301e86ac71 100644 --- a/sdk/storage/azure_storage_blob/tests/blob_client.rs +++ b/sdk/storage/azure_storage_blob/tests/blob_client.rs @@ -32,10 +32,10 @@ async fn test_get_blob_properties(ctx: TestContext) -> Result<(), Box // Assert let error = response.unwrap_err().http_status(); assert_eq!(StatusCode::NotFound, error.unwrap()); - assert!(!blob_client.exists().await); + assert!(!blob_client.exists().await?); container_client.create_container(None).await?; - assert!(!blob_client.exists().await); + assert!(!blob_client.exists().await?); create_test_blob(&blob_client, None, None).await?; // No Option Scenario @@ -51,7 +51,7 @@ async fn test_get_blob_properties(ctx: TestContext) -> Result<(), Box assert_eq!(17, content_length.unwrap()); assert!(etag.is_some()); assert!(creation_time.is_some()); - assert!(blob_client.exists().await); + assert!(blob_client.exists().await?); container_client.delete_container(None).await?; Ok(()) diff --git a/sdk/storage/azure_storage_blob/tests/blob_container_client.rs b/sdk/storage/azure_storage_blob/tests/blob_container_client.rs index 3bcdf658196..67146b93969 100644 --- a/sdk/storage/azure_storage_blob/tests/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/tests/blob_container_client.rs @@ -43,7 +43,7 @@ async fn test_get_container_properties(ctx: TestContext) -> Result<(), Box Result<(), Box Date: Wed, 17 Sep 2025 15:10:10 -0700 Subject: [PATCH 5/6] Use newly generated enuM --- .../src/clients/blob_client.rs | 11 +- .../src/clients/blob_container_client.rs | 7 +- .../src/generated/models/enums.rs | 330 ++++++++++++++++++ .../azure_storage_blob/src/models/mod.rs | 2 +- .../azure_storage_blob/tsp-location.yaml | 2 +- 5 files changed, 344 insertions(+), 8 deletions(-) diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs index d4fb9aa7992..3481f332347 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_client.rs @@ -17,7 +17,7 @@ use crate::{ BlobClientReleaseLeaseOptions, BlobClientRenewLeaseOptions, BlobClientSetMetadataOptions, BlobClientSetPropertiesOptions, BlobClientSetTagsOptions, BlobClientSetTierOptions, BlobTags, BlockBlobClientCommitBlockListOptions, BlockBlobClientUploadOptions, BlockList, - BlockListType, BlockLookupList, + BlockListType, BlockLookupList, StorageErrorCode, }, pipeline::StorageHeadersPolicy, AppendBlobClient, BlobClientOptions, BlockBlobClient, PageBlobClient, @@ -365,8 +365,13 @@ impl BlobClient { ErrorKind::HttpResponse { error_code: Some(error_code), .. - } if error_code == "BlobNotFound" || error_code == "ContainerNotFound" => Ok(false), - _ => Ok(false), + } if error_code == StorageErrorCode::BlobNotFound.as_ref() + || error_code == StorageErrorCode::ContainerNotFound.as_ref() => + { + Ok(false) + } + // Propagate all other error types. + _ => Err(e), }, Err(e) => Err(e), } diff --git a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs index 332f2237d5a..6f91dd500ea 100644 --- a/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs +++ b/sdk/storage/azure_storage_blob/src/clients/blob_container_client.rs @@ -16,7 +16,7 @@ use crate::{ BlobContainerClientGetAccountInfoOptions, BlobContainerClientGetPropertiesOptions, BlobContainerClientListBlobFlatSegmentOptions, BlobContainerClientReleaseLeaseOptions, BlobContainerClientRenewLeaseOptions, BlobContainerClientSetMetadataOptions, - FilterBlobSegment, ListBlobsFlatSegmentResponse, + FilterBlobSegment, ListBlobsFlatSegmentResponse, StorageErrorCode, }, pipeline::StorageHeadersPolicy, BlobClient, BlobContainerClientOptions, @@ -285,8 +285,9 @@ impl BlobContainerClient { ErrorKind::HttpResponse { error_code: Some(error_code), .. - } if error_code == "ContainerNotFound" => Ok(false), - _ => Ok(false), + } if error_code == StorageErrorCode::ContainerNotFound.as_ref() => Ok(false), + // Propagate all other error types. + _ => Err(e), }, Err(e) => Err(e), } diff --git a/sdk/storage/azure_storage_blob/src/generated/models/enums.rs b/sdk/storage/azure_storage_blob/src/generated/models/enums.rs index 8e776e64f91..086152ec14e 100644 --- a/sdk/storage/azure_storage_blob/src/generated/models/enums.rs +++ b/sdk/storage/azure_storage_blob/src/generated/models/enums.rs @@ -356,3 +356,333 @@ create_enum!( #[doc = r#"The standard ZRS SKU."#] (StandardZRS, "Standard_ZRS") ); + +create_extensible_enum!( + #[doc = r#"Error codes returned by the Azure Blob Storage service."#] + StorageErrorCode, + #[doc = r#"Account already exists."#] + (AccountAlreadyExists, "AccountAlreadyExists"), + #[doc = r#"Account is being created."#] + (AccountBeingCreated, "AccountBeingCreated"), + #[doc = r#"Account is disabled."#] + (AccountIsDisabled, "AccountIsDisabled"), + #[doc = r#"Append position condition not met."#] + ( + AppendPositionConditionNotMet, + "AppendPositionConditionNotMet" + ), + #[doc = r#"Authentication failed."#] + (AuthenticationFailed, "AuthenticationFailed"), + #[doc = r#"Authorization failure."#] + (AuthorizationFailure, "AuthorizationFailure"), + #[doc = r#"Authorization permission mismatch."#] + ( + AuthorizationPermissionMismatch, + "AuthorizationPermissionMismatch" + ), + #[doc = r#"Authorization protocol mismatch."#] + ( + AuthorizationProtocolMismatch, + "AuthorizationProtocolMismatch" + ), + #[doc = r#"Authorization resource type mismatch."#] + ( + AuthorizationResourceTypeMismatch, + "AuthorizationResourceTypeMismatch" + ), + #[doc = r#"Authorization service mismatch."#] + (AuthorizationServiceMismatch, "AuthorizationServiceMismatch"), + #[doc = r#"Authorization source IP mismatch."#] + ( + AuthorizationSourceIPMismatch, + "AuthorizationSourceIPMismatch" + ), + #[doc = r#"Blob access tier not supported for account type."#] + ( + BlobAccessTierNotSupportedForAccountType, + "BlobAccessTierNotSupportedForAccountType" + ), + #[doc = r#"Blob already exists."#] + (BlobAlreadyExists, "BlobAlreadyExists"), + #[doc = r#"Blob archived."#] + (BlobArchived, "BlobArchived"), + #[doc = r#"Blob being rehydrated."#] + (BlobBeingRehydrated, "BlobBeingRehydrated"), + #[doc = r#"Blob is immutable due to policy."#] + (BlobImmutableDueToPolicy, "BlobImmutableDueToPolicy"), + #[doc = r#"Blob not archived."#] + (BlobNotArchived, "BlobNotArchived"), + #[doc = r#"Blob not found."#] + (BlobNotFound, "BlobNotFound"), + #[doc = r#"Blob overwritten."#] + (BlobOverwritten, "BlobOverwritten"), + #[doc = r#"Blob tier inadequate for content length."#] + ( + BlobTierInadequateForContentLength, + "BlobTierInadequateForContentLength" + ), + #[doc = r#"Blob uses customer specified encryption."#] + ( + BlobUsesCustomerSpecifiedEncryption, + "BlobUsesCustomerSpecifiedEncryption" + ), + #[doc = r#"Block count exceeds limit."#] + (BlockCountExceedsLimit, "BlockCountExceedsLimit"), + #[doc = r#"Block list too long."#] + (BlockListTooLong, "BlockListTooLong"), + #[doc = r#"Cannot change to lower tier."#] + (CannotChangeToLowerTier, "CannotChangeToLowerTier"), + #[doc = r#"Cannot verify copy source."#] + (CannotVerifyCopySource, "CannotVerifyCopySource"), + #[doc = r#"Condition headers not supported."#] + (ConditionHeadersNotSupported, "ConditionHeadersNotSupported"), + #[doc = r#"Condition not met."#] + (ConditionNotMet, "ConditionNotMet"), + #[doc = r#"Container already exists."#] + (ContainerAlreadyExists, "ContainerAlreadyExists"), + #[doc = r#"Container being deleted."#] + (ContainerBeingDeleted, "ContainerBeingDeleted"), + #[doc = r#"Container disabled."#] + (ContainerDisabled, "ContainerDisabled"), + #[doc = r#"Container not found."#] + (ContainerNotFound, "ContainerNotFound"), + #[doc = r#"Content length larger than tier limit."#] + ( + ContentLengthLargerThanTierLimit, + "ContentLengthLargerThanTierLimit" + ), + #[doc = r#"Copy across accounts not supported."#] + ( + CopyAcrossAccountsNotSupported, + "CopyAcrossAccountsNotSupported" + ), + #[doc = r#"Copy ID mismatch."#] + (CopyIdMismatch, "CopyIdMismatch"), + #[doc = r#"Empty metadata key."#] + (EmptyMetadataKey, "EmptyMetadataKey"), + #[doc = r#"Feature version mismatch."#] + (FeatureVersionMismatch, "FeatureVersionMismatch"), + #[doc = r#"Incremental copy blob mismatch."#] + (IncrementalCopyBlobMismatch, "IncrementalCopyBlobMismatch"), + #[doc = r#"Incremental copy of earlier version snapshot not allowed."#] + ( + IncrementalCopyOfEarlierVersionSnapshotNotAllowed, + "IncrementalCopyOfEarlierVersionSnapshotNotAllowed" + ), + #[doc = r#"Incremental copy source must be snapshot."#] + ( + IncrementalCopySourceMustBeSnapshot, + "IncrementalCopySourceMustBeSnapshot" + ), + #[doc = r#"Infinite lease duration required."#] + ( + InfiniteLeaseDurationRequired, + "InfiniteLeaseDurationRequired" + ), + #[doc = r#"Insufficient account permissions."#] + ( + InsufficientAccountPermissions, + "InsufficientAccountPermissions" + ), + #[doc = r#"Internal error."#] + (InternalError, "InternalError"), + #[doc = r#"Invalid authentication information."#] + (InvalidAuthenticationInfo, "InvalidAuthenticationInfo"), + #[doc = r#"Invalid blob or block."#] + (InvalidBlobOrBlock, "InvalidBlobOrBlock"), + #[doc = r#"Invalid blob tier."#] + (InvalidBlobTier, "InvalidBlobTier"), + #[doc = r#"Invalid blob type."#] + (InvalidBlobType, "InvalidBlobType"), + #[doc = r#"Invalid block ID."#] + (InvalidBlockId, "InvalidBlockId"), + #[doc = r#"Invalid block list."#] + (InvalidBlockList, "InvalidBlockList"), + #[doc = r#"Invalid header value."#] + (InvalidHeaderValue, "InvalidHeaderValue"), + #[doc = r#"Invalid HTTP verb."#] + (InvalidHttpVerb, "InvalidHttpVerb"), + #[doc = r#"Invalid input."#] + (InvalidInput, "InvalidInput"), + #[doc = r#"Invalid MD5."#] + (InvalidMd5, "InvalidMd5"), + #[doc = r#"Invalid metadata."#] + (InvalidMetadata, "InvalidMetadata"), + #[doc = r#"Invalid operation."#] + (InvalidOperation, "InvalidOperation"), + #[doc = r#"Invalid page range."#] + (InvalidPageRange, "InvalidPageRange"), + #[doc = r#"Invalid query parameter value."#] + (InvalidQueryParameterValue, "InvalidQueryParameterValue"), + #[doc = r#"Invalid range."#] + (InvalidRange, "InvalidRange"), + #[doc = r#"Invalid request URL."#] + (InvalidRequestUrl, "InvalidRequestUrl"), + #[doc = r#"Invalid source blob type."#] + (InvalidSourceBlobType, "InvalidSourceBlobType"), + #[doc = r#"Invalid source blob URL."#] + (InvalidSourceBlobUrl, "InvalidSourceBlobUrl"), + #[doc = r#"Invalid URI."#] + (InvalidUri, "InvalidUri"), + #[doc = r#"Invalid version for page blob operation."#] + ( + InvalidVersionForPageBlobOperation, + "InvalidVersionForPageBlobOperation" + ), + #[doc = r#"Invalid XML document."#] + (InvalidXmlDocument, "InvalidXmlDocument"), + #[doc = r#"Invalid XML node value."#] + (InvalidXmlNodeValue, "InvalidXmlNodeValue"), + #[doc = r#"Lease already broken."#] + (LeaseAlreadyBroken, "LeaseAlreadyBroken"), + #[doc = r#"Lease already present."#] + (LeaseAlreadyPresent, "LeaseAlreadyPresent"), + #[doc = r#"Lease ID mismatch with blob operation."#] + ( + LeaseIdMismatchWithBlobOperation, + "LeaseIdMismatchWithBlobOperation" + ), + #[doc = r#"Lease ID mismatch with container operation."#] + ( + LeaseIdMismatchWithContainerOperation, + "LeaseIdMismatchWithContainerOperation" + ), + #[doc = r#"Lease ID mismatch with lease operation."#] + ( + LeaseIdMismatchWithLeaseOperation, + "LeaseIdMismatchWithLeaseOperation" + ), + #[doc = r#"Lease ID missing."#] + (LeaseIdMissing, "LeaseIdMissing"), + #[doc = r#"Lease is breaking and cannot be acquired."#] + ( + LeaseIsBreakingAndCannotBeAcquired, + "LeaseIsBreakingAndCannotBeAcquired" + ), + #[doc = r#"Lease is breaking and cannot be changed."#] + ( + LeaseIsBreakingAndCannotBeChanged, + "LeaseIsBreakingAndCannotBeChanged" + ), + #[doc = r#"Lease is broken and cannot be renewed."#] + ( + LeaseIsBrokenAndCannotBeRenewed, + "LeaseIsBrokenAndCannotBeRenewed" + ), + #[doc = r#"Lease lost."#] + (LeaseLost, "LeaseLost"), + #[doc = r#"Lease not present with blob operation."#] + ( + LeaseNotPresentWithBlobOperation, + "LeaseNotPresentWithBlobOperation" + ), + #[doc = r#"Lease not present with container operation."#] + ( + LeaseNotPresentWithContainerOperation, + "LeaseNotPresentWithContainerOperation" + ), + #[doc = r#"Lease not present with lease operation."#] + ( + LeaseNotPresentWithLeaseOperation, + "LeaseNotPresentWithLeaseOperation" + ), + #[doc = r#"Maximum blob size condition not met."#] + (MaxBlobSizeConditionNotMet, "MaxBlobSizeConditionNotMet"), + #[doc = r#"MD5 mismatch."#] + (Md5Mismatch, "Md5Mismatch"), + #[doc = r#"Metadata too large."#] + (MetadataTooLarge, "MetadataTooLarge"), + #[doc = r#"Missing content length header."#] + (MissingContentLengthHeader, "MissingContentLengthHeader"), + #[doc = r#"Missing required header."#] + (MissingRequiredHeader, "MissingRequiredHeader"), + #[doc = r#"Missing required query parameter."#] + ( + MissingRequiredQueryParameter, + "MissingRequiredQueryParameter" + ), + #[doc = r#"Missing required XML node."#] + (MissingRequiredXmlNode, "MissingRequiredXmlNode"), + #[doc = r#"Multiple condition headers not supported."#] + ( + MultipleConditionHeadersNotSupported, + "MultipleConditionHeadersNotSupported" + ), + #[doc = r#"No pending copy operation."#] + (NoPendingCopyOperation, "NoPendingCopyOperation"), + #[doc = r#"Operation not allowed on incremental copy blob."#] + ( + OperationNotAllowedOnIncrementalCopyBlob, + "OperationNotAllowedOnIncrementalCopyBlob" + ), + #[doc = r#"Operation timed out."#] + (OperationTimedOut, "OperationTimedOut"), + #[doc = r#"Out of range input."#] + (OutOfRangeInput, "OutOfRangeInput"), + #[doc = r#"Out of range query parameter value."#] + ( + OutOfRangeQueryParameterValue, + "OutOfRangeQueryParameterValue" + ), + #[doc = r#"Pending copy operation."#] + (PendingCopyOperation, "PendingCopyOperation"), + #[doc = r#"Previous snapshot cannot be newer."#] + ( + PreviousSnapshotCannotBeNewer, + "PreviousSnapshotCannotBeNewer" + ), + #[doc = r#"Previous snapshot not found."#] + (PreviousSnapshotNotFound, "PreviousSnapshotNotFound"), + #[doc = r#"Previous snapshot operation not supported."#] + ( + PreviousSnapshotOperationNotSupported, + "PreviousSnapshotOperationNotSupported" + ), + #[doc = r#"Request body too large."#] + (RequestBodyTooLarge, "RequestBodyTooLarge"), + #[doc = r#"Request URL failed to parse."#] + (RequestUrlFailedToParse, "RequestUrlFailedToParse"), + #[doc = r#"Resource already exists."#] + (ResourceAlreadyExists, "ResourceAlreadyExists"), + #[doc = r#"Resource not found."#] + (ResourceNotFound, "ResourceNotFound"), + #[doc = r#"Resource type mismatch."#] + (ResourceTypeMismatch, "ResourceTypeMismatch"), + #[doc = r#"Sequence number condition not met."#] + ( + SequenceNumberConditionNotMet, + "SequenceNumberConditionNotMet" + ), + #[doc = r#"Sequence number increment too large."#] + ( + SequenceNumberIncrementTooLarge, + "SequenceNumberIncrementTooLarge" + ), + #[doc = r#"Server busy."#] + (ServerBusy, "ServerBusy"), + #[doc = r#"Snapshot count exceeded."#] + (SnapshotCountExceeded, "SnapshotCountExceeded"), + #[doc = r#"Snapshot operation rate exceeded."#] + ( + SnapshotOperationRateExceeded, + "SnapshotOperationRateExceeded" + ), + #[doc = r#"Snapshots present."#] + (SnapshotsPresent, "SnapshotsPresent"), + #[doc = r#"Source condition not met."#] + (SourceConditionNotMet, "SourceConditionNotMet"), + #[doc = r#"System in use."#] + (SystemInUse, "SystemInUse"), + #[doc = r#"Target condition not met."#] + (TargetConditionNotMet, "TargetConditionNotMet"), + #[doc = r#"Unauthorized blob overwrite."#] + (UnauthorizedBlobOverwrite, "UnauthorizedBlobOverwrite"), + #[doc = r#"Unsupported header."#] + (UnsupportedHeader, "UnsupportedHeader"), + #[doc = r#"Unsupported HTTP verb."#] + (UnsupportedHttpVerb, "UnsupportedHttpVerb"), + #[doc = r#"Unsupported query parameter."#] + (UnsupportedQueryParameter, "UnsupportedQueryParameter"), + #[doc = r#"Unsupported XML node."#] + (UnsupportedXmlNode, "UnsupportedXmlNode") +); diff --git a/sdk/storage/azure_storage_blob/src/models/mod.rs b/sdk/storage/azure_storage_blob/src/models/mod.rs index c9090c6c099..25f0e073667 100644 --- a/sdk/storage/azure_storage_blob/src/models/mod.rs +++ b/sdk/storage/azure_storage_blob/src/models/mod.rs @@ -78,7 +78,7 @@ pub use crate::generated::models::{ PageBlobClientUploadPagesFromUrlResultHeaders, PageBlobClientUploadPagesOptions, PageBlobClientUploadPagesResult, PageBlobClientUploadPagesResultHeaders, PageList, PageListHeaders, PremiumPageBlobAccessTier, PublicAccessType, RehydratePriority, - RetentionPolicy, SequenceNumberActionType, SignedIdentifier, StaticWebsite, + RetentionPolicy, SequenceNumberActionType, SignedIdentifier, StaticWebsite, StorageErrorCode, StorageServiceStats, StorageServiceStatsHeaders, UserDelegationKey, UserDelegationKeyHeaders, VecSignedIdentifierHeaders, }; diff --git a/sdk/storage/azure_storage_blob/tsp-location.yaml b/sdk/storage/azure_storage_blob/tsp-location.yaml index dbe7b4dcb79..ebab6458a7d 100644 --- a/sdk/storage/azure_storage_blob/tsp-location.yaml +++ b/sdk/storage/azure_storage_blob/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/storage/Microsoft.BlobStorage -commit: 5f6a72bc4faa52e84b174303ff3430ad3c778ba0 +commit: ee6172d62afb4f5ec854c6c16dfa7eb53b1dc559 repo: Azure/azure-rest-api-specs additionalDirectories: From 408907abbcb6c12b56dd97da48ae00a6bdaa378c Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Wed, 17 Sep 2025 16:18:32 -0700 Subject: [PATCH 6/6] Regen pointing to feature/blob-tsp-rust --- sdk/storage/azure_storage_blob/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure_storage_blob/tsp-location.yaml b/sdk/storage/azure_storage_blob/tsp-location.yaml index ebab6458a7d..2ba329c3415 100644 --- a/sdk/storage/azure_storage_blob/tsp-location.yaml +++ b/sdk/storage/azure_storage_blob/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/storage/Microsoft.BlobStorage -commit: ee6172d62afb4f5ec854c6c16dfa7eb53b1dc559 +commit: cc4322ec468b171e696330258ea59c3b3f657104 repo: Azure/azure-rest-api-specs additionalDirectories: