diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs index 419eabaed21..c38c9da73e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs @@ -92,7 +92,7 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy continue; } - if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o), static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) + if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs index 392f086505f..d17e5a45136 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/DeleteViewRequest.g.cs @@ -39,7 +39,7 @@ public sealed partial class DeleteViewRequestParameters : Elastic.Transport.Requ public sealed partial class DeleteViewRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DeleteViewRequest(Elastic.Clients.Elasticsearch.Id name) : base(r => r.Required("name", name)) + public DeleteViewRequest(Elastic.Clients.Elasticsearch.Ids name) : base(r => r.Required("name", name)) { } @@ -66,7 +66,7 @@ internal DeleteViewRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// The view name to remove. /// /// - public required Elastic.Clients.Elasticsearch.Id Name { get => P("name"); set => PR("name", value); } + public required Elastic.Clients.Elasticsearch.Ids Name { get => P("name"); set => PR("name", value); } } /// @@ -87,7 +87,7 @@ public DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Esql.DeleteView Instance = instance; } - public DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Id name) + public DeleteViewRequestDescriptor(Elastic.Clients.Elasticsearch.Ids name) { Instance = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequest(name); } @@ -106,7 +106,7 @@ public DeleteViewRequestDescriptor() /// The view name to remove. /// /// - public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor Name(Elastic.Clients.Elasticsearch.Id value) + public Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor Name(Elastic.Clients.Elasticsearch.Ids value) { Instance.Name = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs index deae9f1e95e..d81981fe15c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs @@ -76,7 +76,7 @@ public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref Sys continue; } - if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o), static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) + if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs index c8209bad08b..2e3f9c11110 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs @@ -26,11 +26,13 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; public sealed partial class GetDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"u8); + private static readonly System.Text.Json.JsonEncodedText PropGlobalRetention = System.Text.Json.JsonEncodedText.Encode("global_retention"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue> propDataStreams = default; + LocalJsonValue propGlobalRetention = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) @@ -38,6 +40,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRe continue; } + if (propGlobalRetention.TryReadProperty(ref reader, options, PropGlobalRetention, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -50,7 +57,8 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRe reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - DataStreams = propDataStreams.Value + DataStreams = propDataStreams.Value, + GlobalRetention = propGlobalRetention.Value }; } @@ -58,6 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGlobalRetention, value.GlobalRetention, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs index 4a89002864b..34f8629cade 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs @@ -38,4 +38,5 @@ internal GetDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.Js } public required System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } + public required Elastic.Clients.Elasticsearch.IndexManagement.GlobalRetention GlobalRetention { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs index 4c563244c30..01a957b8ce8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs @@ -135,6 +135,11 @@ public sealed partial class SplitIndexRequestParameters : Elastic.Transport.Requ /// /// /// +/// The number of primary shards in the target index must be a divisor of the source index's index.number_of_routing_shards. +/// +/// +/// +/// /// The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index. /// /// @@ -304,6 +309,11 @@ internal SplitIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// +/// The number of primary shards in the target index must be a divisor of the source index's index.number_of_routing_shards. +/// +/// +/// +/// /// The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index. /// /// @@ -672,6 +682,11 @@ public Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequestDescriptor /// /// /// +/// The number of primary shards in the target index must be a divisor of the source index's index.number_of_routing_shards. +/// +/// +/// +/// /// The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs index 2961135b9b9..e20d3c66cc4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Esql.g.cs @@ -230,7 +230,7 @@ public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView( return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Id name) + public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Ids name) { var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); var request = builder.Instance; @@ -238,7 +238,7 @@ public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView( return DoRequest(request); } - public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Id name, System.Action action) + public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView(Elastic.Clients.Elasticsearch.Ids name, System.Action action) { var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); action.Invoke(builder); @@ -253,7 +253,7 @@ public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView( return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Ids name, System.Threading.CancellationToken cancellationToken = default) { var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); var request = builder.Instance; @@ -261,7 +261,7 @@ public virtual Elastic.Clients.Elasticsearch.Esql.DeleteViewResponse DeleteView( return DoRequestAsync(request, cancellationToken); } - public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Id name, System.Action action, System.Threading.CancellationToken cancellationToken = default) + public virtual System.Threading.Tasks.Task DeleteViewAsync(Elastic.Clients.Elasticsearch.Ids name, System.Action action, System.Threading.CancellationToken cancellationToken = default) { var builder = new Elastic.Clients.Elasticsearch.Esql.DeleteViewRequestDescriptor(name); action.Invoke(builder); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs index 92565207b04..5cd098a172a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation Re continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs index d770cdf1ab3..52be613c577 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs @@ -56,7 +56,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation Re continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs index b5ebeab0c01..ea572015079 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Aggregations.Buckets Read var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + 1 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), + 2 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.Buckets)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs index b95f786b7c9..1ef413ca0db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs @@ -53,7 +53,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregatio continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs index 7adffc0d1ad..a505e441a6b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs @@ -42,7 +42,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggreg continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs index 8422bcece02..82a15f2b94d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs @@ -42,7 +42,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggr continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs index 8428ee1f1ee..7aa862c74d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyze var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs index 43a953c1fed..e967fecd0d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs @@ -51,7 +51,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs index 1e28c61f89c..f22dcf362bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs @@ -51,7 +51,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregat continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs index 39b255d2f65..f450c70b5d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath Read(re var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs index 2ff8cab04d2..394daa2f936 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs index ccf93422fb6..3fdfe228e06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs @@ -56,7 +56,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregatio continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs index c9a4dfa1f21..bfc5caf4c77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation Read(r continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs index 252c5059486..0c4284fcde2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs @@ -63,7 +63,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviati continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs index 51af25921f4..86eb1c9fcee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MinAggregation Read(r continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs index b420cb6396c..95763aea465 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs @@ -40,7 +40,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation Re continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs index 707c9aff1ce..74e7670ac76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read( object? variant = null; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs index c4ac1ecc7a5..460ef7a3cf7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs @@ -67,7 +67,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggreg continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs index 18fb1b74003..7730925a1c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs @@ -67,7 +67,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregatio continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs index 635b56b3fdb..815be63caca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs @@ -65,7 +65,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs index caaea11cb3c..52da9f8c20a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs @@ -53,7 +53,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.RateAggregation Read( continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs index c381abd400f..8cdc2de3b87 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs @@ -67,7 +67,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggrega continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs index 50bd6e50f7b..184646c7c8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation Read continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs index 97ffc491888..617220b1881 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregatio continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs index fd273c2ab97..fe44bd9dcaf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.SumAggregation Read(r continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs index 0015f0829d8..880de0397a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs @@ -100,7 +100,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation Read continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs index 7dfcb1bd7b7..7de5ee56417 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs @@ -93,7 +93,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation Re continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs index d1b48935476..555028fbdd9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs @@ -53,7 +53,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs index e93d08da0a5..dc02a421556 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs index bbd7ce430eb..f02d6e18422 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.ByteSize Read(ref System.Text.Json var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.ByteSize)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs index 59d0dca4e70..be287b62736 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs @@ -32,6 +32,7 @@ public sealed partial class CharFilterTypesConverter : System.Text.Json.Serializ private static readonly System.Text.Json.JsonEncodedText PropBuiltInTokenizers = System.Text.Json.JsonEncodedText.Encode("built_in_tokenizers"u8); private static readonly System.Text.Json.JsonEncodedText PropCharFilterTypes2 = System.Text.Json.JsonEncodedText.Encode("char_filter_types"u8); private static readonly System.Text.Json.JsonEncodedText PropFilterTypes = System.Text.Json.JsonEncodedText.Encode("filter_types"u8); + private static readonly System.Text.Json.JsonEncodedText PropMultipleSynonymGraphFilters = System.Text.Json.JsonEncodedText.Encode("multiple_synonym_graph_filters"u8); private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"u8); private static readonly System.Text.Json.JsonEncodedText PropTokenizerTypes = System.Text.Json.JsonEncodedText.Encode("tokenizer_types"u8); @@ -45,6 +46,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes Read(ref S LocalJsonValue> propBuiltInTokenizers = default; LocalJsonValue> propCharFilterTypes2 = default; LocalJsonValue> propFilterTypes = default; + LocalJsonValue propMultipleSynonymGraphFilters = default; LocalJsonValue> propSynonyms = default; LocalJsonValue> propTokenizerTypes = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -84,6 +86,11 @@ public override Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes Read(ref S continue; } + if (propMultipleSynonymGraphFilters.TryReadProperty(ref reader, options, PropMultipleSynonymGraphFilters, null)) + { + continue; + } + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) { continue; @@ -113,6 +120,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes Read(ref S BuiltInTokenizers = propBuiltInTokenizers.Value, CharFilterTypes2 = propCharFilterTypes2.Value, FilterTypes = propFilterTypes.Value, + MultipleSynonymGraphFilters = propMultipleSynonymGraphFilters.Value, Synonyms = propSynonyms.Value, TokenizerTypes = propTokenizerTypes.Value }; @@ -128,6 +136,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropBuiltInTokenizers, value.BuiltInTokenizers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropCharFilterTypes2, value.CharFilterTypes2, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropFilterTypes, value.FilterTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMultipleSynonymGraphFilters, value.MultipleSynonymGraphFilters, null, null); writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropTokenizerTypes, value.TokenizerTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs index 4c241e74f3a..707101e4875 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs @@ -98,6 +98,7 @@ internal CharFilterTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// public required System.Collections.Generic.IReadOnlyCollection FilterTypes { get; set; } + public Elastic.Clients.Elasticsearch.Cluster.MultipleSynonymGraphFilter? MultipleSynonymGraphFilters { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.Converters.g.cs new file mode 100644 index 00000000000..06e005a85c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class MultipleSynonymGraphFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzerCount = System.Text.Json.JsonEncodedText.Encode("analyzer_count"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"u8); + + public override Elastic.Clients.Elasticsearch.Cluster.MultipleSynonymGraphFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzerCount = default; + LocalJsonValue propIndexCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzerCount.TryReadProperty(ref reader, options, PropAnalyzerCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.MultipleSynonymGraphFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalyzerCount = propAnalyzerCount.Value, + IndexCount = propIndexCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.MultipleSynonymGraphFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzerCount, value.AnalyzerCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.g.cs new file mode 100644 index 00000000000..4d46183d19b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/MultipleSynonymGraphFilter.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.MultipleSynonymGraphFilterConverter))] +public sealed partial class MultipleSynonymGraphFilter +{ + public MultipleSynonymGraphFilter() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal MultipleSynonymGraphFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Number of analyzers across the cluster whose filter chain contains more than one synonym_graph filter. + /// + /// + public int? AnalyzerCount { get; set; } + + /// + /// + /// Number of indices that contain at least one analyzer with more than one synonym_graph filter. + /// + /// + public int? IndexCount { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs index d426428ec23..665b5e99792 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs @@ -27,11 +27,11 @@ public sealed partial class ContextConverter : System.Text.Json.Serialization.Js { public override Elastic.Clients.Elasticsearch.Core.Search.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T2(ref r, o)), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o)); + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.Context)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs index aaff2169b96..4d848fcea05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem JsonUnionSelector.ByPropertyOfT1(ref r, o, "found"); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue>(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue>(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs index 8c3e92c4c08..d194c359d69 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs @@ -46,8 +46,8 @@ public override Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseIt var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "took"); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue>(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue>(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.Converters.g.cs new file mode 100644 index 00000000000..d094a8aff93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; + +public sealed partial class ParentReindexStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"u8); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"u8); + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"u8); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"u8); + private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"u8); + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"u8); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"u8); + private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropSlices = System.Text.Json.JsonEncodedText.Encode("slices"u8); + private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"u8); + private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"u8); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"u8); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"u8); + private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"u8); + + public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatches = default; + LocalJsonValue propCancelled = default; + LocalJsonValue propCreated = default; + LocalJsonValue propDeleted = default; + LocalJsonValue propNoops = default; + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propRetries = default; + LocalJsonValue propSliceId = default; + LocalJsonValue?> propSlices = default; + LocalJsonValue propThrottled = default; + LocalJsonValue propThrottledMillis = default; + LocalJsonValue propThrottledUntil = default; + LocalJsonValue propThrottledUntilMillis = default; + LocalJsonValue propTotal = default; + LocalJsonValue propUpdated = default; + LocalJsonValue propVersionConflicts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBatches.TryReadProperty(ref reader, options, PropBatches, null)) + { + continue; + } + + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, null)) + { + continue; + } + + if (propCreated.TryReadProperty(ref reader, options, PropCreated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, null)) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, null)) + { + continue; + } + + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, null)) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSlices.TryReadProperty(ref reader, options, PropSlices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) + { + continue; + } + + if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) + { + continue; + } + + if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Batches = propBatches.Value, + Cancelled = propCancelled.Value, + Created = propCreated.Value, + Deleted = propDeleted.Value, + Noops = propNoops.Value, + RequestsPerSecond = propRequestsPerSecond.Value, + Retries = propRetries.Value, + SliceId = propSliceId.Value, + Slices = propSlices.Value, + Throttled = propThrottled.Value, + ThrottledMillis = propThrottledMillis.Value, + ThrottledUntil = propThrottledUntil.Value, + ThrottledUntilMillis = propThrottledUntilMillis.Value, + Total = propTotal.Value, + Updated = propUpdated.Value, + VersionConflicts = propVersionConflicts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBatches, value.Batches, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, null); + writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); + writer.WriteProperty(options, PropNoops, value.Noops, null, null); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, null); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlices, value.Slices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); + writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); + writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.g.cs new file mode 100644 index 00000000000..c5d0f466408 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexStatus.g.cs @@ -0,0 +1,147 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ParentReindexStatusConverter))] +public sealed partial class ParentReindexStatus +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ParentReindexStatus(long batches, long deleted, long noops, float requestsPerSecond, Elastic.Clients.Elasticsearch.Retries retries, System.TimeSpan throttledMillis, System.TimeSpan throttledUntilMillis, long total, long versionConflicts) + { + Batches = batches; + Deleted = deleted; + Noops = noops; + RequestsPerSecond = requestsPerSecond; + Retries = retries; + ThrottledMillis = throttledMillis; + ThrottledUntilMillis = throttledUntilMillis; + Total = total; + VersionConflicts = versionConflicts; + } + + public ParentReindexStatus() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ParentReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The number of scroll responses pulled back by the reindex. + /// + /// + public required long Batches { get; set; } + + /// + /// + /// The reason for cancellation if the slice was canceled + /// + /// + public string? Cancelled { get; set; } + + /// + /// + /// The number of documents that were successfully created. + /// + /// + public long? Created { get; set; } + + /// + /// + /// The number of documents that were successfully deleted. + /// + /// + public required long Deleted { get; set; } + + /// + /// + /// The number of documents that were ignored because the script used for the reindex returned a noop value for ctx.op. + /// + /// + public required long Noops { get; set; } + + /// + /// + /// The number of requests per second effectively executed during the reindex. + /// + /// + public required float RequestsPerSecond { get; set; } + + /// + /// + /// The number of retries attempted by reindex. bulk is the number of bulk actions retried and search is the number of search actions retried. + /// + /// + public required Elastic.Clients.Elasticsearch.Retries Retries { get; set; } + + /// + /// + /// The slice ID + /// + /// + public int? SliceId { get; set; } + public System.Collections.Generic.IReadOnlyCollection? Slices { get; set; } + public Elastic.Clients.Elasticsearch.Duration? Throttled { get; set; } + + /// + /// + /// Number of milliseconds the request slept to conform to requests_per_second. + /// + /// + public required System.TimeSpan ThrottledMillis { get; set; } + public Elastic.Clients.Elasticsearch.Duration? ThrottledUntil { get; set; } + + /// + /// + /// This field should always be equal to zero in a _reindex response. + /// It only has meaning when using the Task API, where it indicates the next time (in milliseconds since epoch) a throttled request will be executed again in order to conform to requests_per_second. + /// + /// + public required System.TimeSpan ThrottledUntilMillis { get; set; } + + /// + /// + /// The number of documents that were successfully processed. + /// + /// + public required long Total { get; set; } + + /// + /// + /// The number of documents that were successfully updated, for example, a document with same ID already existed prior to reindex updating it. + /// + /// + public long? Updated { get; set; } + + /// + /// + /// The number of version conflicts that reindex hits. + /// + /// + public required long VersionConflicts { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs index 7bb2075d274..a943b267c0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.Converters.g.cs @@ -51,7 +51,7 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReind LocalJsonValue propNode = default; LocalJsonValue propRunningTimeInNanos = default; LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; + LocalJsonValue propStatus = default; LocalJsonValue propType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs index f7c02b72937..268a97e6a12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ParentReindexTask.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; public sealed partial class ParentReindexTask { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ParentReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.ReindexStatus status, string type) + public ParentReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus status, string type) { Action = action; Cancellable = cancellable; @@ -62,6 +62,6 @@ internal ParentReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConst public required string Node { get; set; } public required System.TimeSpan RunningTimeInNanos { get; set; } public required System.DateTimeOffset StartTimeInMillis { get; set; } - public required Elastic.Clients.Elasticsearch.ReindexStatus Status { get; set; } + public required Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus Status { get; set; } public required string Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs index a493a667681..c68186afd82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask LocalJsonValue propNode = default; LocalJsonValue propRunningTimeInNanos = default; LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; + LocalJsonValue propStatus = default; LocalJsonValue propType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs index d4dc00286e8..f47cb15e196 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; public sealed partial class ReindexTask { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.ReindexStatus status, string type) + public ReindexTask(string action, bool cancellable, bool cancelled, string description, System.Collections.Generic.IReadOnlyDictionary> headers, long id, string node, System.TimeSpan runningTimeInNanos, System.DateTimeOffset startTimeInMillis, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus status, string type) { Action = action; Cancellable = cancellable; @@ -61,6 +61,6 @@ internal ReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor public required string Node { get; set; } public required System.TimeSpan RunningTimeInNanos { get; set; } public required System.DateTimeOffset StartTimeInMillis { get; set; } - public required Elastic.Clients.Elasticsearch.ReindexStatus Status { get; set; } + public required Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ParentReindexStatus Status { get; set; } public required string Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs index d25ab178f10..77745306087 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs @@ -28,6 +28,7 @@ public sealed partial class InnerHitsConverter : System.Text.Json.Serialization. private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse"u8); private static readonly System.Text.Json.JsonEncodedText PropDocvalueFields = System.Text.Json.JsonEncodedText.Encode("docvalue_fields"u8); private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"u8); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"u8); private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"u8); private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"u8); private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"u8); @@ -48,7 +49,8 @@ public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref Sys LocalJsonValue propCollapse = default; LocalJsonValue?> propDocvalueFields = default; LocalJsonValue propExplain = default; - LocalJsonValue propFields = default; + LocalJsonValue propField = default; + LocalJsonValue?> propFields = default; LocalJsonValue propFrom = default; LocalJsonValue propHighlight = default; LocalJsonValue propIgnoreUnmapped = default; @@ -78,7 +80,12 @@ public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref Sys continue; } - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; } @@ -158,6 +165,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref Sys Collapse = propCollapse.Value, DocvalueFields = propDocvalueFields.Value, Explain = propExplain.Value, + Field = propField.Value, Fields = propFields.Value, From = propFrom.Value, Highlight = propHighlight.Value, @@ -180,7 +188,8 @@ 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, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFields, value.Fields, 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, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); 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 fe9f39fafc2..251d9a93fad 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 @@ -39,7 +39,8 @@ internal InnerHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; } public System.Collections.Generic.ICollection? DocvalueFields { get; set; } public bool? Explain { get; set; } - public Elastic.Clients.Elasticsearch.Fields? Fields { get; set; } + public Elastic.Clients.Elasticsearch.Fields? Field { get; set; } + public System.Collections.Generic.ICollection? Fields { get; set; } /// /// @@ -141,18 +142,42 @@ public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor return this; } - public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? value) + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Field(Elastic.Clients.Elasticsearch.Fields? value) { - Instance.Fields = value; + Instance.Field = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Field(params System.Linq.Expressions.Expression>[] value) + { + Instance.Field = value; return this; } - public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params System.Linq.Expressions.Expression>[] value) + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(System.Collections.Generic.ICollection? value) { Instance.Fields = value; return this; } + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat[] values) + { + Instance.Fields = [.. values]; + return this; + } + + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor.Build(action)); + } + + Instance.Fields = items; + return this; + } + /// /// /// Inner hit starting document offset. @@ -428,18 +453,54 @@ public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Explain(boo return this; } - public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? value) + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Field(Elastic.Clients.Elasticsearch.Fields? value) { - Instance.Fields = value; + Instance.Field = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Field(params System.Linq.Expressions.Expression>[] value) + { + Instance.Field = value; return this; } - public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params System.Linq.Expressions.Expression>[] value) + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(System.Collections.Generic.ICollection? value) { Instance.Fields = value; return this; } + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat[] values) + { + Instance.Fields = [.. values]; + return this; + } + + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params System.Action[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor.Build(action)); + } + + Instance.Fields = items; + return this; + } + + public Elastic.Clients.Elasticsearch.Core.Search.InnerHitsDescriptor Fields(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor.Build(action)); + } + + Instance.Fields = items; + return this; + } + /// /// /// Inner hit starting document offset. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs index 9cdc6070884..649ce1dc319 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfig Read(ref var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs index 1f1cfe82217..f4881e291b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam Read var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, 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)))), + 1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, 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)))), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs index b8b52b961a7..b80a9fe83b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Core.Search.TrackHits Read(ref Sys var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TrackHits)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.Converters.g.cs new file mode 100644 index 00000000000..984cd7ebd44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class EmbeddingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"u8); + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"u8); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"u8); + + public override Elastic.Clients.Elasticsearch.Embedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInferenceId = default; + LocalJsonValue>> propInput = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propInput.TryReadProperty(ref reader, options, PropInput, static Elastic.Clients.Elasticsearch.Union> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Embedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InferenceId = propInferenceId.Value, + Input = propInput.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Embedding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union> v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.g.cs new file mode 100644 index 00000000000..62f2e646668 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Embedding.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.EmbeddingConverter))] +public sealed partial class Embedding +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Embedding(Elastic.Clients.Elasticsearch.Union> input) + { + Input = input; + } + + public Embedding() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Embedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string? InferenceId { get; set; } + public required Elastic.Clients.Elasticsearch.Union> Input { get; set; } + public Elastic.Clients.Elasticsearch.Duration? Timeout { get; set; } +} + +public readonly partial struct EmbeddingDescriptor +{ + internal Elastic.Clients.Elasticsearch.Embedding Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingDescriptor(Elastic.Clients.Elasticsearch.Embedding instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EmbeddingDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Embedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.EmbeddingDescriptor(Elastic.Clients.Elasticsearch.Embedding instance) => new Elastic.Clients.Elasticsearch.EmbeddingDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Embedding(Elastic.Clients.Elasticsearch.EmbeddingDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.EmbeddingDescriptor InferenceId(string? value) + { + Instance.InferenceId = value; + return this; + } + + public Elastic.Clients.Elasticsearch.EmbeddingDescriptor Input(Elastic.Clients.Elasticsearch.Union> value) + { + Instance.Input = value; + return this; + } + + public Elastic.Clients.Elasticsearch.EmbeddingDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.Timeout = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Embedding Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.EmbeddingDescriptor(new Elastic.Clients.Elasticsearch.Embedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs index 9030f3f6f66..04c4eaa41ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs @@ -66,7 +66,7 @@ public override Elastic.Clients.Elasticsearch.FieldSort Read(ref System.Text.Jso continue; } - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3))), null, null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs index 85ff8171d96..97b8f9ca735 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Fuzziness Read(ref System.Text.Jso var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Fuzziness)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs index 2482a1aa6ca..e8c5d8c4903 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.GeohashPrecision Read(ref System.T var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.GeohashPrecision)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs index e3d8fd2f3fa..2e45214d22a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs @@ -28,8 +28,10 @@ public sealed partial class DataStreamLifecycleConverter : System.Text.Json.Seri private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsamplingMethod = System.Text.Json.JsonEncodedText.Encode("downsampling_method"u8); + private static readonly System.Text.Json.JsonEncodedText PropEffectiveRetention = System.Text.Json.JsonEncodedText.Encode("effective_retention"u8); private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); private static readonly System.Text.Json.JsonEncodedText PropFrozenAfter = System.Text.Json.JsonEncodedText.Encode("frozen_after"u8); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeterminedBy = System.Text.Json.JsonEncodedText.Encode("retention_determined_by"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -37,8 +39,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl LocalJsonValue propDataRetention = default; LocalJsonValue?> propDownsampling = default; LocalJsonValue propDownsamplingMethod = default; + LocalJsonValue propEffectiveRetention = default; LocalJsonValue propEnabled = default; LocalJsonValue propFrozenAfter = default; + LocalJsonValue propRetentionDeterminedBy = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) @@ -56,6 +60,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propEffectiveRetention.TryReadProperty(ref reader, options, PropEffectiveRetention, null)) + { + continue; + } + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -66,6 +75,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propRetentionDeterminedBy.TryReadProperty(ref reader, options, PropRetentionDeterminedBy, static Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -81,8 +95,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl DataRetention = propDataRetention.Value, Downsampling = propDownsampling.Value, DownsamplingMethod = propDownsamplingMethod.Value, + EffectiveRetention = propEffectiveRetention.Value, Enabled = propEnabled.Value, - FrozenAfter = propFrozenAfter.Value + FrozenAfter = propFrozenAfter.Value, + RetentionDeterminedBy = propRetentionDeterminedBy.Value }; } @@ -92,8 +108,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); writer.WriteProperty(options, PropDownsampling, value.Downsampling, 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, PropDownsamplingMethod, value.DownsamplingMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEffectiveRetention, value.EffectiveRetention, null, null); writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropFrozenAfter, value.FrozenAfter, null, null); + writer.WriteProperty(options, PropRetentionDeterminedBy, value.RetentionDeterminedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs index 37943965ac9..717c20bdffe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -65,6 +65,13 @@ internal DataStreamLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// public Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? DownsamplingMethod { get; set; } + /// + /// + /// The least amount of time data should be kept by elasticsearch. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? EffectiveRetention { get; set; } + /// /// /// If defined, it turns data stream lifecycle on/off (true/false) for this data stream. A data stream lifecycle @@ -79,6 +86,13 @@ internal DataStreamLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// public Elastic.Clients.Elasticsearch.Duration? FrozenAfter { get; set; } + + /// + /// + /// Configuration source that can influence the retention of a data stream. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? RetentionDeterminedBy { get; set; } } /// @@ -169,6 +183,17 @@ public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescript return this; } + /// + /// + /// The least amount of time data should be kept by elasticsearch. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor EffectiveRetention(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.EffectiveRetention = value; + return this; + } + /// /// /// If defined, it turns data stream lifecycle on/off (true/false) for this data stream. A data stream lifecycle @@ -192,6 +217,17 @@ public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescript return this; } + /// + /// + /// Configuration source that can influence the retention of a data stream. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor RetentionDeterminedBy(Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? value) + { + Instance.RetentionDeterminedBy = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs index 09d897af0db..001d801d821 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs @@ -28,8 +28,10 @@ public sealed partial class DataStreamLifecycleWithRolloverConverter : System.Te private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsamplingMethod = System.Text.Json.JsonEncodedText.Encode("downsampling_method"u8); + private static readonly System.Text.Json.JsonEncodedText PropEffectiveRetention = System.Text.Json.JsonEncodedText.Encode("effective_retention"u8); private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); private static readonly System.Text.Json.JsonEncodedText PropFrozenAfter = System.Text.Json.JsonEncodedText.Encode("frozen_after"u8); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeterminedBy = System.Text.Json.JsonEncodedText.Encode("retention_determined_by"u8); private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -38,8 +40,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl LocalJsonValue propDataRetention = default; LocalJsonValue?> propDownsampling = default; LocalJsonValue propDownsamplingMethod = default; + LocalJsonValue propEffectiveRetention = default; LocalJsonValue propEnabled = default; LocalJsonValue propFrozenAfter = default; + LocalJsonValue propRetentionDeterminedBy = default; LocalJsonValue propRollover = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -58,6 +62,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propEffectiveRetention.TryReadProperty(ref reader, options, PropEffectiveRetention, null)) + { + continue; + } + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -68,6 +77,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propRetentionDeterminedBy.TryReadProperty(ref reader, options, PropRetentionDeterminedBy, static Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) { continue; @@ -88,8 +102,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl DataRetention = propDataRetention.Value, Downsampling = propDownsampling.Value, DownsamplingMethod = propDownsamplingMethod.Value, + EffectiveRetention = propEffectiveRetention.Value, Enabled = propEnabled.Value, FrozenAfter = propFrozenAfter.Value, + RetentionDeterminedBy = propRetentionDeterminedBy.Value, Rollover = propRollover.Value }; } @@ -100,8 +116,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropDownsamplingMethod, value.DownsamplingMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEffectiveRetention, value.EffectiveRetention, null, null); writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropFrozenAfter, value.FrozenAfter, null, null); + writer.WriteProperty(options, PropRetentionDeterminedBy, value.RetentionDeterminedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRollover, value.Rollover, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs index 28780587e17..72db687a42e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs @@ -66,6 +66,13 @@ internal DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serializa /// public Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? DownsamplingMethod { get; set; } + /// + /// + /// The least amount of time data should be kept by elasticsearch. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? EffectiveRetention { get; set; } + /// /// /// If defined, it turns data stream lifecycle on/off (true/false) for this data stream. A data stream lifecycle @@ -81,6 +88,13 @@ internal DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serializa /// public Elastic.Clients.Elasticsearch.Duration? FrozenAfter { get; set; } + /// + /// + /// Configuration source that can influence the retention of a data stream. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource? RetentionDeterminedBy { get; set; } + /// /// /// The conditions which will trigger the rollover of a backing index as configured by the cluster setting cluster.lifecycle.default.rollover. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.Converters.g.cs new file mode 100644 index 00000000000..062f5d52a14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GlobalRetentionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultRetention = System.Text.Json.JsonEncodedText.Encode("default_retention"u8); + private static readonly System.Text.Json.JsonEncodedText PropMaxRetention = System.Text.Json.JsonEncodedText.Encode("max_retention"u8); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GlobalRetention Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaultRetention = default; + LocalJsonValue propMaxRetention = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultRetention.TryReadProperty(ref reader, options, PropDefaultRetention, null)) + { + continue; + } + + if (propMaxRetention.TryReadProperty(ref reader, options, PropMaxRetention, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GlobalRetention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultRetention = propDefaultRetention.Value, + MaxRetention = propMaxRetention.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GlobalRetention value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultRetention, value.DefaultRetention, null, null); + writer.WriteProperty(options, PropMaxRetention, value.MaxRetention, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.g.cs new file mode 100644 index 00000000000..e9f0fcaa181 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/GlobalRetention.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GlobalRetentionConverter))] +public sealed partial class GlobalRetention +{ + public GlobalRetention() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GlobalRetention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Duration? DefaultRetention { get; set; } + public Elastic.Clients.Elasticsearch.Duration? MaxRetention { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.Converters.g.cs new file mode 100644 index 00000000000..444bcf089bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RetentionSourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDataStreamConfiguration = System.Text.Json.JsonEncodedText.Encode("data_stream_configuration"u8); + private static readonly System.Text.Json.JsonEncodedText MemberDefaultFailuresRetention = System.Text.Json.JsonEncodedText.Encode("default_failures_retention"u8); + private static readonly System.Text.Json.JsonEncodedText MemberDefaultGlobalRetention = System.Text.Json.JsonEncodedText.Encode("default_global_retention"u8); + private static readonly System.Text.Json.JsonEncodedText MemberMaxGlobalRetention = System.Text.Json.JsonEncodedText.Encode("max_global_retention"u8); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDataStreamConfiguration)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DataStreamConfiguration; + } + + if (reader.ValueTextEquals(MemberDefaultFailuresRetention)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultFailuresRetention; + } + + if (reader.ValueTextEquals(MemberDefaultGlobalRetention)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultGlobalRetention; + } + + if (reader.ValueTextEquals(MemberMaxGlobalRetention)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.MaxGlobalRetention; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDataStreamConfiguration.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DataStreamConfiguration; + } + + if (string.Equals(value, MemberDefaultFailuresRetention.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultFailuresRetention; + } + + if (string.Equals(value, MemberDefaultGlobalRetention.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultGlobalRetention; + } + + if (string.Equals(value, MemberMaxGlobalRetention.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.MaxGlobalRetention; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DataStreamConfiguration: + writer.WriteStringValue(MemberDataStreamConfiguration); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultFailuresRetention: + writer.WriteStringValue(MemberDefaultFailuresRetention); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.DefaultGlobalRetention: + writer.WriteStringValue(MemberDefaultGlobalRetention); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource.MaxGlobalRetention: + writer.WriteStringValue(MemberMaxGlobalRetention); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RetentionSource value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.g.cs new file mode 100644 index 00000000000..4f51d4bd17c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionSource.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RetentionSourceConverter))] +public enum RetentionSource +{ + [System.Runtime.Serialization.EnumMember(Value = "data_stream_configuration")] + DataStreamConfiguration, + [System.Runtime.Serialization.EnumMember(Value = "default_failures_retention")] + DefaultFailuresRetention, + [System.Runtime.Serialization.EnumMember(Value = "default_global_retention")] + DefaultGlobalRetention, + [System.Runtime.Serialization.EnumMember(Value = "max_global_retention")] + MaxGlobalRetention +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs index b6350613b84..b67e23e283a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs @@ -33,7 +33,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Read( LocalJsonValue?> propParameters = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propParameters.TryReadProperty(ref reader, options, PropParameters, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + if (propParameters.TryReadProperty(ref reader, options, PropParameters, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 5), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 4)))), null, null, null, null, null)))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs index a393296d43f..5b5dfaf764b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestEmbedding.Converters.g.cs @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Inference.RequestEmbedding Read(re LocalJsonValue propTaskSettings = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propInput.TryReadProperty(ref reader, options, PropInput, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.ICollection>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o)), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o)), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T2(ref r, o)), static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + if (propInput.TryReadProperty(ref reader, options, PropInput, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.ICollection>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.Converters.g.cs new file mode 100644 index 00000000000..bdaabd4f947 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class InferenceStringConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"u8); + + public override Elastic.Clients.Elasticsearch.InferenceString Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propType = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.InferenceString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Type = propType.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InferenceString value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.g.cs new file mode 100644 index 00000000000..004a1d2acd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InferenceString.g.cs @@ -0,0 +1,66 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// 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. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.InferenceStringConverter))] +public sealed partial class InferenceString +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public InferenceString(Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType type, string value) + { + Type = type; + Value = value; + } + + public InferenceString() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal InferenceString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The format of the data. If null, the default data format for the given type is used. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EmbeddingContentFormat? Format { get; set; } + + /// + /// + /// The type of data that the value represents. + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.EmbeddingContentType Type { get; set; } + + /// + /// + /// String which may be raw text, or the string representation of some other data such as an image in base64. + /// + /// + public required string Value { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs index c483bb813cb..7e4ced9db6d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnal var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs index 567ee29504b..bcac76c3e72 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; public sealed partial class TrainedModelDeploymentNodesStatsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceProcessMemoryRssBytes = System.Text.Json.JsonEncodedText.Encode("average_inference_process_memory_rss_bytes"u8); private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMs = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms"u8); private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsExcludingCacheHits = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_excluding_cache_hits"u8); private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsLastMinute = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_last_minute"u8); @@ -47,6 +48,7 @@ public sealed partial class TrainedModelDeploymentNodesStatsConverter : System.T public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAverageInferenceProcessMemoryRssBytes = default; LocalJsonValue propAverageInferenceTimeMs = default; LocalJsonValue propAverageInferenceTimeMsExcludingCacheHits = default; LocalJsonValue propAverageInferenceTimeMsLastMinute = default; @@ -67,6 +69,11 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploy LocalJsonValue propTimeoutCount = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propAverageInferenceProcessMemoryRssBytes.TryReadProperty(ref reader, options, PropAverageInferenceProcessMemoryRssBytes, null)) + { + continue; + } + if (propAverageInferenceTimeMs.TryReadProperty(ref reader, options, PropAverageInferenceTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) { continue; @@ -169,6 +176,7 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploy reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + AverageInferenceProcessMemoryRssBytes = propAverageInferenceProcessMemoryRssBytes.Value, AverageInferenceTimeMs = propAverageInferenceTimeMs.Value, AverageInferenceTimeMsExcludingCacheHits = propAverageInferenceTimeMsExcludingCacheHits.Value, AverageInferenceTimeMsLastMinute = propAverageInferenceTimeMsLastMinute.Value, @@ -193,6 +201,7 @@ public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploy public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropAverageInferenceProcessMemoryRssBytes, value.AverageInferenceProcessMemoryRssBytes, null, null); writer.WriteProperty(options, PropAverageInferenceTimeMs, value.AverageInferenceTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteProperty(options, PropAverageInferenceTimeMsExcludingCacheHits, value.AverageInferenceTimeMsExcludingCacheHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteProperty(options, PropAverageInferenceTimeMsLastMinute, value.AverageInferenceTimeMsLastMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs index c2387c4b9c1..be9e5f37568 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs @@ -44,6 +44,8 @@ internal TrainedModelDeploymentNodesStats(Elastic.Clients.Elasticsearch.Serializ _ = sentinel; } + public Elastic.Clients.Elasticsearch.ByteSize? AverageInferenceProcessMemoryRssBytes { get; set; } + /// /// /// The average time for each inference call to complete on this node. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs index a17e3b55eaa..5b3dae894c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs @@ -27,6 +27,7 @@ public sealed partial class DenseVectorIndexOptionsConverter : System.Text.Json. { private static readonly System.Text.Json.JsonEncodedText PropConfidenceInterval = System.Text.Json.JsonEncodedText.Encode("confidence_interval"u8); private static readonly System.Text.Json.JsonEncodedText PropEfConstruction = System.Text.Json.JsonEncodedText.Encode("ef_construction"u8); + private static readonly System.Text.Json.JsonEncodedText PropFlatIndexThreshold = System.Text.Json.JsonEncodedText.Encode("flat_index_threshold"u8); private static readonly System.Text.Json.JsonEncodedText PropM = System.Text.Json.JsonEncodedText.Encode("m"u8); private static readonly System.Text.Json.JsonEncodedText PropOnDiskRescore = System.Text.Json.JsonEncodedText.Encode("on_disk_rescore"u8); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"u8); @@ -37,6 +38,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propConfidenceInterval = default; LocalJsonValue propEfConstruction = default; + LocalJsonValue propFlatIndexThreshold = default; LocalJsonValue propM = default; LocalJsonValue propOnDiskRescore = default; LocalJsonValue propRescoreVector = default; @@ -53,6 +55,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re continue; } + if (propFlatIndexThreshold.TryReadProperty(ref reader, options, PropFlatIndexThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propM.TryReadProperty(ref reader, options, PropM, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -87,6 +94,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re { ConfidenceInterval = propConfidenceInterval.Value, EfConstruction = propEfConstruction.Value, + FlatIndexThreshold = propFlatIndexThreshold.Value, M = propM.Value, OnDiskRescore = propOnDiskRescore.Value, RescoreVector = propRescoreVector.Value, @@ -99,6 +107,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropConfidenceInterval, value.ConfidenceInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropEfConstruction, value.EfConstruction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFlatIndexThreshold, value.FlatIndexThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropM, value.M, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropOnDiskRescore, value.OnDiskRescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 71277f9d99d..84976034f6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -72,6 +72,18 @@ internal DenseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.Jso /// public int? EfConstruction { get; set; } + /// + /// + /// The segment document count threshold below which HNSW graph construction is skipped in favor of brute-force flat + /// search. -1 (default) defers to format defaults: 300 for bbq_hnsw, 150 for hnsw, int8_hnsw, and + /// int4_hnsw. 0 always builds the graph. A positive value overrides the format default. + /// + /// + /// Only applicable to hnsw, int8_hnsw, int4_hnsw, and bbq_hnsw index types. + /// + /// + public int? FlatIndexThreshold { get; set; } + /// /// /// The number of neighbors each node will be connected to in the HNSW graph. @@ -164,6 +176,22 @@ public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor E return this; } + /// + /// + /// The segment document count threshold below which HNSW graph construction is skipped in favor of brute-force flat + /// search. -1 (default) defers to format defaults: 300 for bbq_hnsw, 150 for hnsw, int8_hnsw, and + /// int4_hnsw. 0 always builds the graph. A positive value overrides the format default. + /// + /// + /// Only applicable to hnsw, int8_hnsw, int4_hnsw, and bbq_hnsw index types. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor FlatIndexThreshold(int? value) + { + Instance.FlatIndexThreshold = value; + return this; + } + /// /// /// The number of neighbors each node will be connected to in the HNSW graph. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs index 8c9a1fc4660..1f15cc77316 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Percentage Read(ref System.Text.Js var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Percentage)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs index cdea0310b98..6ce3c92e626 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery Read(ref Syste reader.Read(); if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) { - var value = reader.ReadValue(options, null); + var value = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null)); reader.Read(); return new Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { @@ -98,7 +98,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery Read(ref Syste continue; } - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + if (propValue.TryReadProperty(ref reader, options, PropValue, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs index 424a4114ad0..d585b53bee1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.Like Read(ref System.Text var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Like)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs index fee94c3f8e2..a3ae2486073 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs @@ -50,7 +50,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery Read(ref Syste reader.Read(); if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) { - var value = reader.ReadValue(options, null); + var value = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null)); reader.Read(); return new Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { @@ -137,7 +137,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery Read(ref Syste continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2), static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs index b3278ed18c1..639337500ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Read(ref var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + 2 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs index 806a6c25779..974c565ba5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Json; public sealed partial class QueryVectorBuilderConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText VariantEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); private static readonly System.Text.Json.JsonEncodedText VariantLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); @@ -35,6 +36,14 @@ public override Elastic.Clients.Elasticsearch.QueryVectorBuilder Read(ref System object? variant = null; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (reader.ValueTextEquals(VariantEmbedding)) + { + variantType = VariantEmbedding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + if (reader.ValueTextEquals(VariantLookup)) { variantType = VariantLookup.Value; @@ -75,6 +84,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { case null: break; + case "embedding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Embedding)value.Variant, null, null); + break; case "lookup": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder)value.Variant, null, null); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs index d6254f1ab2a..0ccb54481d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs @@ -39,6 +39,8 @@ internal QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + public Elastic.Clients.Elasticsearch.Embedding? Embedding { get => GetVariant("embedding"); set => SetVariant("embedding", value); } + /// /// /// Lookup a vector from an existing document. @@ -48,6 +50,7 @@ internal QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonCons public Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder? Lookup { get => GetVariant("lookup"); set => SetVariant("lookup", value); } public Elastic.Clients.Elasticsearch.TextEmbedding? TextEmbedding { get => GetVariant("text_embedding"); set => SetVariant("text_embedding", value); } + public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.Embedding value) => new Elastic.Clients.Elasticsearch.QueryVectorBuilder { Embedding = value }; public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.LookupQueryVectorBuilder value) => new Elastic.Clients.Elasticsearch.QueryVectorBuilder { Lookup = value }; public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.TextEmbedding value) => new Elastic.Clients.Elasticsearch.QueryVectorBuilder { TextEmbedding = value }; @@ -89,6 +92,18 @@ public QueryVectorBuilderDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(Elastic.Clients.Elasticsearch.QueryVectorBuilder instance) => new Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor descriptor) => descriptor.Instance; + public Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor Embedding(Elastic.Clients.Elasticsearch.Embedding? value) + { + Instance.Embedding = value; + return this; + } + + public Elastic.Clients.Elasticsearch.QueryVectorBuilderDescriptor Embedding(System.Action action) + { + Instance.Embedding = Elastic.Clients.Elasticsearch.EmbeddingDescriptor.Build(action); + return this; + } + /// /// /// Lookup a vector from an existing document. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs index 33c3c24d5de..c8c22761f12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs @@ -61,7 +61,7 @@ public override Elastic.Clients.Elasticsearch.Security.IndicesPrivileges Read(re continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } @@ -93,7 +93,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); writer.WriteProperty(options, PropPrivileges, value.Privileges, 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, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs index 45303d3e880..dac399432d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs @@ -61,7 +61,7 @@ public override Elastic.Clients.Elasticsearch.Security.IndicesPrivilegesBase Rea continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs index 011e243f4d8..d42ad5def56 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs @@ -68,7 +68,7 @@ public override Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges R continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } @@ -102,7 +102,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); writer.WriteProperty(options, PropPrivileges, value.Privileges, 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, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs index fe730126ecf..c4922ed27ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs @@ -40,7 +40,7 @@ public override Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileg LocalJsonValue?> propFieldSecurity = default; LocalJsonValue> propNames = default; LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; + LocalJsonValue?> propQuery = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) @@ -68,7 +68,7 @@ public override Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileg continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null)))) { continue; } @@ -102,7 +102,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs index b0f432e8cf3..9bd2dd294bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs @@ -79,5 +79,5 @@ internal RemoteUserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization /// Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role. /// /// - public object? Query { get; set; } + public System.Collections.Generic.IReadOnlyCollection? Query { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs index 97f34a219ac..7e43185b608 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs @@ -54,7 +54,7 @@ public override Elastic.Clients.Elasticsearch.Security.SearchAccess Read(ref Sys continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null))) { continue; } @@ -84,7 +84,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQuery, value.Query, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs index e59ca17b7bc..1743394c6e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs @@ -38,7 +38,7 @@ public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges Rea LocalJsonValue?> propFieldSecurity = default; LocalJsonValue> propNames = default; LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; + LocalJsonValue?> propQuery = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) @@ -61,7 +61,7 @@ public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges Rea continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null)))) { continue; } @@ -93,7 +93,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs index 469593e0d38..7e8077ed5e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs @@ -77,5 +77,5 @@ internal UserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonC /// Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role. /// /// - public object? Query { get; set; } + public System.Collections.Generic.IReadOnlyCollection? Query { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs index 4335ca7407f..c0d4044c507 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs @@ -61,7 +61,7 @@ public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivilegesBase continue; } - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options) => reader.ReadUnionValue(options, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.MatchTokenTypes(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 1), static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.Match(ref r, o, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 2, static (ref System.Text.Json.Utf8JsonReader _reader, System.Text.Json.JsonSerializerOptions _options) => 3)), null, null, null)))) { continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs index 79de16bbae3..4c170a72af1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Slices Read(ref System.Text.Json.U var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), + 1 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), + 2 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Slices)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs index 67c8ea40ee1..be91e6e6ace 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs @@ -30,8 +30,8 @@ public override Elastic.Clients.Elasticsearch.Tasks.TaskInfos Read(ref System.Te var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); return selector(ref reader, options) switch { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), + 1 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + 2 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Tasks.TaskInfos)}") }; } diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonReaderExtensions.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonReaderExtensions.cs index cd34dae2c9a..38c7e11a9dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonReaderExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonReaderExtensions.cs @@ -475,12 +475,153 @@ public static KeyValuePair ReadKeyValuePairValue(thi return selector(ref reader, options) switch { - UnionTag.T1 => (readType1 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), - UnionTag.T2 => (readType2 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 1 => (readType1 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 2 => (readType2 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), _ => throw new InvalidOperationException($"Failed to select an union variant for union of type '{typeof(T1).Name}' or '{typeof(T2).Name}'.") }; } + /// + /// Reads an inline union value from a given instance. + /// + /// The first union type. + /// The second union type. + /// The third union type. + /// A reference to the . + /// The to use. + /// A function that selects the union variant (e.g. based on the current JSON token type). + /// + /// The delegate that should be called to read the first union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the second union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the third union variant type, or + /// to use the default converter for the type . + /// + /// A boxed value of the selected union variant. + /// If no matching union variant could be selected. + public static object? ReadUnionValue(this ref Utf8JsonReader reader, JsonSerializerOptions options, + JsonUnionSelectorFunc selector, JsonReadFunc? readType1, JsonReadFunc? readType2, + JsonReadFunc? readType3) + { + if (reader.TokenType is JsonTokenType.Null) + { + return null; + } + + return selector(ref reader, options) switch + { + 1 => (readType1 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 2 => (readType2 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 3 => (readType3 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + _ => throw new InvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}' or '{typeof(T3).Name}'.") + }; + } + + /// + /// Reads an inline union value from a given instance. + /// + /// The first union type. + /// The second union type. + /// The third union type. + /// The fourth union type. + /// A reference to the . + /// The to use. + /// A function that selects the union variant (e.g. based on the current JSON token type). + /// + /// The delegate that should be called to read the first union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the second union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the third union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the fourth union variant type, or + /// to use the default converter for the type . + /// + /// A boxed value of the selected union variant. + /// If no matching union variant could be selected. + public static object? ReadUnionValue(this ref Utf8JsonReader reader, JsonSerializerOptions options, + JsonUnionSelectorFunc selector, JsonReadFunc? readType1, JsonReadFunc? readType2, + JsonReadFunc? readType3, JsonReadFunc? readType4) + { + if (reader.TokenType is JsonTokenType.Null) + { + return null; + } + + return selector(ref reader, options) switch + { + 1 => (readType1 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 2 => (readType2 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 3 => (readType3 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 4 => (readType4 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + _ => throw new InvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}', '{typeof(T3).Name}' or '{typeof(T4).Name}'.") + }; + } + + /// + /// Reads an inline union value from a given instance. + /// + /// The first union type. + /// The second union type. + /// The third union type. + /// The fourth union type. + /// The fifth union type. + /// A reference to the . + /// The to use. + /// A function that selects the union variant (e.g. based on the current JSON token type). + /// + /// The delegate that should be called to read the first union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the second union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the third union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the fourth union variant type, or + /// to use the default converter for the type . + /// + /// + /// The delegate that should be called to read the fifth union variant type, or + /// to use the default converter for the type . + /// + /// A boxed value of the selected union variant. + /// If no matching union variant could be selected. + public static object? ReadUnionValue(this ref Utf8JsonReader reader, JsonSerializerOptions options, + JsonUnionSelectorFunc selector, JsonReadFunc? readType1, JsonReadFunc? readType2, + JsonReadFunc? readType3, JsonReadFunc? readType4, JsonReadFunc? readType5) + { + if (reader.TokenType is JsonTokenType.Null) + { + return null; + } + + return selector(ref reader, options) switch + { + 1 => (readType1 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 2 => (readType2 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 3 => (readType3 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 4 => (readType4 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + 5 => (readType5 ?? (static (ref Utf8JsonReader r, JsonSerializerOptions o) => ReadValue(ref r, o))).Invoke(ref reader, options), + _ => throw new InvalidOperationException($"Failed to select a union variant for union of type '{typeof(T1).Name}', '{typeof(T2).Name}', '{typeof(T3).Name}', '{typeof(T4).Name}' or '{typeof(T5).Name}'.") + }; + } + #region Specialized Read Methods /// diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonUnionSelector.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonUnionSelector.cs index e017ea094e1..ec9ff904bc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonUnionSelector.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Next/JsonUnionSelector.cs @@ -12,14 +12,14 @@ namespace Elastic.Clients.Elasticsearch.Serialization; /// /// A reference to a instance. /// The to use. -/// The selected value. +/// The selected variant index (0 = no match, 1+ = variant index). /// /// IMPORTANT: /// The is passed by reference for best performance. If the selector function /// implementation needs to advance the reader position, it must always operate on a copy of the original /// or restore the reader state before returning. /// -internal delegate UnionTag JsonUnionSelectorFunc(ref Utf8JsonReader reader, JsonSerializerOptions options); +internal delegate int JsonUnionSelectorFunc(ref Utf8JsonReader reader, JsonSerializerOptions options); [Flags] internal enum JsonTokenTypes @@ -38,97 +38,110 @@ internal enum JsonTokenTypes internal static class JsonUnionSelector { /// - /// A selector function that always returns . + /// A selector function that always returns 0 (no match). /// /// A reference to the instance. /// The to use. - /// A static value of . - public static UnionTag None(ref Utf8JsonReader reader, JsonSerializerOptions options) + /// A static value of 0. + public static int None(ref Utf8JsonReader reader, JsonSerializerOptions options) { _ = reader; _ = options; - return UnionTag.None; + return 0; } /// - /// A selector function that always returns . + /// A selector function that always returns . /// /// A reference to the instance. /// The to use. - /// A static value of . - public static UnionTag T1(ref Utf8JsonReader reader, JsonSerializerOptions options) + /// The variant index to return (1-based). + /// The specified . + public static int Variant(ref Utf8JsonReader reader, JsonSerializerOptions options, int variantIndex) { _ = reader; _ = options; - return UnionTag.T1; + return variantIndex; } /// - /// A selector function that always returns . + /// Matches a selector function against an array of provided cases and returns the first non-zero result, + /// or 0, if no case matched. /// - /// A reference to the instance. - /// The to use. - /// A static value of . - public static UnionTag T2(ref Utf8JsonReader reader, JsonSerializerOptions options) - { - _ = reader; - _ = options; - return UnionTag.T2; - } - - // We avoid using a `params` array for performance reasons. Create `Match()` overloads with additional parameters as needed. - - public static UnionTag Match(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonUnionSelectorFunc case1, JsonUnionSelectorFunc case2) + public static int Match(ref Utf8JsonReader reader, JsonSerializerOptions options, + JsonUnionSelectorFunc case1, JsonUnionSelectorFunc case2) { - if (case1(ref reader, options) is var tag1 and not UnionTag.None) + var result = case1(ref reader, options); + if (result != 0) { - return tag1; + return result; } - if (case2(ref reader, options) is var tag2 and not UnionTag.None) - { - return tag2; - } - - return UnionTag.None; + return case2(ref reader, options); } - public static UnionTag Match(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonUnionSelectorFunc case1, JsonUnionSelectorFunc case2, + /// + /// Matches a selector function against an array of provided cases and returns the first non-zero result, + /// or 0, if no case matched. + /// + public static int Match(ref Utf8JsonReader reader, JsonSerializerOptions options, + JsonUnionSelectorFunc case1, JsonUnionSelectorFunc case2, JsonUnionSelectorFunc case3) { - if (case1(ref reader, options) is var tag1 and not UnionTag.None) - { - return tag1; - } - - if (case2(ref reader, options) is var tag2 and not UnionTag.None) + var result = case1(ref reader, options); + if (result != 0) { - return tag2; + return result; } - if (case3(ref reader, options) is var tag3 and not UnionTag.None) + result = case2(ref reader, options); + if (result != 0) { - return tag3; + return result; } - return UnionTag.None; + return case3(ref reader, options); } - public static UnionTag MatchTokenTypes(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonTokenTypes types, JsonUnionSelectorFunc next) + /// + /// A selector function that selects a union variant based on the current JSON token type. + /// + /// A reference to the instance. + /// The to use. + /// The JSON token types to match. + /// The next selector function to call if the token type matches. + /// + /// The result of , if the current token type of matches one + /// of the provided JSON token types or 0, if not. + /// + public static int MatchTokenTypes(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonTokenTypes types, + JsonUnionSelectorFunc next) { if (((int)types & (1 << (int)reader.TokenType)) is not 0) { return next(ref reader, options); } - return UnionTag.None; + return 0; } - public static UnionTag MatchProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string name, UnionTag result) + /// + /// A selector function that selects a union variant based on a property present in the current JSON object. + /// + /// A reference to the instance. + /// The to use. + /// The property name to look for. + /// The next selector function to call, if the property was found. + /// + /// The result of , if the points to an object that contains a + /// property of the given or 0, if not. + /// + public static int MatchProperty(ref Utf8JsonReader reader, JsonSerializerOptions options, string name, + JsonUnionSelectorFunc next) { if (reader.TokenType is not JsonTokenType.StartObject) { - return UnionTag.None; + return 0; } var internalReader = reader; @@ -137,14 +150,14 @@ public static UnionTag MatchProperty(ref Utf8JsonReader reader, JsonSerializerOp { if (internalReader.ValueTextEquals(name)) { - return result; + return next(ref reader, options); } internalReader.Read(); internalReader.SafeSkip(); } - return UnionTag.None; + return 0; } /// @@ -152,17 +165,18 @@ public static UnionTag MatchProperty(ref Utf8JsonReader reader, JsonSerializerOp /// /// A reference to the instance. /// The to use. - /// The JSON token types that resolve to . - /// The JSON token types that resolve to . + /// The JSON token types that resolve to 1. + /// The JSON token types that resolve to 2. /// - /// Either or if the current token type of matches one - /// of the provided JSON token types or , if not. + /// Either 1 or 2 if the current token type of matches one + /// of the provided JSON token types or 0, if not. /// - public static UnionTag ByTokenType(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonTokenTypes first, JsonTokenTypes second) + public static int ByTokenType(ref Utf8JsonReader reader, JsonSerializerOptions options, JsonTokenTypes first, + JsonTokenTypes second) { return Match(ref reader, options, - (ref r, o) => MatchTokenTypes(ref r, o, first, T1), - (ref r, o) => MatchTokenTypes(ref r, o, second, T2) + (ref r, o) => MatchTokenTypes(ref r, o, first, (ref _, _) => 1), + (ref r, o) => MatchTokenTypes(ref r, o, second, (ref _, _) => 2) ); } @@ -173,15 +187,15 @@ public static UnionTag ByTokenType(ref Utf8JsonReader reader, JsonSerializerOpti /// The to use. /// The property name to look for. /// - /// if the points to an object that contains a property of the given - /// or , if not. + /// 1 if the points to an object that contains a property of the given + /// or 2, if not. /// - public static UnionTag ByPropertyOfT1(ref Utf8JsonReader reader, JsonSerializerOptions options, string name) + public static int ByPropertyOfT1(ref Utf8JsonReader reader, JsonSerializerOptions options, string name) { return Match(ref reader, options, - (ref r, o) => MatchProperty(ref r, o, name, UnionTag.T1), - T2 - ); + (ref r, o) => MatchProperty(ref r, o, name, (ref _, _) => 1), + (ref _, _) => 2 + ); } /// @@ -191,14 +205,14 @@ public static UnionTag ByPropertyOfT1(ref Utf8JsonReader reader, JsonSerializerO /// The to use. /// The property name to look for. /// - /// if the points to an object that contains a property of the given - /// or , if not. + /// 2 if the points to an object that contains a property of the given + /// or 1, if not. /// - public static UnionTag ByPropertyOfT2(ref Utf8JsonReader reader, JsonSerializerOptions options, string name) + public static int ByPropertyOfT2(ref Utf8JsonReader reader, JsonSerializerOptions options, string name) { return Match(ref reader, options, - (ref r, o) => MatchProperty(ref r, o, name, UnionTag.T2), - T1 + (ref r, o) => MatchProperty(ref r, o, name, (ref _, _) => 2), + (ref _, _) => 1 ); } }