From 90e89db11a207dc776b088aadb02150e52aa7764 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Wed, 7 Aug 2024 15:19:49 +0200 Subject: [PATCH] Implement `Esql.QueryAsStreamAsync` helper (#8283) --- benchmarks/Benchmarks/packages.lock.json | 6 +-- benchmarks/Profiling/packages.lock.json | 6 +-- .../packages.lock.json | 30 +++++++-------- .../Client/ElasticsearchClient.cs | 12 +++--- ...ic.Clients.Elasticsearch.Serverless.csproj | 2 +- .../packages.lock.json | 30 +++++++-------- .../Api/Esql/EsqlQueryRequest.cs | 9 +++-- .../Api/Esql/EsqlQueryResponse.cs | 7 ++-- .../Client/ElasticsearchClient.Esql.cs | 37 ++++++++++++++++--- .../Client/NamespacedClientProxy.cs | 8 ++-- .../Client/ElasticsearchClient.cs | 12 +++--- .../Elastic.Clients.Elasticsearch.csproj | 2 +- .../packages.lock.json | 30 +++++++-------- src/Playground/Playground.csproj | 3 +- src/Playground/packages.lock.json | 29 ++++++++------- .../Tests.ClusterLauncher/packages.lock.json | 12 +++--- tests/Tests.Core/packages.lock.json | 6 +-- tests/Tests.Domain/packages.lock.json | 6 +-- tests/Tests/Tests.csproj | 2 +- tests/Tests/packages.lock.json | 28 +++++++------- 20 files changed, 154 insertions(+), 123 deletions(-) diff --git a/benchmarks/Benchmarks/packages.lock.json b/benchmarks/Benchmarks/packages.lock.json index a48c129c448..a71fd31a62a 100644 --- a/benchmarks/Benchmarks/packages.lock.json +++ b/benchmarks/Benchmarks/packages.lock.json @@ -67,8 +67,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -1196,7 +1196,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } } diff --git a/benchmarks/Profiling/packages.lock.json b/benchmarks/Profiling/packages.lock.json index 225f0e469ef..ebc324c614b 100644 --- a/benchmarks/Profiling/packages.lock.json +++ b/benchmarks/Profiling/packages.lock.json @@ -31,8 +31,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -122,7 +122,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } } diff --git a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json index 2e955827912..2a58420a4d3 100644 --- a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json +++ b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json @@ -37,8 +37,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -185,7 +185,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } }, @@ -234,8 +234,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -381,7 +381,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } }, @@ -421,8 +421,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -560,7 +560,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } }, @@ -600,8 +600,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -691,7 +691,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } }, @@ -731,8 +731,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==" + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==" }, "Microsoft.Build.Tasks.Git": { "type": "Transitive", @@ -788,7 +788,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } } diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs index d5ace0ce48a..f3a70e5c252 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs +++ b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs @@ -95,7 +95,7 @@ private enum ProductCheckStatus internal TResponse DoRequest(TRequest request) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequest(request, null); @@ -103,7 +103,7 @@ internal TResponse DoRequest( TRequest request, Action? forceConfiguration) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestCoreAsync(false, request, forceConfiguration).EnsureCompleted(); @@ -111,7 +111,7 @@ internal Task DoRequestAsync TRequest request, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestAsync(request, null, cancellationToken); @@ -120,7 +120,7 @@ internal Task DoRequestAsync Action? forceConfiguration, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestCoreAsync(true, request, forceConfiguration, cancellationToken).AsTask(); @@ -130,7 +130,7 @@ private ValueTask DoRequestCoreAsync? forceConfiguration, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() { if (_productCheckStatus == ProductCheckStatus.Failed) @@ -280,7 +280,7 @@ private static OpenTelemetryData PrepareOpenTelemetryData(TRequest request, TResponse response) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() { if (response.ApiCallDetails.HttpStatusCode.HasValue && response.ApiCallDetails.HttpStatusCode.Value >= 200 && response.ApiCallDetails.HttpStatusCode.Value <= 299 && _productCheckStatus == ProductCheckStatus.NotChecked) { diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj index ce2ea9dbb24..12c277e36de 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj +++ b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj @@ -21,7 +21,7 @@ annotations - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json b/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json index d07d5a843ce..c279af5e0db 100644 --- a/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json +++ b/src/Elastic.Clients.Elasticsearch.Serverless/packages.lock.json @@ -22,9 +22,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -205,9 +205,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -396,9 +396,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -570,9 +570,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -696,9 +696,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==" + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==" }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryRequest.cs index 61cb5d61ac2..3f5821e2cb0 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryRequest.cs @@ -2,8 +2,6 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -#if ELASTICSEARCH_STACK - using System.IO; using System.Runtime.CompilerServices; using System.Threading; @@ -11,7 +9,12 @@ using Elastic.Transport; +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Esql; +#else + namespace Elastic.Clients.Elasticsearch.Esql; +#endif internal sealed class EsqlResponseBuilder : CustomResponseBuilder { @@ -66,5 +69,3 @@ public sealed partial class EsqlQueryRequestParameters public EsqlQueryRequestParameters() => CustomResponseBuilder = ResponseBuilder; } - -#endif diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryResponse.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryResponse.cs index 60266c506c0..a8f9904bae4 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryResponse.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/Esql/EsqlQueryResponse.cs @@ -2,13 +2,14 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -#if ELASTICSEARCH_STACK +#if ELASTICSEARCH_SERVERLESS +namespace Elastic.Clients.Elasticsearch.Serverless.Esql; +#else namespace Elastic.Clients.Elasticsearch.Esql; +#endif public sealed partial class EsqlQueryResponse { public byte[] Data { get; init; } } - -#endif diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient.Esql.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient.Esql.cs index d378ddde9ad..14c8d7ac845 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient.Esql.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/ElasticsearchClient.Esql.cs @@ -2,8 +2,6 @@ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. -#if !ELASTICSEARCH_SERVERLESS - using System; using System.Collections.Generic; using System.IO; @@ -12,9 +10,10 @@ using System.Text.Json.Nodes; using System.Threading.Tasks; using System.Threading; +using Elastic.Transport; #if ELASTICSEARCH_SERVERLESS -namespace Elastic.Clients.Elasticsearch.Esql.Serverless; +namespace Elastic.Clients.Elasticsearch.Serverless.Esql; #else namespace Elastic.Clients.Elasticsearch.Esql; @@ -22,6 +21,36 @@ namespace Elastic.Clients.Elasticsearch.Esql; public partial class EsqlNamespacedClient { + /// + /// Executes an ES|QL request and returns the response as a stream. + /// + /// The ES|QL query result as a generic stream response. + /// The response must be disposed after use. + public virtual Task QueryAsStreamAsync( + Action> configureRequest, + CancellationToken cancellationToken = default) + { + var descriptor = new EsqlQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync, StreamResponse, EsqlQueryRequestParameters>(descriptor, cancellationToken); + } + + /// + /// Executes an ES|QL request and returns the response as a stream. + /// + /// The ES|QL query result as a generic stream response. + /// The response must be disposed after use. + public virtual Task QueryAsStreamAsync( + Action configureRequest, + CancellationToken cancellationToken = default) + { + var descriptor = new EsqlQueryRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor, cancellationToken); + } + public virtual async Task> QueryAsObjectsAsync( Action> configureRequest, CancellationToken cancellationToken = default) @@ -92,5 +121,3 @@ private static IEnumerable EsqlToObject(ElasticsearchClient client, EsqlQu } } } - -#endif diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs b/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs index ee5a4ed93d5..08d43d8d6a7 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Client/NamespacedClientProxy.cs @@ -35,7 +35,7 @@ protected NamespacedClientProxy() { } internal TResponse DoRequest(TRequest request) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequest(request, null); @@ -43,7 +43,7 @@ internal TResponse DoRequest( TRequest request, Action? forceConfiguration) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() { if (Client is null) @@ -56,7 +56,7 @@ internal Task DoRequestAsync TRequest request, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestAsync(request, null, cancellationToken); @@ -65,7 +65,7 @@ internal Task DoRequestAsync Action? forceConfiguration, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() { if (Client is null) diff --git a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs b/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs index aa9fcb10577..c9134d26b9c 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs +++ b/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchClient.cs @@ -95,7 +95,7 @@ private enum ProductCheckStatus internal TResponse DoRequest(TRequest request) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequest(request, null); @@ -103,7 +103,7 @@ internal TResponse DoRequest( TRequest request, Action? forceConfiguration) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestCoreAsync(false, request, forceConfiguration).EnsureCompleted(); @@ -111,7 +111,7 @@ internal Task DoRequestAsync TRequest request, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestAsync(request, null, cancellationToken); @@ -120,7 +120,7 @@ internal Task DoRequestAsync Action? forceConfiguration, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() => DoRequestCoreAsync(true, request, forceConfiguration, cancellationToken).AsTask(); @@ -130,7 +130,7 @@ private ValueTask DoRequestCoreAsync? forceConfiguration, CancellationToken cancellationToken = default) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() where TRequestParameters : RequestParameters, new() { if (_productCheckStatus == ProductCheckStatus.Failed) @@ -280,7 +280,7 @@ private static OpenTelemetryData PrepareOpenTelemetryData(TRequest request, TResponse response) where TRequest : Request - where TResponse : ElasticsearchResponse, new() + where TResponse : TransportResponse, new() { if (response.ApiCallDetails.HttpStatusCode.HasValue && response.ApiCallDetails.HttpStatusCode.Value >= 200 && response.ApiCallDetails.HttpStatusCode.Value <= 299 && _productCheckStatus == ProductCheckStatus.NotChecked) { diff --git a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj index 02321a10d47..471b0b5f829 100644 --- a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj +++ b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj @@ -21,7 +21,7 @@ annotations - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Elastic.Clients.Elasticsearch/packages.lock.json b/src/Elastic.Clients.Elasticsearch/packages.lock.json index d07d5a843ce..c279af5e0db 100644 --- a/src/Elastic.Clients.Elasticsearch/packages.lock.json +++ b/src/Elastic.Clients.Elasticsearch/packages.lock.json @@ -22,9 +22,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -205,9 +205,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -396,9 +396,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -570,9 +570,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -696,9 +696,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==" + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==" }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", diff --git a/src/Playground/Playground.csproj b/src/Playground/Playground.csproj index a65c2c4de7d..39421d601fa 100644 --- a/src/Playground/Playground.csproj +++ b/src/Playground/Playground.csproj @@ -10,7 +10,8 @@ - + + diff --git a/src/Playground/packages.lock.json b/src/Playground/packages.lock.json index 080a10e0520..79a711b65a4 100644 --- a/src/Playground/packages.lock.json +++ b/src/Playground/packages.lock.json @@ -16,9 +16,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -48,6 +48,16 @@ "resolved": "13.0.1", "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, + "System.Text.Json": { + "type": "Direct", + "requested": "[8.0.4, )", + "resolved": "8.0.4", + "contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0" + } + }, "Castle.Core": { "type": "Transitive", "resolved": "5.1.0", @@ -133,19 +143,10 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "8.0.4", - "contentHash": "bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "8.0.0" - } - }, "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { @@ -158,7 +159,7 @@ "elastic.clients.elasticsearch.serverless": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } } } diff --git a/tests/Tests.ClusterLauncher/packages.lock.json b/tests/Tests.ClusterLauncher/packages.lock.json index eb182f6e71f..510916705b8 100644 --- a/tests/Tests.ClusterLauncher/packages.lock.json +++ b/tests/Tests.ClusterLauncher/packages.lock.json @@ -75,8 +75,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -1278,7 +1278,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { @@ -1395,8 +1395,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==" + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==" }, "FluentAssertions": { "type": "Transitive", @@ -2581,7 +2581,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { diff --git a/tests/Tests.Core/packages.lock.json b/tests/Tests.Core/packages.lock.json index 6cedaa2e576..1ec9c94160b 100644 --- a/tests/Tests.Core/packages.lock.json +++ b/tests/Tests.Core/packages.lock.json @@ -137,8 +137,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1588,7 +1588,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { diff --git a/tests/Tests.Domain/packages.lock.json b/tests/Tests.Domain/packages.lock.json index f774db8d2b6..9832722d98b 100644 --- a/tests/Tests.Domain/packages.lock.json +++ b/tests/Tests.Domain/packages.lock.json @@ -57,8 +57,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1141,7 +1141,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "tests.configuration": { diff --git a/tests/Tests/Tests.csproj b/tests/Tests/Tests.csproj index c9a9bf3e0cc..b396faa7e5b 100644 --- a/tests/Tests/Tests.csproj +++ b/tests/Tests/Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Tests/packages.lock.json b/tests/Tests/packages.lock.json index 1d845c59e8b..db746e240ce 100644 --- a/tests/Tests/packages.lock.json +++ b/tests/Tests/packages.lock.json @@ -31,11 +31,11 @@ }, "Elastic.Transport.VirtualizedCluster": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "uzCMq6uAqqX3Do6+8bPHTq8g1y5tViHuAZG+rXJgbhEsaDwJHqRNl/gNcACSZXaOr0RZjijcUFB3/XA+HFuWPw==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "r8iOvUkTNWVsjW/1t/QkcUhH1r5LlzntT50nDW1oyEoTqRQS81JtYLvvyFrViPEbMiTh02wMUF7GIFVyQgl/Og==", "dependencies": { - "Elastic.Transport": "0.4.20" + "Elastic.Transport": "0.4.22" } }, "FSharp.Core": { @@ -195,8 +195,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==", + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==", "dependencies": { "System.Diagnostics.DiagnosticSource": "8.0.0", "System.Text.Json": "8.0.4" @@ -1495,7 +1495,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { @@ -1574,11 +1574,11 @@ }, "Elastic.Transport.VirtualizedCluster": { "type": "Direct", - "requested": "[0.4.20, )", - "resolved": "0.4.20", - "contentHash": "uzCMq6uAqqX3Do6+8bPHTq8g1y5tViHuAZG+rXJgbhEsaDwJHqRNl/gNcACSZXaOr0RZjijcUFB3/XA+HFuWPw==", + "requested": "[0.4.22, )", + "resolved": "0.4.22", + "contentHash": "r8iOvUkTNWVsjW/1t/QkcUhH1r5LlzntT50nDW1oyEoTqRQS81JtYLvvyFrViPEbMiTh02wMUF7GIFVyQgl/Og==", "dependencies": { - "Elastic.Transport": "0.4.20" + "Elastic.Transport": "0.4.22" } }, "FSharp.Core": { @@ -1738,8 +1738,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.20", - "contentHash": "/Msl7KoUk0Stg28+g64AujlnR2+1jyR8OkQKcWYPpOy/H1EGpJAvlnVDgF0xJxHIG+MUrejn52uzmJVkWPNjpQ==" + "resolved": "0.4.22", + "contentHash": "9J5GPHJcT8sewn2zVfWTrsCQvfQYgUiY/jx+IRjWUk7XNPd837qfEL42I5baH69cyW/e4RoDy8v76yxqz95tDw==" }, "EmptyFiles": { "type": "Transitive", @@ -3021,7 +3021,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.20, )" + "Elastic.Transport": "[0.4.22, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": {