From 6108902c44cd126ec8824987f94bfc34a988f8dd Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 2 Jun 2025 12:04:56 +0200 Subject: [PATCH] Fix `IndexName` ambiguity (#8556) --- .../_Generated/Api/DeleteRequest.g.cs | 5 + .../_Generated/Api/ExistsRequest.g.cs | 5 + .../_Generated/Api/ExistsSourceRequest.g.cs | 5 + .../_Generated/Api/ExplainRequest.g.cs | 5 + .../_Generated/Api/GetRequest.g.cs | 5 + .../_Generated/Api/GetSourceRequest.g.cs | 5 + .../Client/ElasticsearchClient.g.cs | 102 ++++++++++++++++++ .../Types/QueryDsl/DateRangeQuery.g.cs | 46 +------- .../Types/QueryDsl/NumberRangeQuery.g.cs | 46 +------- .../Types/QueryDsl/TermRangeQuery.g.cs | 46 +------- .../Types/QueryDsl/UntypedRangeQuery.g.cs | 46 +------- .../_Shared/Api/BulkRequest.cs | 11 ++ 12 files changed, 147 insertions(+), 180 deletions(-) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs index 54fb28ded4..a37c40e5f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs @@ -611,6 +611,11 @@ public DeleteRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El Instance = new Elastic.Clients.Elasticsearch.DeleteRequest(index, id); } + public DeleteRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.DeleteRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public DeleteRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.DeleteRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs index 21725210d8..68a57ba22d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs @@ -659,6 +659,11 @@ public ExistsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, El Instance = new Elastic.Clients.Elasticsearch.ExistsRequest(index, id); } + public ExistsRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.ExistsRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public ExistsRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.ExistsRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs index 30dee1597a..69ec3b5b57 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs @@ -541,6 +541,11 @@ public ExistsSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName ind Instance = new Elastic.Clients.Elasticsearch.ExistsSourceRequest(index, id); } + public ExistsSourceRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.ExistsSourceRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public ExistsSourceRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.ExistsSourceRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs index 3d383d1fb8..13ff52fde2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs @@ -682,6 +682,11 @@ public ExplainRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, E Instance = new Elastic.Clients.Elasticsearch.ExplainRequest(index, id); } + public ExplainRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.ExplainRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public ExplainRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.ExplainRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs index 6b5a6ed241..1ba52d8db3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs @@ -831,6 +831,11 @@ public GetRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Elast Instance = new Elastic.Clients.Elasticsearch.GetRequest(index, id); } + public GetRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.GetRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public GetRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.GetRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs index 936f3dd5be..f4c77282c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs @@ -584,6 +584,11 @@ public GetSourceRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index, Instance = new Elastic.Clients.Elasticsearch.GetSourceRequest(index, id); } + public GetSourceRequestDescriptor(string index, Elastic.Clients.Elasticsearch.Id id) + { + Instance = new Elastic.Clients.Elasticsearch.GetSourceRequest((Elastic.Clients.Elasticsearch.IndexName)index, id); + } + public GetSourceRequestDescriptor(TDocument document) { Instance = new Elastic.Clients.Elasticsearch.GetSourceRequest(typeof(TDocument), Elastic.Clients.Elasticsearch.Id.From(document)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 4e1c4d2df3..ad17753b7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -567,6 +567,23 @@ public virtual Elastic.Clients.Elasticsearch.DeleteResponse Delete(Elastic.Clien return DoRequest(request); } + public virtual Elastic.Clients.Elasticsearch.DeleteResponse Delete(string index, Elastic.Clients.Elasticsearch.Id id) + { + var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.DeleteResponse Delete(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + public virtual Elastic.Clients.Elasticsearch.DeleteResponse Delete(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action) { var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); @@ -650,6 +667,23 @@ public virtual Elastic.Clients.Elasticsearch.DeleteResponse Delete(El return DoRequestAsync(request, cancellationToken); } + public virtual System.Threading.Tasks.Task DeleteAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task DeleteAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual System.Threading.Tasks.Task DeleteAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action, System.Threading.CancellationToken cancellationToken = default) { var builder = new Elastic.Clients.Elasticsearch.DeleteRequestDescriptor(index, id); @@ -923,6 +957,23 @@ public virtual Elastic.Clients.Elasticsearch.ExistsResponse Exists(Elastic.Clien return DoRequest(request); } + public virtual Elastic.Clients.Elasticsearch.ExistsResponse Exists(string index, Elastic.Clients.Elasticsearch.Id id) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.ExistsResponse Exists(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + public virtual Elastic.Clients.Elasticsearch.ExistsResponse Exists(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action) { var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); @@ -1006,6 +1057,23 @@ public virtual Elastic.Clients.Elasticsearch.ExistsResponse Exists(El return DoRequestAsync(request, cancellationToken); } + public virtual System.Threading.Tasks.Task ExistsAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task ExistsAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual System.Threading.Tasks.Task ExistsAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action, System.Threading.CancellationToken cancellationToken = default) { var builder = new Elastic.Clients.Elasticsearch.ExistsRequestDescriptor(index, id); @@ -1089,6 +1157,23 @@ public virtual Elastic.Clients.Elasticsearch.ExistsSourceResponse ExistsSource(E return DoRequest(request); } + public virtual Elastic.Clients.Elasticsearch.ExistsSourceResponse ExistsSource(string index, Elastic.Clients.Elasticsearch.Id id) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.ExistsSourceResponse ExistsSource(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + public virtual Elastic.Clients.Elasticsearch.ExistsSourceResponse ExistsSource(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action) { var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); @@ -1172,6 +1257,23 @@ public virtual Elastic.Clients.Elasticsearch.ExistsSourceResponse ExistsSource(request, cancellationToken); } + public virtual System.Threading.Tasks.Task ExistsSourceAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task ExistsSourceAsync(string index, Elastic.Clients.Elasticsearch.Id id, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual System.Threading.Tasks.Task ExistsSourceAsync(Elastic.Clients.Elasticsearch.IndexName index, Elastic.Clients.Elasticsearch.Id id, System.Action> action, System.Threading.CancellationToken cancellationToken = default) { var builder = new Elastic.Clients.Elasticsearch.ExistsSourceRequestDescriptor(index, id); 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 2a390e134a..f0d39d66d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -27,7 +27,6 @@ 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"); @@ -35,7 +34,6 @@ 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) { @@ -47,7 +45,6 @@ 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; @@ -55,7 +52,6 @@ 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)) @@ -68,11 +64,6 @@ 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; @@ -108,11 +99,6 @@ 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(); @@ -130,15 +116,13 @@ 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, - To = propTo.Value + TimeZone = propTimeZone.Value }; } @@ -149,7 +133,6 @@ 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); @@ -157,7 +140,6 @@ 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(); } @@ -203,7 +185,6 @@ internal DateRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// public string? Format { get; set; } - public Elastic.Clients.Elasticsearch.DateMath? From { get; set; } /// /// @@ -247,7 +228,6 @@ 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"; } @@ -308,12 +288,6 @@ public Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryDescriptor From(Elastic.Clients.Elasticsearch.DateMath? value) - { - Instance.From = value; - return this; - } - /// /// /// Greater than. @@ -386,12 +360,6 @@ 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) { @@ -457,12 +425,6 @@ 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. @@ -535,12 +497,6 @@ 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 5facaf08a8..5e6e186e62 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -26,14 +26,12 @@ 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) { @@ -44,14 +42,12 @@ 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)) @@ -59,11 +55,6 @@ 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; @@ -94,11 +85,6 @@ 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(); @@ -115,14 +101,12 @@ 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, - To = propTo.Value + Relation = propRelation.Value }; } @@ -132,14 +116,12 @@ 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(); } @@ -178,7 +160,6 @@ internal NumberRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstr required #endif Elastic.Clients.Elasticsearch.Field Field { get; set; } - public double? From { get; set; } /// /// @@ -215,7 +196,6 @@ 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"; } @@ -265,12 +245,6 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor From(double? value) - { - Instance.From = value; - return this; - } - /// /// /// Greater than. @@ -332,12 +306,6 @@ 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) { @@ -392,12 +360,6 @@ public Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryDescriptor Field /// /// Greater than. @@ -459,12 +421,6 @@ 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 c096df4a21..46d01c4485 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs @@ -26,14 +26,12 @@ 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) { @@ -44,14 +42,12 @@ 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)) @@ -59,11 +55,6 @@ 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; @@ -94,11 +85,6 @@ 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(); @@ -115,14 +101,12 @@ 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, - To = propTo.Value + Relation = propRelation.Value }; } @@ -132,14 +116,12 @@ 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(); } @@ -178,7 +160,6 @@ internal TermRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc required #endif Elastic.Clients.Elasticsearch.Field Field { get; set; } - public string? From { get; set; } /// /// @@ -215,7 +196,6 @@ 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"; } @@ -265,12 +245,6 @@ public Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryDescriptor From(string? value) - { - Instance.From = value; - return this; - } - /// /// /// Greater than. @@ -332,12 +306,6 @@ 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) { @@ -392,12 +360,6 @@ 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. @@ -459,12 +421,6 @@ 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 77bc543117..70cfeb1b20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs @@ -27,7 +27,6 @@ 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"); @@ -35,7 +34,6 @@ 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) { @@ -47,7 +45,6 @@ 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; @@ -55,7 +52,6 @@ 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)) @@ -68,11 +64,6 @@ 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; @@ -108,11 +99,6 @@ 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(); @@ -130,15 +116,13 @@ 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, - To = propTo.Value + TimeZone = propTimeZone.Value }; } @@ -149,7 +133,6 @@ 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); @@ -157,7 +140,6 @@ 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(); } @@ -203,7 +185,6 @@ internal UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// public string? Format { get; set; } - public object? From { get; set; } /// /// @@ -247,7 +228,6 @@ 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"; } @@ -308,12 +288,6 @@ public Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryDescriptor From(object? value) - { - Instance.From = value; - return this; - } - /// /// /// Greater than. @@ -386,12 +360,6 @@ 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) { @@ -457,12 +425,6 @@ 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. @@ -535,12 +497,6 @@ 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) { diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Api/BulkRequest.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Api/BulkRequest.cs index 46570f4d86..8b0bd58779 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Api/BulkRequest.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Api/BulkRequest.cs @@ -77,6 +77,17 @@ public async Task SerializeAsync(Stream stream, IElasticsearchClientSettings set [StructLayout(LayoutKind.Auto)] public readonly partial struct BulkRequestDescriptor { + /// + /// + /// The name of the data stream, index, or index alias to perform bulk actions on. + /// + /// + public BulkRequestDescriptor Index(string? value) + { + Instance.Index = value; + return this; + } + public BulkRequestDescriptor Create(TSource document, Action>? configure = null) { var descriptor = new BulkCreateOperationDescriptor(document);