diff --git a/sdk/storage/azure_storage_queue/src/generated/models/enums.rs b/sdk/storage/azure_storage_queue/src/generated/models/enums.rs index 04b8633b8f..4a76f2b80a 100644 --- a/sdk/storage/azure_storage_queue/src/generated/models/enums.rs +++ b/sdk/storage/azure_storage_queue/src/generated/models/enums.rs @@ -25,3 +25,181 @@ pub enum ListQueuesIncludeType { /// Include queue metadata. Metadata, } + +/// Error codes returned by the service +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum StorageErrorCode { + /// AccountAlreadyExists + AccountAlreadyExists, + + /// AccountBeingCreated + AccountBeingCreated, + + /// AccountIsDisabled + AccountIsDisabled, + + /// AuthenticationFailed + AuthenticationFailed, + + /// AuthorizationFailure + AuthorizationFailure, + + /// AuthorizationPermissionMismatch + AuthorizationPermissionMismatch, + + /// AuthorizationProtocolMismatch + AuthorizationProtocolMismatch, + + /// AuthorizationResourceTypeMismatch + AuthorizationResourceTypeMismatch, + + /// AuthorizationServiceMismatch + AuthorizationServiceMismatch, + + /// AuthorizationSourceIPMismatch + AuthorizationSourceIPMismatch, + + /// ConditionHeadersNotSupported + ConditionHeadersNotSupported, + + /// ConditionNotMet + ConditionNotMet, + + /// EmptyMetadataKey + EmptyMetadataKey, + + /// FeatureVersionMismatch + FeatureVersionMismatch, + + /// InsufficientAccountPermissions + InsufficientAccountPermissions, + + /// InternalError + InternalError, + + /// InvalidAuthenticationInfo + InvalidAuthenticationInfo, + + /// InvalidHeaderValue + InvalidHeaderValue, + + /// InvalidHttpVerb + InvalidHttpVerb, + + /// InvalidInput + InvalidInput, + + /// InvalidMarker + InvalidMarker, + + /// InvalidMd5 + InvalidMd5, + + /// InvalidMetadata + InvalidMetadata, + + /// InvalidQueryParameterValue + InvalidQueryParameterValue, + + /// InvalidRange + InvalidRange, + + /// InvalidResourceName + InvalidResourceName, + + /// InvalidUri + InvalidUri, + + /// InvalidXmlDocument + InvalidXmlDocument, + + /// InvalidXmlNodeValue + InvalidXmlNodeValue, + + /// Md5Mismatch + Md5Mismatch, + + /// MessageNotFound + MessageNotFound, + + /// MessageTooLarge + MessageTooLarge, + + /// MetadataTooLarge + MetadataTooLarge, + + /// MissingContentLengthHeader + MissingContentLengthHeader, + + /// MissingRequiredHeader + MissingRequiredHeader, + + /// MissingRequiredQueryParameter + MissingRequiredQueryParameter, + + /// MissingRequiredXmlNode + MissingRequiredXmlNode, + + /// MultipleConditionHeadersNotSupported + MultipleConditionHeadersNotSupported, + + /// OperationTimedOut + OperationTimedOut, + + /// OutOfRangeInput + OutOfRangeInput, + + /// OutOfRangeQueryParameterValue + OutOfRangeQueryParameterValue, + + /// PopReceiptMismatch + PopReceiptMismatch, + + /// QueueAlreadyExists + QueueAlreadyExists, + + /// QueueBeingDeleted + QueueBeingDeleted, + + /// QueueDisabled + QueueDisabled, + + /// QueueNotEmpty + QueueNotEmpty, + + /// QueueNotFound + QueueNotFound, + + /// RequestBodyTooLarge + RequestBodyTooLarge, + + /// RequestUrlFailedToParse + RequestUrlFailedToParse, + + /// ResourceAlreadyExists + ResourceAlreadyExists, + + /// ResourceNotFound + ResourceNotFound, + + /// ResourceTypeMismatch + ResourceTypeMismatch, + + /// ServerBusy + ServerBusy, + + /// UnsupportedHeader + UnsupportedHeader, + + /// UnsupportedHttpVerb + UnsupportedHttpVerb, + + /// UnsupportedQueryParameter + UnsupportedQueryParameter, + + /// UnsupportedXmlNode + UnsupportedXmlNode, + + /// Any other value not defined in `StorageErrorCode`. + UnknownValue(String), +} diff --git a/sdk/storage/azure_storage_queue/src/generated/models/enums_impl.rs b/sdk/storage/azure_storage_queue/src/generated/models/enums_impl.rs index 9efeb9f116..ec5ccf6714 100644 --- a/sdk/storage/azure_storage_queue/src/generated/models/enums_impl.rs +++ b/sdk/storage/azure_storage_queue/src/generated/models/enums_impl.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{GeoReplicationStatus, ListQueuesIncludeType}; +use super::{GeoReplicationStatus, ListQueuesIncludeType, StorageErrorCode}; use azure_core::error::{Error, ErrorKind}; use std::{ convert::{AsRef, From, Infallible}, @@ -85,3 +85,300 @@ impl Display for ListQueuesIncludeType { } } } + +impl<'a> From<&'a StorageErrorCode> for &'a str { + fn from(e: &'a StorageErrorCode) -> Self { + match e { + StorageErrorCode::AccountAlreadyExists => "AccountAlreadyExists", + StorageErrorCode::AccountBeingCreated => "AccountBeingCreated", + StorageErrorCode::AccountIsDisabled => "AccountIsDisabled", + StorageErrorCode::AuthenticationFailed => "AuthenticationFailed", + StorageErrorCode::AuthorizationFailure => "AuthorizationFailure", + StorageErrorCode::AuthorizationPermissionMismatch => "AuthorizationPermissionMismatch", + StorageErrorCode::AuthorizationProtocolMismatch => "AuthorizationProtocolMismatch", + StorageErrorCode::AuthorizationResourceTypeMismatch => { + "AuthorizationResourceTypeMismatch" + } + StorageErrorCode::AuthorizationServiceMismatch => "AuthorizationServiceMismatch", + StorageErrorCode::AuthorizationSourceIPMismatch => "AuthorizationSourceIPMismatch", + StorageErrorCode::ConditionHeadersNotSupported => "ConditionHeadersNotSupported", + StorageErrorCode::ConditionNotMet => "ConditionNotMet", + StorageErrorCode::EmptyMetadataKey => "EmptyMetadataKey", + StorageErrorCode::FeatureVersionMismatch => "FeatureVersionMismatch", + StorageErrorCode::InsufficientAccountPermissions => "InsufficientAccountPermissions", + StorageErrorCode::InternalError => "InternalError", + StorageErrorCode::InvalidAuthenticationInfo => "InvalidAuthenticationInfo", + StorageErrorCode::InvalidHeaderValue => "InvalidHeaderValue", + StorageErrorCode::InvalidHttpVerb => "InvalidHttpVerb", + StorageErrorCode::InvalidInput => "InvalidInput", + StorageErrorCode::InvalidMarker => "InvalidMarker", + StorageErrorCode::InvalidMd5 => "InvalidMd5", + StorageErrorCode::InvalidMetadata => "InvalidMetadata", + StorageErrorCode::InvalidQueryParameterValue => "InvalidQueryParameterValue", + StorageErrorCode::InvalidRange => "InvalidRange", + StorageErrorCode::InvalidResourceName => "InvalidResourceName", + StorageErrorCode::InvalidUri => "InvalidUri", + StorageErrorCode::InvalidXmlDocument => "InvalidXmlDocument", + StorageErrorCode::InvalidXmlNodeValue => "InvalidXmlNodeValue", + StorageErrorCode::Md5Mismatch => "Md5Mismatch", + StorageErrorCode::MessageNotFound => "MessageNotFound", + StorageErrorCode::MessageTooLarge => "MessageTooLarge", + StorageErrorCode::MetadataTooLarge => "MetadataTooLarge", + StorageErrorCode::MissingContentLengthHeader => "MissingContentLengthHeader", + StorageErrorCode::MissingRequiredHeader => "MissingRequiredHeader", + StorageErrorCode::MissingRequiredQueryParameter => "MissingRequiredQueryParameter", + StorageErrorCode::MissingRequiredXmlNode => "MissingRequiredXmlNode", + StorageErrorCode::MultipleConditionHeadersNotSupported => { + "MultipleConditionHeadersNotSupported" + } + StorageErrorCode::OperationTimedOut => "OperationTimedOut", + StorageErrorCode::OutOfRangeInput => "OutOfRangeInput", + StorageErrorCode::OutOfRangeQueryParameterValue => "OutOfRangeQueryParameterValue", + StorageErrorCode::PopReceiptMismatch => "PopReceiptMismatch", + StorageErrorCode::QueueAlreadyExists => "QueueAlreadyExists", + StorageErrorCode::QueueBeingDeleted => "QueueBeingDeleted", + StorageErrorCode::QueueDisabled => "QueueDisabled", + StorageErrorCode::QueueNotEmpty => "QueueNotEmpty", + StorageErrorCode::QueueNotFound => "QueueNotFound", + StorageErrorCode::RequestBodyTooLarge => "RequestBodyTooLarge", + StorageErrorCode::RequestUrlFailedToParse => "RequestUrlFailedToParse", + StorageErrorCode::ResourceAlreadyExists => "ResourceAlreadyExists", + StorageErrorCode::ResourceNotFound => "ResourceNotFound", + StorageErrorCode::ResourceTypeMismatch => "ResourceTypeMismatch", + StorageErrorCode::ServerBusy => "ServerBusy", + StorageErrorCode::UnsupportedHeader => "UnsupportedHeader", + StorageErrorCode::UnsupportedHttpVerb => "UnsupportedHttpVerb", + StorageErrorCode::UnsupportedQueryParameter => "UnsupportedQueryParameter", + StorageErrorCode::UnsupportedXmlNode => "UnsupportedXmlNode", + StorageErrorCode::UnknownValue(s) => s.as_ref(), + } + } +} + +impl FromStr for StorageErrorCode { + type Err = Infallible; + fn from_str(s: &str) -> ::core::result::Result::Err> { + Ok(match s { + "AccountAlreadyExists" => StorageErrorCode::AccountAlreadyExists, + "AccountBeingCreated" => StorageErrorCode::AccountBeingCreated, + "AccountIsDisabled" => StorageErrorCode::AccountIsDisabled, + "AuthenticationFailed" => StorageErrorCode::AuthenticationFailed, + "AuthorizationFailure" => StorageErrorCode::AuthorizationFailure, + "AuthorizationPermissionMismatch" => StorageErrorCode::AuthorizationPermissionMismatch, + "AuthorizationProtocolMismatch" => StorageErrorCode::AuthorizationProtocolMismatch, + "AuthorizationResourceTypeMismatch" => { + StorageErrorCode::AuthorizationResourceTypeMismatch + } + "AuthorizationServiceMismatch" => StorageErrorCode::AuthorizationServiceMismatch, + "AuthorizationSourceIPMismatch" => StorageErrorCode::AuthorizationSourceIPMismatch, + "ConditionHeadersNotSupported" => StorageErrorCode::ConditionHeadersNotSupported, + "ConditionNotMet" => StorageErrorCode::ConditionNotMet, + "EmptyMetadataKey" => StorageErrorCode::EmptyMetadataKey, + "FeatureVersionMismatch" => StorageErrorCode::FeatureVersionMismatch, + "InsufficientAccountPermissions" => StorageErrorCode::InsufficientAccountPermissions, + "InternalError" => StorageErrorCode::InternalError, + "InvalidAuthenticationInfo" => StorageErrorCode::InvalidAuthenticationInfo, + "InvalidHeaderValue" => StorageErrorCode::InvalidHeaderValue, + "InvalidHttpVerb" => StorageErrorCode::InvalidHttpVerb, + "InvalidInput" => StorageErrorCode::InvalidInput, + "InvalidMarker" => StorageErrorCode::InvalidMarker, + "InvalidMd5" => StorageErrorCode::InvalidMd5, + "InvalidMetadata" => StorageErrorCode::InvalidMetadata, + "InvalidQueryParameterValue" => StorageErrorCode::InvalidQueryParameterValue, + "InvalidRange" => StorageErrorCode::InvalidRange, + "InvalidResourceName" => StorageErrorCode::InvalidResourceName, + "InvalidUri" => StorageErrorCode::InvalidUri, + "InvalidXmlDocument" => StorageErrorCode::InvalidXmlDocument, + "InvalidXmlNodeValue" => StorageErrorCode::InvalidXmlNodeValue, + "Md5Mismatch" => StorageErrorCode::Md5Mismatch, + "MessageNotFound" => StorageErrorCode::MessageNotFound, + "MessageTooLarge" => StorageErrorCode::MessageTooLarge, + "MetadataTooLarge" => StorageErrorCode::MetadataTooLarge, + "MissingContentLengthHeader" => StorageErrorCode::MissingContentLengthHeader, + "MissingRequiredHeader" => StorageErrorCode::MissingRequiredHeader, + "MissingRequiredQueryParameter" => StorageErrorCode::MissingRequiredQueryParameter, + "MissingRequiredXmlNode" => StorageErrorCode::MissingRequiredXmlNode, + "MultipleConditionHeadersNotSupported" => { + StorageErrorCode::MultipleConditionHeadersNotSupported + } + "OperationTimedOut" => StorageErrorCode::OperationTimedOut, + "OutOfRangeInput" => StorageErrorCode::OutOfRangeInput, + "OutOfRangeQueryParameterValue" => StorageErrorCode::OutOfRangeQueryParameterValue, + "PopReceiptMismatch" => StorageErrorCode::PopReceiptMismatch, + "QueueAlreadyExists" => StorageErrorCode::QueueAlreadyExists, + "QueueBeingDeleted" => StorageErrorCode::QueueBeingDeleted, + "QueueDisabled" => StorageErrorCode::QueueDisabled, + "QueueNotEmpty" => StorageErrorCode::QueueNotEmpty, + "QueueNotFound" => StorageErrorCode::QueueNotFound, + "RequestBodyTooLarge" => StorageErrorCode::RequestBodyTooLarge, + "RequestUrlFailedToParse" => StorageErrorCode::RequestUrlFailedToParse, + "ResourceAlreadyExists" => StorageErrorCode::ResourceAlreadyExists, + "ResourceNotFound" => StorageErrorCode::ResourceNotFound, + "ResourceTypeMismatch" => StorageErrorCode::ResourceTypeMismatch, + "ServerBusy" => StorageErrorCode::ServerBusy, + "UnsupportedHeader" => StorageErrorCode::UnsupportedHeader, + "UnsupportedHttpVerb" => StorageErrorCode::UnsupportedHttpVerb, + "UnsupportedQueryParameter" => StorageErrorCode::UnsupportedQueryParameter, + "UnsupportedXmlNode" => StorageErrorCode::UnsupportedXmlNode, + _ => StorageErrorCode::UnknownValue(s.to_string()), + }) + } +} + +impl AsRef for StorageErrorCode { + fn as_ref(&self) -> &str { + match self { + StorageErrorCode::AccountAlreadyExists => "AccountAlreadyExists", + StorageErrorCode::AccountBeingCreated => "AccountBeingCreated", + StorageErrorCode::AccountIsDisabled => "AccountIsDisabled", + StorageErrorCode::AuthenticationFailed => "AuthenticationFailed", + StorageErrorCode::AuthorizationFailure => "AuthorizationFailure", + StorageErrorCode::AuthorizationPermissionMismatch => "AuthorizationPermissionMismatch", + StorageErrorCode::AuthorizationProtocolMismatch => "AuthorizationProtocolMismatch", + StorageErrorCode::AuthorizationResourceTypeMismatch => { + "AuthorizationResourceTypeMismatch" + } + StorageErrorCode::AuthorizationServiceMismatch => "AuthorizationServiceMismatch", + StorageErrorCode::AuthorizationSourceIPMismatch => "AuthorizationSourceIPMismatch", + StorageErrorCode::ConditionHeadersNotSupported => "ConditionHeadersNotSupported", + StorageErrorCode::ConditionNotMet => "ConditionNotMet", + StorageErrorCode::EmptyMetadataKey => "EmptyMetadataKey", + StorageErrorCode::FeatureVersionMismatch => "FeatureVersionMismatch", + StorageErrorCode::InsufficientAccountPermissions => "InsufficientAccountPermissions", + StorageErrorCode::InternalError => "InternalError", + StorageErrorCode::InvalidAuthenticationInfo => "InvalidAuthenticationInfo", + StorageErrorCode::InvalidHeaderValue => "InvalidHeaderValue", + StorageErrorCode::InvalidHttpVerb => "InvalidHttpVerb", + StorageErrorCode::InvalidInput => "InvalidInput", + StorageErrorCode::InvalidMarker => "InvalidMarker", + StorageErrorCode::InvalidMd5 => "InvalidMd5", + StorageErrorCode::InvalidMetadata => "InvalidMetadata", + StorageErrorCode::InvalidQueryParameterValue => "InvalidQueryParameterValue", + StorageErrorCode::InvalidRange => "InvalidRange", + StorageErrorCode::InvalidResourceName => "InvalidResourceName", + StorageErrorCode::InvalidUri => "InvalidUri", + StorageErrorCode::InvalidXmlDocument => "InvalidXmlDocument", + StorageErrorCode::InvalidXmlNodeValue => "InvalidXmlNodeValue", + StorageErrorCode::Md5Mismatch => "Md5Mismatch", + StorageErrorCode::MessageNotFound => "MessageNotFound", + StorageErrorCode::MessageTooLarge => "MessageTooLarge", + StorageErrorCode::MetadataTooLarge => "MetadataTooLarge", + StorageErrorCode::MissingContentLengthHeader => "MissingContentLengthHeader", + StorageErrorCode::MissingRequiredHeader => "MissingRequiredHeader", + StorageErrorCode::MissingRequiredQueryParameter => "MissingRequiredQueryParameter", + StorageErrorCode::MissingRequiredXmlNode => "MissingRequiredXmlNode", + StorageErrorCode::MultipleConditionHeadersNotSupported => { + "MultipleConditionHeadersNotSupported" + } + StorageErrorCode::OperationTimedOut => "OperationTimedOut", + StorageErrorCode::OutOfRangeInput => "OutOfRangeInput", + StorageErrorCode::OutOfRangeQueryParameterValue => "OutOfRangeQueryParameterValue", + StorageErrorCode::PopReceiptMismatch => "PopReceiptMismatch", + StorageErrorCode::QueueAlreadyExists => "QueueAlreadyExists", + StorageErrorCode::QueueBeingDeleted => "QueueBeingDeleted", + StorageErrorCode::QueueDisabled => "QueueDisabled", + StorageErrorCode::QueueNotEmpty => "QueueNotEmpty", + StorageErrorCode::QueueNotFound => "QueueNotFound", + StorageErrorCode::RequestBodyTooLarge => "RequestBodyTooLarge", + StorageErrorCode::RequestUrlFailedToParse => "RequestUrlFailedToParse", + StorageErrorCode::ResourceAlreadyExists => "ResourceAlreadyExists", + StorageErrorCode::ResourceNotFound => "ResourceNotFound", + StorageErrorCode::ResourceTypeMismatch => "ResourceTypeMismatch", + StorageErrorCode::ServerBusy => "ServerBusy", + StorageErrorCode::UnsupportedHeader => "UnsupportedHeader", + StorageErrorCode::UnsupportedHttpVerb => "UnsupportedHttpVerb", + StorageErrorCode::UnsupportedQueryParameter => "UnsupportedQueryParameter", + StorageErrorCode::UnsupportedXmlNode => "UnsupportedXmlNode", + StorageErrorCode::UnknownValue(s) => s.as_str(), + } + } +} + +impl Display for StorageErrorCode { + fn fmt(&self, f: &mut Formatter<'_>) -> ::std::fmt::Result { + match self { + StorageErrorCode::AccountAlreadyExists => f.write_str("AccountAlreadyExists"), + StorageErrorCode::AccountBeingCreated => f.write_str("AccountBeingCreated"), + StorageErrorCode::AccountIsDisabled => f.write_str("AccountIsDisabled"), + StorageErrorCode::AuthenticationFailed => f.write_str("AuthenticationFailed"), + StorageErrorCode::AuthorizationFailure => f.write_str("AuthorizationFailure"), + StorageErrorCode::AuthorizationPermissionMismatch => { + f.write_str("AuthorizationPermissionMismatch") + } + StorageErrorCode::AuthorizationProtocolMismatch => { + f.write_str("AuthorizationProtocolMismatch") + } + StorageErrorCode::AuthorizationResourceTypeMismatch => { + f.write_str("AuthorizationResourceTypeMismatch") + } + StorageErrorCode::AuthorizationServiceMismatch => { + f.write_str("AuthorizationServiceMismatch") + } + StorageErrorCode::AuthorizationSourceIPMismatch => { + f.write_str("AuthorizationSourceIPMismatch") + } + StorageErrorCode::ConditionHeadersNotSupported => { + f.write_str("ConditionHeadersNotSupported") + } + StorageErrorCode::ConditionNotMet => f.write_str("ConditionNotMet"), + StorageErrorCode::EmptyMetadataKey => f.write_str("EmptyMetadataKey"), + StorageErrorCode::FeatureVersionMismatch => f.write_str("FeatureVersionMismatch"), + StorageErrorCode::InsufficientAccountPermissions => { + f.write_str("InsufficientAccountPermissions") + } + StorageErrorCode::InternalError => f.write_str("InternalError"), + StorageErrorCode::InvalidAuthenticationInfo => f.write_str("InvalidAuthenticationInfo"), + StorageErrorCode::InvalidHeaderValue => f.write_str("InvalidHeaderValue"), + StorageErrorCode::InvalidHttpVerb => f.write_str("InvalidHttpVerb"), + StorageErrorCode::InvalidInput => f.write_str("InvalidInput"), + StorageErrorCode::InvalidMarker => f.write_str("InvalidMarker"), + StorageErrorCode::InvalidMd5 => f.write_str("InvalidMd5"), + StorageErrorCode::InvalidMetadata => f.write_str("InvalidMetadata"), + StorageErrorCode::InvalidQueryParameterValue => { + f.write_str("InvalidQueryParameterValue") + } + StorageErrorCode::InvalidRange => f.write_str("InvalidRange"), + StorageErrorCode::InvalidResourceName => f.write_str("InvalidResourceName"), + StorageErrorCode::InvalidUri => f.write_str("InvalidUri"), + StorageErrorCode::InvalidXmlDocument => f.write_str("InvalidXmlDocument"), + StorageErrorCode::InvalidXmlNodeValue => f.write_str("InvalidXmlNodeValue"), + StorageErrorCode::Md5Mismatch => f.write_str("Md5Mismatch"), + StorageErrorCode::MessageNotFound => f.write_str("MessageNotFound"), + StorageErrorCode::MessageTooLarge => f.write_str("MessageTooLarge"), + StorageErrorCode::MetadataTooLarge => f.write_str("MetadataTooLarge"), + StorageErrorCode::MissingContentLengthHeader => { + f.write_str("MissingContentLengthHeader") + } + StorageErrorCode::MissingRequiredHeader => f.write_str("MissingRequiredHeader"), + StorageErrorCode::MissingRequiredQueryParameter => { + f.write_str("MissingRequiredQueryParameter") + } + StorageErrorCode::MissingRequiredXmlNode => f.write_str("MissingRequiredXmlNode"), + StorageErrorCode::MultipleConditionHeadersNotSupported => { + f.write_str("MultipleConditionHeadersNotSupported") + } + StorageErrorCode::OperationTimedOut => f.write_str("OperationTimedOut"), + StorageErrorCode::OutOfRangeInput => f.write_str("OutOfRangeInput"), + StorageErrorCode::OutOfRangeQueryParameterValue => { + f.write_str("OutOfRangeQueryParameterValue") + } + StorageErrorCode::PopReceiptMismatch => f.write_str("PopReceiptMismatch"), + StorageErrorCode::QueueAlreadyExists => f.write_str("QueueAlreadyExists"), + StorageErrorCode::QueueBeingDeleted => f.write_str("QueueBeingDeleted"), + StorageErrorCode::QueueDisabled => f.write_str("QueueDisabled"), + StorageErrorCode::QueueNotEmpty => f.write_str("QueueNotEmpty"), + StorageErrorCode::QueueNotFound => f.write_str("QueueNotFound"), + StorageErrorCode::RequestBodyTooLarge => f.write_str("RequestBodyTooLarge"), + StorageErrorCode::RequestUrlFailedToParse => f.write_str("RequestUrlFailedToParse"), + StorageErrorCode::ResourceAlreadyExists => f.write_str("ResourceAlreadyExists"), + StorageErrorCode::ResourceNotFound => f.write_str("ResourceNotFound"), + StorageErrorCode::ResourceTypeMismatch => f.write_str("ResourceTypeMismatch"), + StorageErrorCode::ServerBusy => f.write_str("ServerBusy"), + StorageErrorCode::UnsupportedHeader => f.write_str("UnsupportedHeader"), + StorageErrorCode::UnsupportedHttpVerb => f.write_str("UnsupportedHttpVerb"), + StorageErrorCode::UnsupportedQueryParameter => f.write_str("UnsupportedQueryParameter"), + StorageErrorCode::UnsupportedXmlNode => f.write_str("UnsupportedXmlNode"), + StorageErrorCode::UnknownValue(s) => f.write_str(s.as_str()), + } + } +} diff --git a/sdk/storage/azure_storage_queue/src/generated/models/enums_serde.rs b/sdk/storage/azure_storage_queue/src/generated/models/enums_serde.rs index ebbc15cb50..6d3d8febb1 100644 --- a/sdk/storage/azure_storage_queue/src/generated/models/enums_serde.rs +++ b/sdk/storage/azure_storage_queue/src/generated/models/enums_serde.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{GeoReplicationStatus, ListQueuesIncludeType}; +use super::{GeoReplicationStatus, ListQueuesIncludeType, StorageErrorCode}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; impl<'de> Deserialize<'de> for GeoReplicationStatus { @@ -43,3 +43,22 @@ impl Serialize for ListQueuesIncludeType { s.serialize_str(self.as_ref()) } } + +impl<'de> Deserialize<'de> for StorageErrorCode { + fn deserialize(deserializer: D) -> ::core::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + s.parse().map_err(serde::de::Error::custom) + } +} + +impl Serialize for StorageErrorCode { + fn serialize(&self, s: S) -> ::core::result::Result + where + S: Serializer, + { + s.serialize_str(self.as_ref()) + } +} diff --git a/sdk/storage/azure_storage_queue/src/generated/models/models.rs b/sdk/storage/azure_storage_queue/src/generated/models/models.rs index 1beaae98f1..8ecd5e8ceb 100644 --- a/sdk/storage/azure_storage_queue/src/generated/models/models.rs +++ b/sdk/storage/azure_storage_queue/src/generated/models/models.rs @@ -6,7 +6,7 @@ use super::{ models_serde, xml_helpers::{CorsCorsRule, Queue_itemsQueueItem}, - GeoReplicationStatus, + GeoReplicationStatus, StorageErrorCode, }; use azure_core::{fmt::SafeDebug, time::OffsetDateTime}; use serde::{Deserialize, Serialize}; @@ -68,28 +68,7 @@ pub struct CorsRule { pub struct Error { /// The error code. #[serde(rename = "Code", skip_serializing_if = "Option::is_none")] - pub code: Option, - - /// Copy source error code. - #[serde( - rename = "CopySourceErrorCode", - skip_serializing_if = "Option::is_none" - )] - pub copy_source_error_code: Option, - - /// Copy source error message. - #[serde( - rename = "CopySourceErrorMessage", - skip_serializing_if = "Option::is_none" - )] - pub copy_source_error_message: Option, - - /// Copy source status code. - #[serde( - rename = "CopySourceStatusCode", - skip_serializing_if = "Option::is_none" - )] - pub copy_source_status_code: Option, + pub code: Option, /// The error code. #[serde(rename = "errorCode", skip_serializing_if = "Option::is_none")] @@ -98,20 +77,6 @@ pub struct Error { /// The error message. #[serde(rename = "Message", skip_serializing_if = "Option::is_none")] pub message: Option, - - /// The error code for the copy source. - #[serde( - rename = "xMsCopySourceErrorCode", - skip_serializing_if = "Option::is_none" - )] - pub x_ms_copy_source_error_code: Option, - - /// The status code for the copy source. - #[serde( - rename = "xMsCopySourceStatusCode", - skip_serializing_if = "Option::is_none" - )] - pub x_ms_copy_source_status_code: Option, } /// Geo replication information for the secondary storage location. diff --git a/sdk/storage/azure_storage_queue/tsp-location.yaml b/sdk/storage/azure_storage_queue/tsp-location.yaml index f34b53d588..b2e6267ed8 100755 --- a/sdk/storage/azure_storage_queue/tsp-location.yaml +++ b/sdk/storage/azure_storage_queue/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/storage/Microsoft.QueueStorage -commit: 8bcabc8f5c629e2a426bc919deb43b7669d1290d +commit: f128645a20f5a045331b1e71341940068c55850d repo: Azure/azure-rest-api-specs additionalDirectories: