From 166f76bc6a569ada7af50aa78564c18bb0a96ff6 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 28 Apr 2025 12:39:26 +0200 Subject: [PATCH 1/2] Fix NRE in `GetAliasResponse` --- .../_Shared/Api/IndexManagement/GetAliasResponse.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Api/IndexManagement/GetAliasResponse.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Api/IndexManagement/GetAliasResponse.cs index 7be09b3726..0a36644731 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Api/IndexManagement/GetAliasResponse.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Api/IndexManagement/GetAliasResponse.cs @@ -2,9 +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. -using System.Collections.Generic; -using System.Text.Json.Serialization; - namespace Elastic.Clients.Elasticsearch.IndexManagement; public partial class GetAliasResponse @@ -17,5 +14,5 @@ public partial class GetAliasResponse /// the client considers the response to be valid. /// /// - public override bool IsValidResponse => base.IsValidResponse || Aliases.Count > 0; + public override bool IsValidResponse => base.IsValidResponse || Aliases?.Count > 0; } From 8dec44dfadc00b97aba20d439d684732417a4705 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 28 Apr 2025 20:19:22 +0200 Subject: [PATCH 2/2] Regenerate client --- .../MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs | 4 ++-- .../Api/MachineLearning/GetDatafeedStatsRequest.g.cs | 4 ++-- .../_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs | 4 ++-- .../Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs | 4 ++-- .../Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs | 4 ++-- .../Types/Core/RankEval/RankEvalMetricPrecision.g.cs | 4 ++-- .../_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs | 4 ++-- .../_Generated/Types/Core/Search/InnerHits.g.cs | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs index cbb432c5a5..47c5a16aa4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs @@ -109,7 +109,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// -/// Get data frame analytics jobs usage info. +/// Get data frame analytics job stats. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequestConverter))] @@ -206,7 +206,7 @@ internal GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Seriali /// /// -/// Get data frame analytics jobs usage info. +/// Get data frame analytics job stats. /// /// public readonly partial struct GetDataFrameAnalyticsStatsRequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs index df459b2b44..8afd1ed794 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs @@ -87,7 +87,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// -/// Get datafeeds usage info. +/// Get datafeed stats. /// You can get statistics for multiple datafeeds in a single API request by /// using a comma-separated list of datafeeds or a wildcard expression. You can /// get statistics for all datafeeds by using _all, by specifying * as the @@ -168,7 +168,7 @@ internal GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// -/// Get datafeeds usage info. +/// Get datafeed stats. /// You can get statistics for multiple datafeeds in a single API request by /// using a comma-separated list of datafeeds or a wildcard expression. You can /// get statistics for all datafeeds by using _all, by specifying * as the diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs index 020c43aa37..5a6515d9b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs @@ -87,7 +87,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// -/// Get anomaly detection jobs usage info. +/// Get anomaly detection job stats. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequestConverter))] @@ -163,7 +163,7 @@ internal GetJobStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// -/// Get anomaly detection jobs usage info. +/// Get anomaly detection job stats. /// /// public readonly partial struct GetJobStatsRequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs index 238cd02984..5e66df5794 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Discounted cumulative gain (DCG) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGainConverter))] public sealed partial class RankEvalMetricDiscountedCumulativeGain @@ -115,7 +115,7 @@ internal RankEvalMetricDiscountedCumulativeGain(Elastic.Clients.Elasticsearch.Se /// /// Discounted cumulative gain (DCG) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// public readonly partial struct RankEvalMetricDiscountedCumulativeGainDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs index d7b3fdec1b..c54c6362ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Mean Reciprocal Rank /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRankConverter))] public sealed partial class RankEvalMetricMeanReciprocalRank @@ -115,7 +115,7 @@ internal RankEvalMetricMeanReciprocalRank(Elastic.Clients.Elasticsearch.Serializ /// /// Mean Reciprocal Rank /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// public readonly partial struct RankEvalMetricMeanReciprocalRankDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs index fdd2f1556d..17b06a7e66 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs @@ -84,7 +84,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Precision at K (P@k) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecisionConverter))] public sealed partial class RankEvalMetricPrecision @@ -131,7 +131,7 @@ internal RankEvalMetricPrecision(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// Precision at K (P@k) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// public readonly partial struct RankEvalMetricPrecisionDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs index 31682abc9b..4fb0493c98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Recall at K (R@k) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecallConverter))] public sealed partial class RankEvalMetricRecall @@ -115,7 +115,7 @@ internal RankEvalMetricRecall(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// Recall at K (R@k) /// -/// Learn more about this API in the Elasticsearch documentation. +/// Learn more about this API in the Elasticsearch documentation. /// public readonly partial struct RankEvalMetricRecallDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs index 9077d2fd99..23b13466d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs @@ -78,7 +78,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref Sys continue; } - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) { continue; } @@ -180,7 +180,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropExplain, value.Explain, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropFields, value.Fields, null, null); writer.WriteProperty(options, PropFrom, value.From, null, null); writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, null);