diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs index 3a7a95f942e..a4ba05793e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs @@ -27,12 +27,12 @@ internal sealed partial class GetAliasResponseConverter : System.Text.Json.Seria { public override Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Values = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Values = reader.ReadValue?>(options, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) }; } public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse value, System.Text.Json.JsonSerializerOptions options) { - writer.WriteValue(options, value.Values, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteValue(options, value.Values, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); } } @@ -50,9 +50,5 @@ internal GetAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr _ = sentinel; } - public -#if NET7_0_OR_GREATER -required -#endif -System.Collections.Generic.IReadOnlyDictionary Values { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Values { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs index 31d317bddda..f4cd328413d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs @@ -40,7 +40,7 @@ public override Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse LocalJsonValue propService = default; LocalJsonValue propServiceSettings = default; LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; + LocalJsonValue propTaskType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) @@ -177,5 +177,5 @@ internal PutAlibabacloudResponse(Elastic.Clients.Elasticsearch.Serialization.Jso #if NET7_0_OR_GREATER required #endif - Elastic.Clients.Elasticsearch.Inference.TaskType TaskType { get; set; } + Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI TaskType { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs index 9962b1d2183..ed4e2d81572 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs @@ -1034,6 +1034,91 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, } } +internal sealed partial class TaskTypeAlibabaCloudAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI 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.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} + internal sealed partial class TaskTypeJinaAiConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); @@ -1093,12 +1178,24 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, internal sealed partial class CohereEmbeddingTypeConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"); + private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); private static readonly System.Text.Json.JsonEncodedText MemberInt8 = System.Text.Json.JsonEncodedText.Encode("int8"); public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberBinary)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; + } + + if (reader.ValueTextEquals(MemberBit)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; + } + if (reader.ValueTextEquals(MemberByte)) { return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; @@ -1115,6 +1212,16 @@ public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read } var value = reader.GetString()!; + if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; + } + + if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; + } + if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; @@ -1137,6 +1244,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary: + writer.WriteStringValue(MemberBinary); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit: + writer.WriteStringValue(MemberBit); + break; case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte: writer.WriteStringValue(MemberByte); break; @@ -1704,6 +1817,19 @@ public enum WatsonxTaskType TextEmbedding } +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAIConverter))] +public enum TaskTypeAlibabaCloudAI +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} + [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAiConverter))] public enum TaskTypeJinaAi { @@ -1716,6 +1842,10 @@ public enum TaskTypeJinaAi [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingTypeConverter))] public enum CohereEmbeddingType { + [System.Runtime.Serialization.EnumMember(Value = "binary")] + Binary, + [System.Runtime.Serialization.EnumMember(Value = "bit")] + Bit, [System.Runtime.Serialization.EnumMember(Value = "byte")] Byte, [System.Runtime.Serialization.EnumMember(Value = "float")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs index eb557ec44ff..e1ddc8bf595 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs @@ -144,6 +144,8 @@ internal CohereServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// /// For a text_embedding task, the types of embeddings you want to get back. + /// Use binary for binary embeddings, which are encoded as bytes with signed int8 precision. + /// Use bit for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of binary). /// Use byte for signed int8 embeddings (this is a synonym of int8). /// Use float for the default float embeddings. /// Use int8 for signed int8 embeddings. @@ -236,6 +238,8 @@ public Elastic.Clients.Elasticsearch.Inference.CohereServiceSettingsDescriptor A /// /// /// For a text_embedding task, the types of embeddings you want to get back. + /// Use binary for binary embeddings, which are encoded as bytes with signed int8 precision. + /// Use bit for binary embeddings, which are encoded as bytes with signed int8 precision (this is a synonym of binary). /// Use byte for signed int8 embeddings (this is a synonym of int8). /// Use float for the default float embeddings. /// Use int8 for signed int8 embeddings. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs index f0d39d66d23..2a390e134a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -27,6 +27,7 @@ internal sealed partial class DateRangeQueryConverter : System.Text.Json.Seriali { private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); @@ -34,6 +35,7 @@ internal sealed partial class DateRangeQueryConverter : System.Text.Json.Seriali private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -45,6 +47,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref S reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBoost = default; LocalJsonValue propFormat = default; + LocalJsonValue propFrom = default; LocalJsonValue propGt = default; LocalJsonValue propGte = default; LocalJsonValue propLt = default; @@ -52,6 +55,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref S LocalJsonValue propQueryName = default; LocalJsonValue propRelation = default; LocalJsonValue propTimeZone = default; + LocalJsonValue propTo = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, null)) @@ -64,6 +68,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref S continue; } + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) { continue; @@ -99,6 +108,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref S continue; } + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.Skip(); @@ -116,13 +130,15 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref S Boost = propBoost.Value, Field = propField.Value, Format = propFormat.Value, + From = propFrom.Value, Gt = propGt.Value, Gte = propGte.Value, Lt = propLt.Value, Lte = propLte.Value, QueryName = propQueryName.Value, Relation = propRelation.Value, - TimeZone = propTimeZone.Value + TimeZone = propTimeZone.Value, + To = propTo.Value }; } @@ -133,6 +149,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropBoost, value.Boost, null, null); writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, null); writer.WriteProperty(options, PropGt, value.Gt, null, null); writer.WriteProperty(options, PropGte, value.Gte, null, null); writer.WriteProperty(options, PropLt, value.Lt, null, null); @@ -140,6 +157,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropRelation, value.Relation, null, null); writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -185,6 +203,7 @@ internal DateRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// public string? Format { get; set; } + public Elastic.Clients.Elasticsearch.DateMath? From { get; set; } /// /// @@ -228,6 +247,7 @@ internal DateRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// public string? TimeZone { get; set; } + public Elastic.Clients.Elasticsearch.DateMath? To { get; set; } string Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery.Type => "date"; } @@ -288,6 +308,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor From(Elastic.Clients.Elasticsearch.DateMath? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -360,6 +386,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor To(Elastic.Clients.Elasticsearch.DateMath? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Build(System.Action> action) { @@ -425,6 +457,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor Format(st return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor From(Elastic.Clients.Elasticsearch.DateMath? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -497,6 +535,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor TimeZone( return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor To(Elastic.Clients.Elasticsearch.DateMath? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs index 5e6e186e62f..5facaf08a84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -26,12 +26,14 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; internal sealed partial class NumberRangeQueryConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -42,12 +44,14 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref reader.Read(); reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBoost = default; + LocalJsonValue propFrom = default; LocalJsonValue propGt = default; LocalJsonValue propGte = default; LocalJsonValue propLt = default; LocalJsonValue propLte = default; LocalJsonValue propQueryName = default; LocalJsonValue propRelation = default; + LocalJsonValue propTo = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, null)) @@ -55,6 +59,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref continue; } + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) { continue; @@ -85,6 +94,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref continue; } + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.Skip(); @@ -101,12 +115,14 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref { Boost = propBoost.Value, Field = propField.Value, + From = propFrom.Value, Gt = propGt.Value, Gte = propGte.Value, Lt = propLt.Value, Lte = propLte.Value, QueryName = propQueryName.Value, - Relation = propRelation.Value + Relation = propRelation.Value, + To = propTo.Value }; } @@ -116,12 +132,14 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WritePropertyName(options, value.Field, null); writer.WriteStartObject(); writer.WriteProperty(options, PropBoost, value.Boost, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, null); writer.WriteProperty(options, PropGt, value.Gt, null, null); writer.WriteProperty(options, PropGte, value.Gte, null, null); writer.WriteProperty(options, PropLt, value.Lt, null, null); writer.WriteProperty(options, PropLte, value.Lte, null, null); writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropRelation, value.Relation, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -160,6 +178,7 @@ internal NumberRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstr required #endif Elastic.Clients.Elasticsearch.Field Field { get; set; } + public double? From { get; set; } /// /// @@ -196,6 +215,7 @@ internal NumberRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } + public double? To { get; set; } string Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery.Type => "number"; } @@ -245,6 +265,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor From(double? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -306,6 +332,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor To(double? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Build(System.Action> action) { @@ -360,6 +392,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor Field /// /// Greater than. @@ -421,6 +459,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor Relatio return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor To(double? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs index 46d01c44851..c096df4a21a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs @@ -26,12 +26,14 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; internal sealed partial class TermRangeQueryConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -42,12 +44,14 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref S reader.Read(); reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBoost = default; + LocalJsonValue propFrom = default; LocalJsonValue propGt = default; LocalJsonValue propGte = default; LocalJsonValue propLt = default; LocalJsonValue propLte = default; LocalJsonValue propQueryName = default; LocalJsonValue propRelation = default; + LocalJsonValue propTo = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, null)) @@ -55,6 +59,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref S continue; } + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) { continue; @@ -85,6 +94,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref S continue; } + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.Skip(); @@ -101,12 +115,14 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref S { Boost = propBoost.Value, Field = propField.Value, + From = propFrom.Value, Gt = propGt.Value, Gte = propGte.Value, Lt = propLt.Value, Lte = propLte.Value, QueryName = propQueryName.Value, - Relation = propRelation.Value + Relation = propRelation.Value, + To = propTo.Value }; } @@ -116,12 +132,14 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WritePropertyName(options, value.Field, null); writer.WriteStartObject(); writer.WriteProperty(options, PropBoost, value.Boost, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, null); writer.WriteProperty(options, PropGt, value.Gt, null, null); writer.WriteProperty(options, PropGte, value.Gte, null, null); writer.WriteProperty(options, PropLt, value.Lt, null, null); writer.WriteProperty(options, PropLte, value.Lte, null, null); writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropRelation, value.Relation, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -160,6 +178,7 @@ internal TermRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc required #endif Elastic.Clients.Elasticsearch.Field Field { get; set; } + public string? From { get; set; } /// /// @@ -196,6 +215,7 @@ internal TermRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// public Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? Relation { get; set; } + public string? To { get; set; } string Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery.Type => "term"; } @@ -245,6 +265,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor From(string? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -306,6 +332,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor To(string? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Build(System.Action> action) { @@ -360,6 +392,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor Field( return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor From(string? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -421,6 +459,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor Relation( return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor To(string? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs index 70cfeb1b20b..77bc5431175 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs @@ -27,6 +27,7 @@ internal sealed partial class UntypedRangeQueryConverter : System.Text.Json.Seri { private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); @@ -34,6 +35,7 @@ internal sealed partial class UntypedRangeQueryConverter : System.Text.Json.Seri private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -45,6 +47,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(re reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBoost = default; LocalJsonValue propFormat = default; + LocalJsonValue propFrom = default; LocalJsonValue propGt = default; LocalJsonValue propGte = default; LocalJsonValue propLt = default; @@ -52,6 +55,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(re LocalJsonValue propQueryName = default; LocalJsonValue propRelation = default; LocalJsonValue propTimeZone = default; + LocalJsonValue propTo = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, null)) @@ -64,6 +68,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(re continue; } + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) { continue; @@ -99,6 +108,11 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(re continue; } + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.Skip(); @@ -116,13 +130,15 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(re Boost = propBoost.Value, Field = propField.Value, Format = propFormat.Value, + From = propFrom.Value, Gt = propGt.Value, Gte = propGte.Value, Lt = propLt.Value, Lte = propLte.Value, QueryName = propQueryName.Value, Relation = propRelation.Value, - TimeZone = propTimeZone.Value + TimeZone = propTimeZone.Value, + To = propTo.Value }; } @@ -133,6 +149,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropBoost, value.Boost, null, null); writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, null); writer.WriteProperty(options, PropGt, value.Gt, null, null); writer.WriteProperty(options, PropGte, value.Gte, null, null); writer.WriteProperty(options, PropLt, value.Lt, null, null); @@ -140,6 +157,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropRelation, value.Relation, null, null); writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -185,6 +203,7 @@ internal UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// public string? Format { get; set; } + public object? From { get; set; } /// /// @@ -228,6 +247,7 @@ internal UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// public string? TimeZone { get; set; } + public object? To { get; set; } string Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery.Type => "untyped"; } @@ -288,6 +308,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor From(object? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -360,6 +386,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor To(object? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Build(System.Action> action) { @@ -425,6 +457,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor Format return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor From(object? value) + { + Instance.From = value; + return this; + } + /// /// /// Greater than. @@ -497,6 +535,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor TimeZo return this; } + public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor To(object? value) + { + Instance.To = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Build(System.Action action) {