diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index a9f4c3de55fa1..1daff1c6c28d7 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -2038,7 +2038,7 @@ private async Task> QueryInternal( InputSerialization = options?.InputTextConfiguration.ToQuickQuerySerialization(), OutputSerialization = options?.OutputTextConfiguration.ToQuickQuerySerialization() }; - Response result = await BlobRestClient.Blob.QuickQueryAsync( + Response result = await BlobRestClient.Blob.QueryAsync( clientDiagnostics: ClientDiagnostics, pipeline: Pipeline, resourceUri: Uri, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index feb612341c123..688e236c3b746 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -8354,9 +8354,9 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( } #endregion Blob.SetAccessTierAsync - #region Blob.QuickQueryAsync + #region Blob.QueryAsync /// - /// The QuickQuery operation enables users to select/project on blob data by providing simple query expressions. + /// The Query operation enables users to select/project on blob data by providing simple query expressions. /// /// The ClientDiagnostics instance used for operation reporting. /// The pipeline used for sending requests. @@ -8377,8 +8377,8 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( /// Whether to invoke the operation asynchronously. The default value is true. /// Operation name. /// Cancellation token. - /// Azure.Response{Azure.Storage.Blobs.Models.BlobQuickQueryResult} - public static async System.Threading.Tasks.ValueTask> QuickQueryAsync( + /// Azure.Response{Azure.Storage.Blobs.Models.BlobQueryResult} + public static async System.Threading.Tasks.ValueTask> QueryAsync( Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, @@ -8396,7 +8396,7 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( Azure.ETag? ifNoneMatch = default, string requestId = default, bool async = true, - string operationName = "BlobClient.QuickQuery", + string operationName = "BlobClient.Query", System.Threading.CancellationToken cancellationToken = default) { Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); @@ -8404,7 +8404,7 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( { _scope.AddAttribute("url", resourceUri); _scope.Start(); - using (Azure.Core.HttpMessage _message = QuickQueryAsync_CreateMessage( + using (Azure.Core.HttpMessage _message = QueryAsync_CreateMessage( pipeline, resourceUri, version, @@ -8434,7 +8434,7 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( } Azure.Response _response = _message.Response; cancellationToken.ThrowIfCancellationRequested(); - return QuickQueryAsync_CreateResponse(clientDiagnostics, _response); + return QueryAsync_CreateResponse(clientDiagnostics, _response); } } catch (System.Exception ex) @@ -8449,7 +8449,7 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( } /// - /// Create the Blob.QuickQueryAsync request. + /// Create the Blob.QueryAsync request. /// /// The pipeline used for sending requests. /// The URL of the service account, container, or blob that is the targe of the desired operation. @@ -8466,8 +8466,8 @@ internal static Azure.Response SetAccessTierAsync_CreateResponse( /// Specify an ETag value to operate only on blobs with a matching value. /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. - /// The Blob.QuickQueryAsync Message. - internal static Azure.Core.HttpMessage QuickQueryAsync_CreateMessage( + /// The Blob.QueryAsync Message. + internal static Azure.Core.HttpMessage QueryAsync_CreateMessage( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string version, @@ -8531,12 +8531,12 @@ internal static Azure.Core.HttpMessage QuickQueryAsync_CreateMessage( } /// - /// Create the Blob.QuickQueryAsync response or throw a failure exception. + /// Create the Blob.QueryAsync response or throw a failure exception. /// /// The ClientDiagnostics instance to use. /// The raw Response. - /// The Blob.QuickQueryAsync Azure.Response{Azure.Storage.Blobs.Models.BlobQuickQueryResult}. - internal static Azure.Response QuickQueryAsync_CreateResponse( + /// The Blob.QueryAsync Azure.Response{Azure.Storage.Blobs.Models.BlobQueryResult}. + internal static Azure.Response QueryAsync_CreateResponse( Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, Azure.Response response) { @@ -8546,7 +8546,7 @@ internal static Azure.Core.HttpMessage QuickQueryAsync_CreateMessage( case 200: { // Create the result - Azure.Storage.Blobs.Models.BlobQuickQueryResult _value = new Azure.Storage.Blobs.Models.BlobQuickQueryResult(); + Azure.Storage.Blobs.Models.BlobQueryResult _value = new Azure.Storage.Blobs.Models.BlobQueryResult(); _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! // Get response headers @@ -8674,7 +8674,7 @@ internal static Azure.Core.HttpMessage QuickQueryAsync_CreateMessage( case 206: { // Create the result - Azure.Storage.Blobs.Models.BlobQuickQueryResult _value = new Azure.Storage.Blobs.Models.BlobQuickQueryResult(); + Azure.Storage.Blobs.Models.BlobQueryResult _value = new Azure.Storage.Blobs.Models.BlobQueryResult(); _value.Body = response.ContentStream; // You should manually wrap with RetriableStream! // Get response headers @@ -8819,7 +8819,7 @@ internal static Azure.Core.HttpMessage QuickQueryAsync_CreateMessage( } } } - #endregion Blob.QuickQueryAsync + #endregion Blob.QueryAsync #region Blob.GetTagsAsync /// @@ -15224,13 +15224,13 @@ internal BlobGetAccessControlResult() { } } #endregion class BlobGetAccessControlResult -#region class BlobQuickQueryResult +#region class BlobQueryResult namespace Azure.Storage.Blobs.Models { /// - /// Blob QuickQueryResult + /// Blob QueryResult /// - internal partial class BlobQuickQueryResult + internal partial class BlobQueryResult { /// /// Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. @@ -15389,15 +15389,15 @@ internal partial class BlobQuickQueryResult public System.IO.Stream Body { get; internal set; } /// - /// Creates a new BlobQuickQueryResult instance + /// Creates a new BlobQueryResult instance /// - public BlobQuickQueryResult() + public BlobQueryResult() { Metadata = new System.Collections.Generic.Dictionary(System.StringComparer.OrdinalIgnoreCase); } } } -#endregion class BlobQuickQueryResult +#endregion class BlobQueryResult #region class BlobRenameResult namespace Azure.Storage.Blobs.Models @@ -22247,86 +22247,18 @@ public static Azure.Storage.Blobs.Models.PublicAccessType ParsePublicAccessType( } #endregion enum PublicAccessType -#region class QueryRequest -namespace Azure.Storage.Blobs.Models -{ - /// - /// the quick query body - /// - internal partial class QueryRequest - { - /// - /// the query type - /// - public string QueryType { get; set; } - - /// - /// a query statement - /// - public string Expression { get; set; } - - /// - /// InputSerialization - /// - public Azure.Storage.Blobs.Models.QuickQuerySerialization InputSerialization { get; set; } - - /// - /// OutputSerialization - /// - public Azure.Storage.Blobs.Models.QuickQuerySerialization OutputSerialization { get; set; } - - /// - /// Creates a new QueryRequest instance - /// - public QueryRequest() - { - InputSerialization = new Azure.Storage.Blobs.Models.QuickQuerySerialization(); - OutputSerialization = new Azure.Storage.Blobs.Models.QuickQuerySerialization(); - } - - /// - /// Serialize a QueryRequest instance as XML. - /// - /// The QueryRequest instance to serialize. - /// An optional name to use for the root element instead of "QueryRequest". - /// An optional namespace to use for the root element instead of "". - /// The serialized XML element. - internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QueryRequest value, string name = "QueryRequest", string ns = "") - { - System.Diagnostics.Debug.Assert(value != null); - System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); - _element.Add(new System.Xml.Linq.XElement( - System.Xml.Linq.XName.Get("QueryType", ""), - value.QueryType)); - _element.Add(new System.Xml.Linq.XElement( - System.Xml.Linq.XName.Get("Expression", ""), - value.Expression)); - if (value.InputSerialization != null) - { - _element.Add(Azure.Storage.Blobs.Models.QuickQuerySerialization.ToXml(value.InputSerialization, "InputSerialization", "")); - } - if (value.OutputSerialization != null) - { - _element.Add(Azure.Storage.Blobs.Models.QuickQuerySerialization.ToXml(value.OutputSerialization, "OutputSerialization", "")); - } - return _element; - } - } -} -#endregion class QueryRequest - -#region class QuickQueryFormat +#region class QueryFormat namespace Azure.Storage.Blobs.Models { /// - /// QuickQueryFormat + /// QueryFormat /// - internal partial class QuickQueryFormat + internal partial class QueryFormat { /// /// The quick query format type. /// - public Azure.Storage.Blobs.Models.QuickQueryFormatType? Type { get; set; } + public Azure.Storage.Blobs.Models.QueryFormatType? Type { get; set; } /// /// delimited text configuration @@ -22339,22 +22271,22 @@ internal partial class QuickQueryFormat public Azure.Storage.Blobs.Models.JsonTextConfigurationInternal JsonTextConfiguration { get; set; } /// - /// Creates a new QuickQueryFormat instance + /// Creates a new QueryFormat instance /// - public QuickQueryFormat() + public QueryFormat() { DelimitedTextConfiguration = new Azure.Storage.Blobs.Models.DelimitedTextConfigurationInternal(); JsonTextConfiguration = new Azure.Storage.Blobs.Models.JsonTextConfigurationInternal(); } /// - /// Serialize a QuickQueryFormat instance as XML. + /// Serialize a QueryFormat instance as XML. /// - /// The QuickQueryFormat instance to serialize. - /// An optional name to use for the root element instead of "QuickQueryFormat". + /// The QueryFormat instance to serialize. + /// An optional name to use for the root element instead of "QueryFormat". /// An optional namespace to use for the root element instead of "". /// The serialized XML element. - internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QuickQueryFormat value, string name = "QuickQueryFormat", string ns = "") + internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QueryFormat value, string name = "QueryFormat", string ns = "") { System.Diagnostics.Debug.Assert(value != null); System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); @@ -22376,15 +22308,15 @@ internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QuickQ } } } -#endregion class QuickQueryFormat +#endregion class QueryFormat -#region enum QuickQueryFormatType +#region enum QueryFormatType namespace Azure.Storage.Blobs.Models { /// /// The quick query format type. /// - internal enum QuickQueryFormatType + internal enum QueryFormatType { /// /// delimited @@ -22404,68 +22336,136 @@ internal static partial class BlobRestClient { public static partial class Serialization { - public static string ToString(Azure.Storage.Blobs.Models.QuickQueryFormatType value) + public static string ToString(Azure.Storage.Blobs.Models.QueryFormatType value) { return value switch { - Azure.Storage.Blobs.Models.QuickQueryFormatType.Delimited => "delimited", - Azure.Storage.Blobs.Models.QuickQueryFormatType.Json => "json", - _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs.Models.QuickQueryFormatType value.") + Azure.Storage.Blobs.Models.QueryFormatType.Delimited => "delimited", + Azure.Storage.Blobs.Models.QueryFormatType.Json => "json", + _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs.Models.QueryFormatType value.") }; } - public static Azure.Storage.Blobs.Models.QuickQueryFormatType ParseQuickQueryFormatType(string value) + public static Azure.Storage.Blobs.Models.QueryFormatType ParseQueryFormatType(string value) { return value switch { - "delimited" => Azure.Storage.Blobs.Models.QuickQueryFormatType.Delimited, - "json" => Azure.Storage.Blobs.Models.QuickQueryFormatType.Json, - _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs.Models.QuickQueryFormatType value.") + "delimited" => Azure.Storage.Blobs.Models.QueryFormatType.Delimited, + "json" => Azure.Storage.Blobs.Models.QueryFormatType.Json, + _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs.Models.QueryFormatType value.") }; } } } } -#endregion enum QuickQueryFormatType +#endregion enum QueryFormatType + +#region class QueryRequest +namespace Azure.Storage.Blobs.Models +{ + /// + /// the quick query body + /// + internal partial class QueryRequest + { + /// + /// the query type + /// + public string QueryType { get; set; } + + /// + /// a query statement + /// + public string Expression { get; set; } + + /// + /// InputSerialization + /// + public Azure.Storage.Blobs.Models.QuerySerialization InputSerialization { get; set; } + + /// + /// OutputSerialization + /// + public Azure.Storage.Blobs.Models.QuerySerialization OutputSerialization { get; set; } + + /// + /// Creates a new QueryRequest instance + /// + public QueryRequest() + { + InputSerialization = new Azure.Storage.Blobs.Models.QuerySerialization(); + OutputSerialization = new Azure.Storage.Blobs.Models.QuerySerialization(); + } + + /// + /// Serialize a QueryRequest instance as XML. + /// + /// The QueryRequest instance to serialize. + /// An optional name to use for the root element instead of "QueryRequest". + /// An optional namespace to use for the root element instead of "". + /// The serialized XML element. + internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QueryRequest value, string name = "QueryRequest", string ns = "") + { + System.Diagnostics.Debug.Assert(value != null); + System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); + _element.Add(new System.Xml.Linq.XElement( + System.Xml.Linq.XName.Get("QueryType", ""), + value.QueryType)); + _element.Add(new System.Xml.Linq.XElement( + System.Xml.Linq.XName.Get("Expression", ""), + value.Expression)); + if (value.InputSerialization != null) + { + _element.Add(Azure.Storage.Blobs.Models.QuerySerialization.ToXml(value.InputSerialization, "InputSerialization", "")); + } + if (value.OutputSerialization != null) + { + _element.Add(Azure.Storage.Blobs.Models.QuerySerialization.ToXml(value.OutputSerialization, "OutputSerialization", "")); + } + return _element; + } + } +} +#endregion class QueryRequest -#region class QuickQuerySerialization +#region class QuerySerialization namespace Azure.Storage.Blobs.Models { /// - /// QuickQuerySerialization + /// QuerySerialization /// - internal partial class QuickQuerySerialization + internal partial class QuerySerialization { /// /// Format /// - public Azure.Storage.Blobs.Models.QuickQueryFormat Format { get; set; } + public Azure.Storage.Blobs.Models.QueryFormat Format { get; set; } /// - /// Creates a new QuickQuerySerialization instance + /// Creates a new QuerySerialization instance /// - public QuickQuerySerialization() + public QuerySerialization() { - Format = new Azure.Storage.Blobs.Models.QuickQueryFormat(); + Format = new Azure.Storage.Blobs.Models.QueryFormat(); } /// - /// Serialize a QuickQuerySerialization instance as XML. + /// Serialize a QuerySerialization instance as XML. /// - /// The QuickQuerySerialization instance to serialize. - /// An optional name to use for the root element instead of "QuickQuerySerialization". + /// The QuerySerialization instance to serialize. + /// An optional name to use for the root element instead of "QuerySerialization". /// An optional namespace to use for the root element instead of "". /// The serialized XML element. - internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QuickQuerySerialization value, string name = "QuickQuerySerialization", string ns = "") + internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Blobs.Models.QuerySerialization value, string name = "QuerySerialization", string ns = "") { System.Diagnostics.Debug.Assert(value != null); System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns)); - _element.Add(Azure.Storage.Blobs.Models.QuickQueryFormat.ToXml(value.Format, "Format", "")); + _element.Add(Azure.Storage.Blobs.Models.QueryFormat.ToXml(value.Format, "Format", "")); return _element; } } } -#endregion class QuickQuerySerialization +#endregion class QuerySerialization #region enum RehydratePriority namespace Azure.Storage.Blobs.Models diff --git a/sdk/storage/Azure.Storage.Blobs/src/QuickQueryExtensions.cs b/sdk/storage/Azure.Storage.Blobs/src/QuickQueryExtensions.cs index 83b71831923aa..c02511680f239 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/QuickQueryExtensions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/QuickQueryExtensions.cs @@ -14,7 +14,7 @@ namespace Azure.Storage.Blobs /// internal static class QuickQueryExtensions { - internal static QuickQuerySerialization ToQuickQuerySerialization( + internal static QuerySerialization ToQuickQuerySerialization( this BlobQueryTextConfiguration textConfiguration) { if (textConfiguration == default) @@ -22,9 +22,9 @@ internal static QuickQuerySerialization ToQuickQuerySerialization( return default; } - QuickQuerySerialization serialization = new QuickQuerySerialization + QuerySerialization serialization = new QuerySerialization { - Format = new QuickQueryFormat() + Format = new QueryFormat() }; serialization.Format.DelimitedTextConfiguration = default; @@ -33,7 +33,7 @@ internal static QuickQuerySerialization ToQuickQuerySerialization( if (textConfiguration.GetType() == typeof(BlobQueryCsvTextConfiguration)) { BlobQueryCsvTextConfiguration cvsTextConfiguration = textConfiguration as BlobQueryCsvTextConfiguration; - serialization.Format.Type = QuickQueryFormatType.Delimited; + serialization.Format.Type = QueryFormatType.Delimited; serialization.Format.DelimitedTextConfiguration = new DelimitedTextConfigurationInternal { ColumnSeparator = cvsTextConfiguration.ColumnSeparator?.ToString(CultureInfo.InvariantCulture), @@ -46,7 +46,7 @@ internal static QuickQuerySerialization ToQuickQuerySerialization( else if (textConfiguration.GetType() == typeof(BlobQueryJsonTextConfiguration)) { BlobQueryJsonTextConfiguration jsonTextConfiguration = textConfiguration as BlobQueryJsonTextConfiguration; - serialization.Format.Type = QuickQueryFormatType.Json; + serialization.Format.Type = QueryFormatType.Json; serialization.Format.JsonTextConfiguration = new JsonTextConfigurationInternal { RecordSeparator = jsonTextConfiguration.RecordSeparator?.ToString(CultureInfo.InvariantCulture) @@ -60,7 +60,7 @@ internal static QuickQuerySerialization ToQuickQuerySerialization( return serialization; } - internal static BlobDownloadInfo ToBlobDownloadInfo(this BlobQuickQueryResult quickQueryResult) + internal static BlobDownloadInfo ToBlobDownloadInfo(this BlobQueryResult quickQueryResult) => BlobsModelFactory.BlobDownloadInfo( lastModified: quickQueryResult.LastModified, blobSequenceNumber: quickQueryResult.BlobSequenceNumber, diff --git a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md index bcc0de1299723..467dd10b716ee 100644 --- a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md +++ b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md @@ -1415,7 +1415,7 @@ directive: }; ``` -### Make BlobQuickQueryResult internal +### Make BlobQueryResult internal ``` yaml directive: - from: swagger-document @@ -1434,20 +1434,20 @@ directive: $["x-az-public"] = false; ``` -### Hide QuickQueryFormat +### Hide QueryFormat ``` yaml directive: - from: swagger-document - where: definitions.QuickQueryFormat + where: definitions.QueryFormat transform: > $["x-az-public"] = false; ``` -### Hide QuickQuerySerialization +### Hide QuerySerialization ``` yaml directive: - from: swagger-document - where: definitions.QuickQuerySerialization + where: definitions.QuerySerialization transform: > $["x-az-public"] = false; ``` @@ -1472,11 +1472,11 @@ directive: $["x-ms-client-name"] = "DelimitedTextConfigurationInternal"; ``` -### Hide QuickQueryType +### Hide QueryType ``` yaml directive: - from: swagger-document - where: definitions.QuickQueryType + where: definitions.QueryType transform: > $["x-az-public"] = false; ```