diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj
index 8ba54c7ca36..c3273d3eb74 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj
@@ -19,9 +19,14 @@
true
true
annotations
+ true
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
index ac935fb70ef..7a585979fc3 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
@@ -18,14 +18,161 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+internal sealed partial class AsyncSearchStatusResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTime = System.Text.Json.JsonEncodedText.Encode("expiration_time");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("expiration_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id");
+ private static readonly System.Text.Json.JsonEncodedText PropIsPartial = System.Text.Json.JsonEncodedText.Encode("is_partial");
+ private static readonly System.Text.Json.JsonEncodedText PropIsRunning = System.Text.Json.JsonEncodedText.Encode("is_running");
+ private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis");
+
+ public override AsyncSearchStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propClusters = default;
+ LocalJsonProperty propCompletionStatus = default;
+ LocalJsonProperty propCompletionTime = default;
+ LocalJsonProperty propCompletionTimeInMillis = default;
+ LocalJsonProperty propExpirationTime = default;
+ LocalJsonProperty propExpirationTimeInMillis = default;
+ LocalJsonProperty propId = default;
+ LocalJsonProperty propIsPartial = default;
+ LocalJsonProperty propIsRunning = default;
+ LocalJsonProperty propShards = default;
+ LocalJsonProperty propStartTime = default;
+ LocalJsonProperty propStartTimeInMillis = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propClusters.TryRead(ref reader, options, PropClusters))
+ {
+ continue;
+ }
+
+ if (propCompletionStatus.TryRead(ref reader, options, PropCompletionStatus))
+ {
+ continue;
+ }
+
+ if (propCompletionTime.TryRead(ref reader, options, PropCompletionTime))
+ {
+ continue;
+ }
+
+ if (propCompletionTimeInMillis.TryRead(ref reader, options, PropCompletionTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propExpirationTime.TryRead(ref reader, options, PropExpirationTime))
+ {
+ continue;
+ }
+
+ if (propExpirationTimeInMillis.TryRead(ref reader, options, PropExpirationTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propId.TryRead(ref reader, options, PropId))
+ {
+ continue;
+ }
+
+ if (propIsPartial.TryRead(ref reader, options, PropIsPartial))
+ {
+ continue;
+ }
+
+ if (propIsRunning.TryRead(ref reader, options, PropIsRunning))
+ {
+ continue;
+ }
+
+ if (propShards.TryRead(ref reader, options, PropShards))
+ {
+ continue;
+ }
+
+ if (propStartTime.TryRead(ref reader, options, PropStartTime))
+ {
+ continue;
+ }
+
+ if (propStartTimeInMillis.TryRead(ref reader, options, PropStartTimeInMillis))
+ {
+ 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 AsyncSearchStatusResponse
+ {
+ Clusters = propClusters.Value
+,
+ CompletionStatus = propCompletionStatus.Value
+,
+ CompletionTime = propCompletionTime.Value
+,
+ CompletionTimeInMillis = propCompletionTimeInMillis.Value
+,
+ ExpirationTime = propExpirationTime.Value
+,
+ ExpirationTimeInMillis = propExpirationTimeInMillis.Value
+,
+ Id = propId.Value
+,
+ IsPartial = propIsPartial.Value
+,
+ IsRunning = propIsRunning.Value
+,
+ Shards = propShards.Value
+,
+ StartTime = propStartTime.Value
+,
+ StartTimeInMillis = propStartTimeInMillis.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, AsyncSearchStatusResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropClusters, value.Clusters);
+ writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus);
+ writer.WriteProperty(options, PropCompletionTime, value.CompletionTime);
+ writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis);
+ writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime);
+ writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis);
+ writer.WriteProperty(options, PropId, value.Id);
+ writer.WriteProperty(options, PropIsPartial, value.IsPartial);
+ writer.WriteProperty(options, PropIsRunning, value.IsRunning);
+ writer.WriteProperty(options, PropShards, value.Shards);
+ writer.WriteProperty(options, PropStartTime, value.StartTime);
+ writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(AsyncSearchStatusResponseConverter))]
public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
{
///
@@ -34,7 +181,6 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// Not shown for local-only searches.
///
///
- [JsonInclude, JsonPropertyName("_clusters")]
public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; }
///
@@ -44,7 +190,6 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// 503 indicates that the async search was completed with an error.
///
///
- [JsonInclude, JsonPropertyName("completion_status")]
public int? CompletionStatus { get; init; }
///
@@ -53,9 +198,7 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// when the search has completed.
///
///
- [JsonInclude, JsonPropertyName("completion_time")]
public DateTimeOffset? CompletionTime { get; init; }
- [JsonInclude, JsonPropertyName("completion_time_in_millis")]
public long? CompletionTimeInMillis { get; init; }
///
@@ -63,11 +206,8 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// Indicates when the async search will expire.
///
///
- [JsonInclude, JsonPropertyName("expiration_time")]
public DateTimeOffset? ExpirationTime { get; init; }
- [JsonInclude, JsonPropertyName("expiration_time_in_millis")]
public long ExpirationTimeInMillis { get; init; }
- [JsonInclude, JsonPropertyName("id")]
public string? Id { get; init; }
///
@@ -76,7 +216,6 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// While the query is running, is_partial is always set to true.
///
///
- [JsonInclude, JsonPropertyName("is_partial")]
public bool IsPartial { get; init; }
///
@@ -85,7 +224,6 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
///
///
- [JsonInclude, JsonPropertyName("is_running")]
public bool IsRunning { get; init; }
///
@@ -93,10 +231,7 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// Indicates how many shards have run the query so far.
///
///
- [JsonInclude, JsonPropertyName("_shards")]
public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; }
- [JsonInclude, JsonPropertyName("start_time")]
public DateTimeOffset? StartTime { get; init; }
- [JsonInclude, JsonPropertyName("start_time_in_millis")]
public long StartTimeInMillis { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
index 66a78fb63cb..f9853190696 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
@@ -18,14 +18,51 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+internal sealed partial class DeleteAsyncSearchResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged");
+
+ public override DeleteAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propAcknowledged = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAcknowledged.TryRead(ref reader, options, PropAcknowledged))
+ {
+ 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 DeleteAsyncSearchResponse
+ {
+ Acknowledged = propAcknowledged.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, DeleteAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAcknowledged, value.Acknowledged);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(DeleteAsyncSearchResponseConverter))]
public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse
{
///
@@ -33,6 +70,5 @@ public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse
/// For a successful response, this value is always true. On failure, an exception is returned instead.
///
///
- [JsonInclude, JsonPropertyName("acknowledged")]
public bool Acknowledged { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
index a7fd20fd67d..1e8cf4d10f0 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
@@ -18,14 +18,158 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+internal sealed partial class GetAsyncSearchResponseConverter : System.Text.Json.Serialization.JsonConverter>
+{
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTime = System.Text.Json.JsonEncodedText.Encode("expiration_time");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("expiration_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id");
+ private static readonly System.Text.Json.JsonEncodedText PropIsPartial = System.Text.Json.JsonEncodedText.Encode("is_partial");
+ private static readonly System.Text.Json.JsonEncodedText PropIsRunning = System.Text.Json.JsonEncodedText.Encode("is_running");
+ private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis");
+
+ public override GetAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propCompletionTime = default;
+ LocalJsonProperty propCompletionTimeInMillis = default;
+ LocalJsonProperty propExpirationTime = default;
+ LocalJsonProperty propExpirationTimeInMillis = default;
+ LocalJsonProperty propId = default;
+ LocalJsonProperty propIsPartial = default;
+ LocalJsonProperty propIsRunning = default;
+ LocalJsonProperty> propResponse = default;
+ LocalJsonProperty propStartTime = default;
+ LocalJsonProperty propStartTimeInMillis = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propCompletionTime.TryRead(ref reader, options, PropCompletionTime))
+ {
+ continue;
+ }
+
+ if (propCompletionTimeInMillis.TryRead(ref reader, options, PropCompletionTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propExpirationTime.TryRead(ref reader, options, PropExpirationTime))
+ {
+ continue;
+ }
+
+ if (propExpirationTimeInMillis.TryRead(ref reader, options, PropExpirationTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propId.TryRead(ref reader, options, PropId))
+ {
+ continue;
+ }
+
+ if (propIsPartial.TryRead(ref reader, options, PropIsPartial))
+ {
+ continue;
+ }
+
+ if (propIsRunning.TryRead(ref reader, options, PropIsRunning))
+ {
+ continue;
+ }
+
+ if (propResponse.TryRead(ref reader, options, PropResponse))
+ {
+ continue;
+ }
+
+ if (propStartTime.TryRead(ref reader, options, PropStartTime))
+ {
+ continue;
+ }
+
+ if (propStartTimeInMillis.TryRead(ref reader, options, PropStartTimeInMillis))
+ {
+ 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 GetAsyncSearchResponse
+ {
+ CompletionTime = propCompletionTime.Value
+,
+ CompletionTimeInMillis = propCompletionTimeInMillis.Value
+,
+ ExpirationTime = propExpirationTime.Value
+,
+ ExpirationTimeInMillis = propExpirationTimeInMillis.Value
+,
+ Id = propId.Value
+,
+ IsPartial = propIsPartial.Value
+,
+ IsRunning = propIsRunning.Value
+,
+ Response = propResponse.Value
+,
+ StartTime = propStartTime.Value
+,
+ StartTimeInMillis = propStartTimeInMillis.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, GetAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropCompletionTime, value.CompletionTime);
+ writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis);
+ writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime);
+ writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis);
+ writer.WriteProperty(options, PropId, value.Id);
+ writer.WriteProperty(options, PropIsPartial, value.IsPartial);
+ writer.WriteProperty(options, PropIsRunning, value.IsRunning);
+ writer.WriteProperty(options, PropResponse, value.Response);
+ writer.WriteProperty(options, PropStartTime, value.StartTime);
+ writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis);
+ writer.WriteEndObject();
+ }
+}
+
+internal sealed partial class GetAsyncSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory
+{
+ public override bool CanConvert(System.Type typeToConvert)
+ {
+ return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetAsyncSearchResponse<>);
+ }
+
+ public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ var args = typeToConvert.GetGenericArguments();
+#pragma warning disable IL3050
+ var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetAsyncSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!;
+#pragma warning restore IL3050
+ return converter;
+ }
+}
+
+[JsonConverter(typeof(GetAsyncSearchResponseConverterFactory))]
public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse
{
///
@@ -34,9 +178,7 @@ public sealed partial class GetAsyncSearchResponse : ElasticsearchRes
/// when the search has completed.
///
///
- [JsonInclude, JsonPropertyName("completion_time")]
public DateTimeOffset? CompletionTime { get; init; }
- [JsonInclude, JsonPropertyName("completion_time_in_millis")]
public long? CompletionTimeInMillis { get; init; }
///
@@ -44,11 +186,8 @@ public sealed partial class GetAsyncSearchResponse : ElasticsearchRes
/// Indicates when the async search will expire.
///
///
- [JsonInclude, JsonPropertyName("expiration_time")]
public DateTimeOffset? ExpirationTime { get; init; }
- [JsonInclude, JsonPropertyName("expiration_time_in_millis")]
public long ExpirationTimeInMillis { get; init; }
- [JsonInclude, JsonPropertyName("id")]
public string? Id { get; init; }
///
@@ -57,7 +196,6 @@ public sealed partial class GetAsyncSearchResponse : ElasticsearchRes
/// While the query is running, is_partial is always set to true.
///
///
- [JsonInclude, JsonPropertyName("is_partial")]
public bool IsPartial { get; init; }
///
@@ -66,12 +204,8 @@ public sealed partial class GetAsyncSearchResponse : ElasticsearchRes
/// NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
///
///
- [JsonInclude, JsonPropertyName("is_running")]
public bool IsRunning { get; init; }
- [JsonInclude, JsonPropertyName("response")]
public Elastic.Clients.Elasticsearch.Serverless.AsyncSearch.AsyncSearch Response { get; init; }
- [JsonInclude, JsonPropertyName("start_time")]
public DateTimeOffset? StartTime { get; init; }
- [JsonInclude, JsonPropertyName("start_time_in_millis")]
public long StartTimeInMillis { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
index da346fb535f..d3199154d1a 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
@@ -18,6 +18,7 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
@@ -231,410 +232,346 @@ public sealed partial class SubmitAsyncSearchRequestParameters : RequestParamete
public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}
-internal sealed partial class SubmitAsyncSearchRequestConverter : JsonConverter
+internal sealed partial class SubmitAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter
{
- public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
- {
- if (reader.TokenType != JsonTokenType.StartObject)
- throw new JsonException("Unexpected JSON detected.");
- var variant = new SubmitAsyncSearchRequest();
- while (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
- {
- if (reader.TokenType == JsonTokenType.PropertyName)
+ private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations");
+ private static readonly System.Text.Json.JsonEncodedText PropAggregations1 = System.Text.Json.JsonEncodedText.Encode("aggs");
+ private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse");
+ private static readonly System.Text.Json.JsonEncodedText PropDocvalueFields = System.Text.Json.JsonEncodedText.Encode("docvalue_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain");
+ private static readonly System.Text.Json.JsonEncodedText PropExt = System.Text.Json.JsonEncodedText.Encode("ext");
+ private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields");
+ private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from");
+ private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight");
+ private static readonly System.Text.Json.JsonEncodedText PropIndicesBoost = System.Text.Json.JsonEncodedText.Encode("indices_boost");
+ private static readonly System.Text.Json.JsonEncodedText PropKnn = System.Text.Json.JsonEncodedText.Encode("knn");
+ private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score");
+ private static readonly System.Text.Json.JsonEncodedText PropPit = System.Text.Json.JsonEncodedText.Encode("pit");
+ private static readonly System.Text.Json.JsonEncodedText PropPostFilter = System.Text.Json.JsonEncodedText.Encode("post_filter");
+ private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile");
+ private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query");
+ private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore");
+ private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings");
+ private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after");
+ private static readonly System.Text.Json.JsonEncodedText PropSeqNoPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("seq_no_primary_term");
+ private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size");
+ private static readonly System.Text.Json.JsonEncodedText PropSlice = System.Text.Json.JsonEncodedText.Encode("slice");
+ private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort");
+ private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source");
+ private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats");
+ private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest");
+ private static readonly System.Text.Json.JsonEncodedText PropTerminateAfter = System.Text.Json.JsonEncodedText.Encode("terminate_after");
+ private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout");
+ private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores");
+ private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits");
+ private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version");
+
+ public override SubmitAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty?> propAggregations = default;
+ LocalJsonProperty propCollapse = default;
+ LocalJsonProperty?> propDocvalueFields = default;
+ LocalJsonProperty propExplain = default;
+ LocalJsonProperty?> propExt = default;
+ LocalJsonProperty?> propFields = default;
+ LocalJsonProperty propFrom = default;
+ LocalJsonProperty propHighlight = default;
+ LocalJsonProperty>?> propIndicesBoost = default;
+ LocalJsonProperty?> propKnn = default;
+ LocalJsonProperty propMinScore = default;
+ LocalJsonProperty propPit = default;
+ LocalJsonProperty propPostFilter = default;
+ LocalJsonProperty propProfile = default;
+ LocalJsonProperty propQuery = default;
+ LocalJsonProperty?> propRescore = default;
+ LocalJsonProperty?> propRuntimeMappings = default;
+ LocalJsonProperty?> propScriptFields = default;
+ LocalJsonProperty?> propSearchAfter = default;
+ LocalJsonProperty propSeqNoPrimaryTerm = default;
+ LocalJsonProperty propSize = default;
+ LocalJsonProperty propSlice = default;
+ LocalJsonProperty?> propSort = default;
+ LocalJsonProperty propSource = default;
+ LocalJsonProperty?> propStats = default;
+ LocalJsonProperty propStoredFields = default;
+ LocalJsonProperty propSuggest = default;
+ LocalJsonProperty propTerminateAfter = default;
+ LocalJsonProperty propTimeout = default;
+ LocalJsonProperty propTrackScores = default;
+ LocalJsonProperty propTrackTotalHits = default;
+ LocalJsonProperty propVersion = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAggregations.TryRead(ref reader, options, PropAggregations) || propAggregations.TryRead(ref reader, options, PropAggregations1))
{
- var property = reader.GetString();
- if (property == "aggregations" || property == "aggs")
- {
- variant.Aggregations = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "collapse")
- {
- variant.Collapse = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "docvalue_fields")
- {
- variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "explain")
- {
- variant.Explain = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "ext")
- {
- variant.Ext = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "fields")
- {
- variant.Fields = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "from")
- {
- variant.From = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "highlight")
- {
- variant.Highlight = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "indices_boost")
- {
- variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options);
- continue;
- }
-
- if (property == "knn")
- {
- variant.Knn = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "min_score")
- {
- variant.MinScore = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "pit")
- {
- variant.Pit = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "post_filter")
- {
- variant.PostFilter = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "profile")
- {
- variant.Profile = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "query")
- {
- variant.Query = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "rescore")
- {
- variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "runtime_mappings")
- {
- variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "script_fields")
- {
- variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "search_after")
- {
- variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "seq_no_primary_term")
- {
- variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "size")
- {
- variant.Size = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "slice")
- {
- variant.Slice = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "sort")
- {
- variant.Sort = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "_source")
- {
- variant.Source = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "stats")
- {
- variant.Stats = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "stored_fields")
- {
- variant.StoredFields = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "suggest")
- {
- variant.Suggest = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "terminate_after")
- {
- variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "timeout")
- {
- variant.Timeout = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "track_scores")
- {
- variant.TrackScores = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "track_total_hits")
- {
- variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "version")
- {
- variant.Version = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
+ continue;
}
- }
-
- return variant;
- }
-
- public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value, JsonSerializerOptions options)
- {
- writer.WriteStartObject();
- if (value.Aggregations is not null)
- {
- writer.WritePropertyName("aggregations");
- JsonSerializer.Serialize(writer, value.Aggregations, options);
- }
- if (value.Collapse is not null)
- {
- writer.WritePropertyName("collapse");
- JsonSerializer.Serialize(writer, value.Collapse, options);
- }
+ if (propCollapse.TryRead(ref reader, options, PropCollapse))
+ {
+ continue;
+ }
- if (value.DocvalueFields is not null)
- {
- writer.WritePropertyName("docvalue_fields");
- JsonSerializer.Serialize(writer, value.DocvalueFields, options);
- }
+ if (propDocvalueFields.TryRead(ref reader, options, PropDocvalueFields))
+ {
+ continue;
+ }
- if (value.Explain.HasValue)
- {
- writer.WritePropertyName("explain");
- writer.WriteBooleanValue(value.Explain.Value);
- }
+ if (propExplain.TryRead(ref reader, options, PropExplain))
+ {
+ continue;
+ }
- if (value.Ext is not null)
- {
- writer.WritePropertyName("ext");
- JsonSerializer.Serialize(writer, value.Ext, options);
- }
+ if (propExt.TryRead(ref reader, options, PropExt))
+ {
+ continue;
+ }
- if (value.Fields is not null)
- {
- writer.WritePropertyName("fields");
- JsonSerializer.Serialize(writer, value.Fields, options);
- }
+ if (propFields.TryRead(ref reader, options, PropFields))
+ {
+ continue;
+ }
- if (value.From.HasValue)
- {
- writer.WritePropertyName("from");
- writer.WriteNumberValue(value.From.Value);
- }
+ if (propFrom.TryRead(ref reader, options, PropFrom))
+ {
+ continue;
+ }
- if (value.Highlight is not null)
- {
- writer.WritePropertyName("highlight");
- JsonSerializer.Serialize(writer, value.Highlight, options);
- }
+ if (propHighlight.TryRead(ref reader, options, PropHighlight))
+ {
+ continue;
+ }
- if (value.IndicesBoost is not null)
- {
- writer.WritePropertyName("indices_boost");
- JsonSerializer.Serialize(writer, value.IndicesBoost, options);
- }
+ if (propIndicesBoost.TryRead(ref reader, options, PropIndicesBoost))
+ {
+ continue;
+ }
- if (value.Knn is not null)
- {
- writer.WritePropertyName("knn");
- JsonSerializer.Serialize(writer, value.Knn, options);
- }
+ if (propKnn.TryRead(ref reader, options, PropKnn, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.KnnSearch>)))
+ {
+ continue;
+ }
- if (value.MinScore.HasValue)
- {
- writer.WritePropertyName("min_score");
- writer.WriteNumberValue(value.MinScore.Value);
- }
+ if (propMinScore.TryRead(ref reader, options, PropMinScore))
+ {
+ continue;
+ }
- if (value.Pit is not null)
- {
- writer.WritePropertyName("pit");
- JsonSerializer.Serialize(writer, value.Pit, options);
- }
+ if (propPit.TryRead(ref reader, options, PropPit))
+ {
+ continue;
+ }
- if (value.PostFilter is not null)
- {
- writer.WritePropertyName("post_filter");
- JsonSerializer.Serialize(writer, value.PostFilter, options);
- }
+ if (propPostFilter.TryRead(ref reader, options, PropPostFilter))
+ {
+ continue;
+ }
- if (value.Profile.HasValue)
- {
- writer.WritePropertyName("profile");
- writer.WriteBooleanValue(value.Profile.Value);
- }
+ if (propProfile.TryRead(ref reader, options, PropProfile))
+ {
+ continue;
+ }
- if (value.Query is not null)
- {
- writer.WritePropertyName("query");
- JsonSerializer.Serialize(writer, value.Query, options);
- }
+ if (propQuery.TryRead(ref reader, options, PropQuery))
+ {
+ continue;
+ }
- if (value.Rescore is not null)
- {
- writer.WritePropertyName("rescore");
- JsonSerializer.Serialize(writer, value.Rescore, options);
- }
+ if (propRescore.TryRead(ref reader, options, PropRescore, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore>)))
+ {
+ continue;
+ }
- if (value.RuntimeMappings is not null)
- {
- writer.WritePropertyName("runtime_mappings");
- JsonSerializer.Serialize(writer, value.RuntimeMappings, options);
- }
+ if (propRuntimeMappings.TryRead(ref reader, options, PropRuntimeMappings))
+ {
+ continue;
+ }
- if (value.ScriptFields is not null)
- {
- writer.WritePropertyName("script_fields");
- JsonSerializer.Serialize(writer, value.ScriptFields, options);
- }
+ if (propScriptFields.TryRead(ref reader, options, PropScriptFields))
+ {
+ continue;
+ }
- if (value.SearchAfter is not null)
- {
- writer.WritePropertyName("search_after");
- JsonSerializer.Serialize(writer, value.SearchAfter, options);
- }
+ if (propSearchAfter.TryRead(ref reader, options, PropSearchAfter))
+ {
+ continue;
+ }
- if (value.SeqNoPrimaryTerm.HasValue)
- {
- writer.WritePropertyName("seq_no_primary_term");
- writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value);
- }
+ if (propSeqNoPrimaryTerm.TryRead(ref reader, options, PropSeqNoPrimaryTerm))
+ {
+ continue;
+ }
- if (value.Size.HasValue)
- {
- writer.WritePropertyName("size");
- writer.WriteNumberValue(value.Size.Value);
- }
+ if (propSize.TryRead(ref reader, options, PropSize))
+ {
+ continue;
+ }
- if (value.Slice is not null)
- {
- writer.WritePropertyName("slice");
- JsonSerializer.Serialize(writer, value.Slice, options);
- }
+ if (propSlice.TryRead(ref reader, options, PropSlice))
+ {
+ continue;
+ }
- if (value.Sort is not null)
- {
- writer.WritePropertyName("sort");
- JsonSerializer.Serialize(writer, value.Sort, options);
- }
+ if (propSort.TryRead(ref reader, options, PropSort, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.SortOptions>)))
+ {
+ continue;
+ }
- if (value.Source is not null)
- {
- writer.WritePropertyName("_source");
- JsonSerializer.Serialize(writer, value.Source, options);
- }
+ if (propSource.TryRead(ref reader, options, PropSource))
+ {
+ continue;
+ }
- if (value.Stats is not null)
- {
- writer.WritePropertyName("stats");
- JsonSerializer.Serialize(writer, value.Stats, options);
- }
+ if (propStats.TryRead(ref reader, options, PropStats))
+ {
+ continue;
+ }
- if (value.StoredFields is not null)
- {
- writer.WritePropertyName("stored_fields");
- new FieldsConverter().Write(writer, value.StoredFields, options);
- }
+ if (propStoredFields.TryRead(ref reader, options, PropStoredFields, typeof(SingleOrManyFieldsMarker)))
+ {
+ continue;
+ }
- if (value.Suggest is not null)
- {
- writer.WritePropertyName("suggest");
- JsonSerializer.Serialize(writer, value.Suggest, options);
- }
+ if (propSuggest.TryRead(ref reader, options, PropSuggest))
+ {
+ continue;
+ }
- if (value.TerminateAfter.HasValue)
- {
- writer.WritePropertyName("terminate_after");
- writer.WriteNumberValue(value.TerminateAfter.Value);
- }
+ if (propTerminateAfter.TryRead(ref reader, options, PropTerminateAfter))
+ {
+ continue;
+ }
- if (!string.IsNullOrEmpty(value.Timeout))
- {
- writer.WritePropertyName("timeout");
- writer.WriteStringValue(value.Timeout);
- }
+ if (propTimeout.TryRead(ref reader, options, PropTimeout))
+ {
+ continue;
+ }
- if (value.TrackScores.HasValue)
- {
- writer.WritePropertyName("track_scores");
- writer.WriteBooleanValue(value.TrackScores.Value);
- }
+ if (propTrackScores.TryRead(ref reader, options, PropTrackScores))
+ {
+ continue;
+ }
- if (value.TrackTotalHits is not null)
- {
- writer.WritePropertyName("track_total_hits");
- JsonSerializer.Serialize(writer, value.TrackTotalHits, options);
- }
+ if (propTrackTotalHits.TryRead(ref reader, options, PropTrackTotalHits))
+ {
+ continue;
+ }
- if (value.Version.HasValue)
- {
- writer.WritePropertyName("version");
- writer.WriteBooleanValue(value.Version.Value);
- }
+ if (propVersion.TryRead(ref reader, options, PropVersion))
+ {
+ 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 SubmitAsyncSearchRequest
+ {
+ Aggregations = propAggregations.Value
+ ,
+ Collapse = propCollapse.Value
+ ,
+ DocvalueFields = propDocvalueFields.Value
+ ,
+ Explain = propExplain.Value
+ ,
+ Ext = propExt.Value
+ ,
+ Fields = propFields.Value
+ ,
+ From = propFrom.Value
+ ,
+ Highlight = propHighlight.Value
+ ,
+ IndicesBoost = propIndicesBoost.Value
+ ,
+ Knn = propKnn.Value
+ ,
+ MinScore = propMinScore.Value
+ ,
+ Pit = propPit.Value
+ ,
+ PostFilter = propPostFilter.Value
+ ,
+ Profile = propProfile.Value
+ ,
+ Query = propQuery.Value
+ ,
+ Rescore = propRescore.Value
+ ,
+ RuntimeMappings = propRuntimeMappings.Value
+ ,
+ ScriptFields = propScriptFields.Value
+ ,
+ SearchAfter = propSearchAfter.Value
+ ,
+ SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value
+ ,
+ Size = propSize.Value
+ ,
+ Slice = propSlice.Value
+ ,
+ Sort = propSort.Value
+ ,
+ Source = propSource.Value
+ ,
+ Stats = propStats.Value
+ ,
+ StoredFields = propStoredFields.Value
+ ,
+ Suggest = propSuggest.Value
+ ,
+ TerminateAfter = propTerminateAfter.Value
+ ,
+ Timeout = propTimeout.Value
+ ,
+ TrackScores = propTrackScores.Value
+ ,
+ TrackTotalHits = propTrackTotalHits.Value
+ ,
+ Version = propVersion.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, SubmitAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAggregations, value.Aggregations);
+ writer.WriteProperty(options, PropCollapse, value.Collapse);
+ writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields);
+ writer.WriteProperty(options, PropExplain, value.Explain);
+ writer.WriteProperty(options, PropExt, value.Ext);
+ writer.WriteProperty(options, PropFields, value.Fields);
+ writer.WriteProperty(options, PropFrom, value.From);
+ writer.WriteProperty(options, PropHighlight, value.Highlight);
+ writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost);
+ writer.WriteProperty(options, PropKnn, value.Knn, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.KnnSearch>));
+ writer.WriteProperty(options, PropMinScore, value.MinScore);
+ writer.WriteProperty(options, PropPit, value.Pit);
+ writer.WriteProperty(options, PropPostFilter, value.PostFilter);
+ writer.WriteProperty(options, PropProfile, value.Profile);
+ writer.WriteProperty(options, PropQuery, value.Query);
+ writer.WriteProperty(options, PropRescore, value.Rescore, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore>));
+ writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings);
+ writer.WriteProperty(options, PropScriptFields, value.ScriptFields);
+ writer.WriteProperty(options, PropSearchAfter, value.SearchAfter);
+ writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm);
+ writer.WriteProperty(options, PropSize, value.Size);
+ writer.WriteProperty(options, PropSlice, value.Slice);
+ writer.WriteProperty(options, PropSort, value.Sort, typeof(SingleOrManyMarker?, Elastic.Clients.Elasticsearch.Serverless.SortOptions>));
+ writer.WriteProperty(options, PropSource, value.Source);
+ writer.WriteProperty(options, PropStats, value.Stats);
+ writer.WriteProperty(options, PropStoredFields, value.StoredFields, typeof(SingleOrManyFieldsMarker));
+ writer.WriteProperty(options, PropSuggest, value.Suggest);
+ writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter);
+ writer.WriteProperty(options, PropTimeout, value.Timeout);
+ writer.WriteProperty(options, PropTrackScores, value.TrackScores);
+ writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits);
+ writer.WriteProperty(options, PropVersion, value.Version);
writer.WriteEndObject();
}
}
@@ -678,7 +615,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
///
///
- [JsonIgnore]
public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); }
///
@@ -686,7 +622,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Indicate if an error should be returned if there is a partial search failure or timeout
///
///
- [JsonIgnore]
public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); }
///
@@ -694,7 +629,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The analyzer to use for the query string
///
///
- [JsonIgnore]
public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); }
///
@@ -702,7 +636,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify whether wildcard and prefix queries should be analyzed (default: false)
///
///
- [JsonIgnore]
public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); }
///
@@ -711,7 +644,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
///
///
- [JsonIgnore]
public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); }
///
@@ -719,7 +651,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The default value is the only supported value.
///
///
- [JsonIgnore]
public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
///
@@ -727,7 +658,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The default operator for query string query (AND or OR)
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); }
///
@@ -735,7 +665,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The field to use as default where no field prefix is given in the query string
///
///
- [JsonIgnore]
public string? Df { get => Q("df"); set => Q("df", value); }
///
@@ -743,7 +672,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Whether to expand wildcard expression to concrete indices that are open, closed or both.
///
///
- [JsonIgnore]
public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); }
///
@@ -751,7 +679,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Whether specified concrete, expanded or aliased indices should be ignored when throttled
///
///
- [JsonIgnore]
public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); }
///
@@ -759,7 +686,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Whether specified concrete indices should be ignored when unavailable (missing or closed)
///
///
- [JsonIgnore]
public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); }
///
@@ -767,7 +693,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// If true, results are stored for later retrieval when the search completes within the wait_for_completion_timeout.
///
///
- [JsonIgnore]
public bool? KeepOnCompletion { get => Q("keep_on_completion"); set => Q("keep_on_completion", value); }
///
@@ -775,7 +700,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
///
///
- [JsonIgnore]
public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); }
///
@@ -783,7 +707,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
///
///
- [JsonIgnore]
public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
///
@@ -791,7 +714,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify the node or shard the operation should be performed on (default: random)
///
///
- [JsonIgnore]
public string? Preference { get => Q("preference"); set => Q("preference", value); }
///
@@ -799,7 +721,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Query in the Lucene query string syntax
///
///
- [JsonIgnore]
public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); }
///
@@ -807,7 +728,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify if request cache should be used for this request or not, defaults to true
///
///
- [JsonIgnore]
public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); }
///
@@ -815,7 +735,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Indicates whether hits.total should be rendered as an integer or an object in the rest search response
///
///
- [JsonIgnore]
public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
///
@@ -823,7 +742,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// A comma-separated list of specific routing values
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); }
///
@@ -831,7 +749,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Search operation type
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); }
///
@@ -839,7 +756,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// A list of fields to exclude from the returned _source field
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); }
///
@@ -847,7 +763,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// A list of fields to extract and return from the _source field
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); }
///
@@ -855,7 +770,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specifies which field to use for suggestions.
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); }
///
@@ -863,7 +777,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify suggest mode
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); }
///
@@ -871,7 +784,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// How many suggestions to return in response
///
///
- [JsonIgnore]
public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); }
///
@@ -879,7 +791,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// The source text for which the suggestions should be returned.
///
///
- [JsonIgnore]
public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); }
///
@@ -887,7 +798,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
///
///
- [JsonIgnore]
public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); }
///
@@ -896,11 +806,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
- [JsonInclude, JsonPropertyName("aggregations")]
public IDictionary? Aggregations { get; set; }
- [JsonInclude, JsonPropertyName("collapse")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; }
///
@@ -909,7 +816,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// names matching these patterns in the hits.fields property of the response.
///
///
- [JsonInclude, JsonPropertyName("docvalue_fields")]
public ICollection? DocvalueFields { get; set; }
///
@@ -917,7 +823,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// If true, returns detailed information about score computation as part of a hit.
///
///
- [JsonInclude, JsonPropertyName("explain")]
public bool? Explain { get; set; }
///
@@ -925,7 +830,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Configuration of search extensions defined by Elasticsearch plugins.
///
///
- [JsonInclude, JsonPropertyName("ext")]
public IDictionary? Ext { get; set; }
///
@@ -934,7 +838,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// matching these patterns in the hits.fields property of the response.
///
///
- [JsonInclude, JsonPropertyName("fields")]
public ICollection? Fields { get; set; }
///
@@ -944,9 +847,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// search_after parameter.
///
///
- [JsonInclude, JsonPropertyName("from")]
public int? From { get; set; }
- [JsonInclude, JsonPropertyName("highlight")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; }
///
@@ -954,7 +855,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Boosts the _score of documents from specified indices.
///
///
- [JsonInclude, JsonPropertyName("indices_boost")]
public ICollection>? IndicesBoost { get; set; }
///
@@ -962,8 +862,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Defines the approximate kNN search to run.
///
///
- [JsonInclude, JsonPropertyName("knn")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnSearch))]
public ICollection? Knn { get; set; }
///
@@ -972,7 +870,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// not included in the search results.
///
///
- [JsonInclude, JsonPropertyName("min_score")]
public double? MinScore { get; set; }
///
@@ -981,11 +878,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// cannot specify an <index> in the request path.
///
///
- [JsonInclude, JsonPropertyName("pit")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; set; }
- [JsonInclude, JsonPropertyName("post_filter")]
public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; set; }
- [JsonInclude, JsonPropertyName("profile")]
public bool? Profile { get; set; }
///
@@ -993,10 +887,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Defines the search definition using the Query DSL.
///
///
- [JsonInclude, JsonPropertyName("query")]
public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; }
- [JsonInclude, JsonPropertyName("rescore")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore))]
public ICollection? Rescore { get; set; }
///
@@ -1005,7 +896,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// precedence over mapped fields with the same name.
///
///
- [JsonInclude, JsonPropertyName("runtime_mappings")]
public IDictionary? RuntimeMappings { get; set; }
///
@@ -1013,9 +903,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Retrieve a script evaluation (based on different fields) for each hit.
///
///
- [JsonInclude, JsonPropertyName("script_fields")]
public IDictionary? ScriptFields { get; set; }
- [JsonInclude, JsonPropertyName("search_after")]
public ICollection? SearchAfter { get; set; }
///
@@ -1024,7 +912,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// of each hit. See Optimistic concurrency control.
///
///
- [JsonInclude, JsonPropertyName("seq_no_primary_term")]
public bool? SeqNoPrimaryTerm { get; set; }
///
@@ -1034,12 +921,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// hits, use the search_after parameter.
///
///
- [JsonInclude, JsonPropertyName("size")]
public int? Size { get; set; }
- [JsonInclude, JsonPropertyName("slice")]
public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; }
- [JsonInclude, JsonPropertyName("sort")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))]
public ICollection? Sort { get; set; }
///
@@ -1048,7 +931,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// fields are returned in the hits._source property of the search response.
///
///
- [JsonInclude, JsonPropertyName("_source")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; }
///
@@ -1058,7 +940,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// the indices stats API.
///
///
- [JsonInclude, JsonPropertyName("stats")]
public ICollection? Stats { get; set; }
///
@@ -1069,10 +950,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// and stored fields in the search response.
///
///
- [JsonInclude, JsonPropertyName("stored_fields")]
- [JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }
- [JsonInclude, JsonPropertyName("suggest")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; }
///
@@ -1082,7 +960,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// before sorting. Defaults to 0, which does not terminate query execution early.
///
///
- [JsonInclude, JsonPropertyName("terminate_after")]
public long? TerminateAfter { get; set; }
///
@@ -1092,7 +969,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Defaults to no timeout.
///
///
- [JsonInclude, JsonPropertyName("timeout")]
public string? Timeout { get; set; }
///
@@ -1100,7 +976,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// If true, calculate and return document scores, even if the scores are not used for sorting.
///
///
- [JsonInclude, JsonPropertyName("track_scores")]
public bool? TrackScores { get; set; }
///
@@ -1111,7 +986,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// Defaults to 10,000 hits.
///
///
- [JsonInclude, JsonPropertyName("track_total_hits")]
public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; set; }
///
@@ -1119,7 +993,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices
/// If true, returns document version as part of a hit.
///
///
- [JsonInclude, JsonPropertyName("version")]
public bool? Version { get; set; }
}
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs
index 2aa8d3f0afe..776b863bd4b 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs
@@ -18,14 +18,158 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+internal sealed partial class SubmitAsyncSearchResponseConverter : System.Text.Json.Serialization.JsonConverter>
+{
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTime = System.Text.Json.JsonEncodedText.Encode("expiration_time");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("expiration_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id");
+ private static readonly System.Text.Json.JsonEncodedText PropIsPartial = System.Text.Json.JsonEncodedText.Encode("is_partial");
+ private static readonly System.Text.Json.JsonEncodedText PropIsRunning = System.Text.Json.JsonEncodedText.Encode("is_running");
+ private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis");
+
+ public override SubmitAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propCompletionTime = default;
+ LocalJsonProperty propCompletionTimeInMillis = default;
+ LocalJsonProperty propExpirationTime = default;
+ LocalJsonProperty propExpirationTimeInMillis = default;
+ LocalJsonProperty propId = default;
+ LocalJsonProperty propIsPartial = default;
+ LocalJsonProperty propIsRunning = default;
+ LocalJsonProperty> propResponse = default;
+ LocalJsonProperty propStartTime = default;
+ LocalJsonProperty propStartTimeInMillis = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propCompletionTime.TryRead(ref reader, options, PropCompletionTime))
+ {
+ continue;
+ }
+
+ if (propCompletionTimeInMillis.TryRead(ref reader, options, PropCompletionTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propExpirationTime.TryRead(ref reader, options, PropExpirationTime))
+ {
+ continue;
+ }
+
+ if (propExpirationTimeInMillis.TryRead(ref reader, options, PropExpirationTimeInMillis))
+ {
+ continue;
+ }
+
+ if (propId.TryRead(ref reader, options, PropId))
+ {
+ continue;
+ }
+
+ if (propIsPartial.TryRead(ref reader, options, PropIsPartial))
+ {
+ continue;
+ }
+
+ if (propIsRunning.TryRead(ref reader, options, PropIsRunning))
+ {
+ continue;
+ }
+
+ if (propResponse.TryRead(ref reader, options, PropResponse))
+ {
+ continue;
+ }
+
+ if (propStartTime.TryRead(ref reader, options, PropStartTime))
+ {
+ continue;
+ }
+
+ if (propStartTimeInMillis.TryRead(ref reader, options, PropStartTimeInMillis))
+ {
+ 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 SubmitAsyncSearchResponse
+ {
+ CompletionTime = propCompletionTime.Value
+,
+ CompletionTimeInMillis = propCompletionTimeInMillis.Value
+,
+ ExpirationTime = propExpirationTime.Value
+,
+ ExpirationTimeInMillis = propExpirationTimeInMillis.Value
+,
+ Id = propId.Value
+,
+ IsPartial = propIsPartial.Value
+,
+ IsRunning = propIsRunning.Value
+,
+ Response = propResponse.Value
+,
+ StartTime = propStartTime.Value
+,
+ StartTimeInMillis = propStartTimeInMillis.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, SubmitAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropCompletionTime, value.CompletionTime);
+ writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis);
+ writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime);
+ writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis);
+ writer.WriteProperty(options, PropId, value.Id);
+ writer.WriteProperty(options, PropIsPartial, value.IsPartial);
+ writer.WriteProperty(options, PropIsRunning, value.IsRunning);
+ writer.WriteProperty(options, PropResponse, value.Response);
+ writer.WriteProperty(options, PropStartTime, value.StartTime);
+ writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis);
+ writer.WriteEndObject();
+ }
+}
+
+internal sealed partial class SubmitAsyncSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory
+{
+ public override bool CanConvert(System.Type typeToConvert)
+ {
+ return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SubmitAsyncSearchResponse<>);
+ }
+
+ public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ var args = typeToConvert.GetGenericArguments();
+#pragma warning disable IL3050
+ var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SubmitAsyncSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!;
+#pragma warning restore IL3050
+ return converter;
+ }
+}
+
+[JsonConverter(typeof(SubmitAsyncSearchResponseConverterFactory))]
public sealed partial class SubmitAsyncSearchResponse : ElasticsearchResponse
{
///
@@ -34,9 +178,7 @@ public sealed partial class SubmitAsyncSearchResponse : Elasticsearch
/// when the search has completed.
///
///
- [JsonInclude, JsonPropertyName("completion_time")]
public DateTimeOffset? CompletionTime { get; init; }
- [JsonInclude, JsonPropertyName("completion_time_in_millis")]
public long? CompletionTimeInMillis { get; init; }
///
@@ -44,11 +186,8 @@ public sealed partial class SubmitAsyncSearchResponse : Elasticsearch
/// Indicates when the async search will expire.
///
///
- [JsonInclude, JsonPropertyName("expiration_time")]
public DateTimeOffset? ExpirationTime { get; init; }
- [JsonInclude, JsonPropertyName("expiration_time_in_millis")]
public long ExpirationTimeInMillis { get; init; }
- [JsonInclude, JsonPropertyName("id")]
public string? Id { get; init; }
///
@@ -57,7 +196,6 @@ public sealed partial class SubmitAsyncSearchResponse : Elasticsearch
/// While the query is running, is_partial is always set to true.
///
///
- [JsonInclude, JsonPropertyName("is_partial")]
public bool IsPartial { get; init; }
///
@@ -66,12 +204,8 @@ public sealed partial class SubmitAsyncSearchResponse : Elasticsearch
/// NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
///
///
- [JsonInclude, JsonPropertyName("is_running")]
public bool IsRunning { get; init; }
- [JsonInclude, JsonPropertyName("response")]
public Elastic.Clients.Elasticsearch.Serverless.AsyncSearch.AsyncSearch Response { get; init; }
- [JsonInclude, JsonPropertyName("start_time")]
public DateTimeOffset? StartTime { get; init; }
- [JsonInclude, JsonPropertyName("start_time_in_millis")]
public long StartTimeInMillis { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs
index 6540f2c9a6c..47b7600bf46 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/BulkResponse.g.cs
@@ -18,20 +18,74 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless;
+internal sealed partial class BulkResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors");
+ private static readonly System.Text.Json.JsonEncodedText PropIngestTook = System.Text.Json.JsonEncodedText.Encode("ingest_took");
+ private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took");
+
+ public override BulkResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propErrors = default;
+ LocalJsonProperty propIngestTook = default;
+ LocalJsonProperty propTook = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propErrors.TryRead(ref reader, options, PropErrors))
+ {
+ continue;
+ }
+
+ if (propIngestTook.TryRead(ref reader, options, PropIngestTook))
+ {
+ continue;
+ }
+
+ if (propTook.TryRead(ref reader, options, PropTook))
+ {
+ 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 BulkResponse
+ {
+ Errors = propErrors.Value
+,
+ IngestTook = propIngestTook.Value
+,
+ Took = propTook.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, BulkResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropErrors, value.Errors);
+ writer.WriteProperty(options, PropIngestTook, value.IngestTook);
+ writer.WriteProperty(options, PropTook, value.Took);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(BulkResponseConverter))]
public sealed partial class BulkResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("errors")]
public bool Errors { get; init; }
- [JsonInclude, JsonPropertyName("ingest_took")]
public long? IngestTook { get; init; }
- [JsonInclude, JsonPropertyName("took")]
public long Took { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs
index 121e9946eb2..f2b8b4d4ac3 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClearScrollResponse.g.cs
@@ -18,18 +18,63 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless;
+internal sealed partial class ClearScrollResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropNumFreed = System.Text.Json.JsonEncodedText.Encode("num_freed");
+ private static readonly System.Text.Json.JsonEncodedText PropSucceeded = System.Text.Json.JsonEncodedText.Encode("succeeded");
+
+ public override ClearScrollResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propNumFreed = default;
+ LocalJsonProperty propSucceeded = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propNumFreed.TryRead(ref reader, options, PropNumFreed))
+ {
+ continue;
+ }
+
+ if (propSucceeded.TryRead(ref reader, options, PropSucceeded))
+ {
+ 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 ClearScrollResponse
+ {
+ NumFreed = propNumFreed.Value
+,
+ Succeeded = propSucceeded.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, ClearScrollResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropNumFreed, value.NumFreed);
+ writer.WriteProperty(options, PropSucceeded, value.Succeeded);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(ClearScrollResponseConverter))]
public sealed partial class ClearScrollResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("num_freed")]
public int NumFreed { get; init; }
- [JsonInclude, JsonPropertyName("succeeded")]
public bool Succeeded { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs
index e12e0397740..a62832bb505 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ClosePointInTimeResponse.g.cs
@@ -18,18 +18,63 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless;
+internal sealed partial class ClosePointInTimeResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropNumFreed = System.Text.Json.JsonEncodedText.Encode("num_freed");
+ private static readonly System.Text.Json.JsonEncodedText PropSucceeded = System.Text.Json.JsonEncodedText.Encode("succeeded");
+
+ public override ClosePointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propNumFreed = default;
+ LocalJsonProperty propSucceeded = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propNumFreed.TryRead(ref reader, options, PropNumFreed))
+ {
+ continue;
+ }
+
+ if (propSucceeded.TryRead(ref reader, options, PropSucceeded))
+ {
+ 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 ClosePointInTimeResponse
+ {
+ NumFreed = propNumFreed.Value
+,
+ Succeeded = propSucceeded.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, ClosePointInTimeResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropNumFreed, value.NumFreed);
+ writer.WriteProperty(options, PropSucceeded, value.Succeeded);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(ClosePointInTimeResponseConverter))]
public sealed partial class ClosePointInTimeResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("num_freed")]
public int NumFreed { get; init; }
- [JsonInclude, JsonPropertyName("succeeded")]
public bool Succeeded { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs
index ce1cf06e5b0..bc58e78369b 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/AllocationExplainResponse.g.cs
@@ -18,64 +18,316 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class AllocationExplainResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropAllocateExplanation = System.Text.Json.JsonEncodedText.Encode("allocate_explanation");
+ private static readonly System.Text.Json.JsonEncodedText PropAllocationDelay = System.Text.Json.JsonEncodedText.Encode("allocation_delay");
+ private static readonly System.Text.Json.JsonEncodedText PropAllocationDelayInMillis = System.Text.Json.JsonEncodedText.Encode("allocation_delay_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropCanAllocate = System.Text.Json.JsonEncodedText.Encode("can_allocate");
+ private static readonly System.Text.Json.JsonEncodedText PropCanMoveToOtherNode = System.Text.Json.JsonEncodedText.Encode("can_move_to_other_node");
+ private static readonly System.Text.Json.JsonEncodedText PropCanRebalanceCluster = System.Text.Json.JsonEncodedText.Encode("can_rebalance_cluster");
+ private static readonly System.Text.Json.JsonEncodedText PropCanRebalanceClusterDecisions = System.Text.Json.JsonEncodedText.Encode("can_rebalance_cluster_decisions");
+ private static readonly System.Text.Json.JsonEncodedText PropCanRebalanceToOtherNode = System.Text.Json.JsonEncodedText.Encode("can_rebalance_to_other_node");
+ private static readonly System.Text.Json.JsonEncodedText PropCanRemainDecisions = System.Text.Json.JsonEncodedText.Encode("can_remain_decisions");
+ private static readonly System.Text.Json.JsonEncodedText PropCanRemainOnCurrentNode = System.Text.Json.JsonEncodedText.Encode("can_remain_on_current_node");
+ private static readonly System.Text.Json.JsonEncodedText PropClusterInfo = System.Text.Json.JsonEncodedText.Encode("cluster_info");
+ private static readonly System.Text.Json.JsonEncodedText PropConfiguredDelay = System.Text.Json.JsonEncodedText.Encode("configured_delay");
+ private static readonly System.Text.Json.JsonEncodedText PropConfiguredDelayInMillis = System.Text.Json.JsonEncodedText.Encode("configured_delay_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropCurrentNode = System.Text.Json.JsonEncodedText.Encode("current_node");
+ private static readonly System.Text.Json.JsonEncodedText PropCurrentState = System.Text.Json.JsonEncodedText.Encode("current_state");
+ private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index");
+ private static readonly System.Text.Json.JsonEncodedText PropMoveExplanation = System.Text.Json.JsonEncodedText.Encode("move_explanation");
+ private static readonly System.Text.Json.JsonEncodedText PropNodeAllocationDecisions = System.Text.Json.JsonEncodedText.Encode("node_allocation_decisions");
+ private static readonly System.Text.Json.JsonEncodedText PropNote = System.Text.Json.JsonEncodedText.Encode("note");
+ private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary");
+ private static readonly System.Text.Json.JsonEncodedText PropRebalanceExplanation = System.Text.Json.JsonEncodedText.Encode("rebalance_explanation");
+ private static readonly System.Text.Json.JsonEncodedText PropRemainingDelay = System.Text.Json.JsonEncodedText.Encode("remaining_delay");
+ private static readonly System.Text.Json.JsonEncodedText PropRemainingDelayInMillis = System.Text.Json.JsonEncodedText.Encode("remaining_delay_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard");
+ private static readonly System.Text.Json.JsonEncodedText PropUnassignedInfo = System.Text.Json.JsonEncodedText.Encode("unassigned_info");
+
+ public override AllocationExplainResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propAllocateExplanation = default;
+ LocalJsonProperty propAllocationDelay = default;
+ LocalJsonProperty propAllocationDelayInMillis = default;
+ LocalJsonProperty propCanAllocate = default;
+ LocalJsonProperty propCanMoveToOtherNode = default;
+ LocalJsonProperty propCanRebalanceCluster = default;
+ LocalJsonProperty?> propCanRebalanceClusterDecisions = default;
+ LocalJsonProperty propCanRebalanceToOtherNode = default;
+ LocalJsonProperty?> propCanRemainDecisions = default;
+ LocalJsonProperty propCanRemainOnCurrentNode = default;
+ LocalJsonProperty propClusterInfo = default;
+ LocalJsonProperty propConfiguredDelay = default;
+ LocalJsonProperty propConfiguredDelayInMillis = default;
+ LocalJsonProperty propCurrentNode = default;
+ LocalJsonProperty propCurrentState = default;
+ LocalJsonProperty propIndex = default;
+ LocalJsonProperty propMoveExplanation = default;
+ LocalJsonProperty?> propNodeAllocationDecisions = default;
+ LocalJsonProperty propNote = default;
+ LocalJsonProperty propPrimary = default;
+ LocalJsonProperty propRebalanceExplanation = default;
+ LocalJsonProperty propRemainingDelay = default;
+ LocalJsonProperty propRemainingDelayInMillis = default;
+ LocalJsonProperty propShard = default;
+ LocalJsonProperty propUnassignedInfo = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAllocateExplanation.TryRead(ref reader, options, PropAllocateExplanation))
+ {
+ continue;
+ }
+
+ if (propAllocationDelay.TryRead(ref reader, options, PropAllocationDelay))
+ {
+ continue;
+ }
+
+ if (propAllocationDelayInMillis.TryRead(ref reader, options, PropAllocationDelayInMillis))
+ {
+ continue;
+ }
+
+ if (propCanAllocate.TryRead(ref reader, options, PropCanAllocate))
+ {
+ continue;
+ }
+
+ if (propCanMoveToOtherNode.TryRead(ref reader, options, PropCanMoveToOtherNode))
+ {
+ continue;
+ }
+
+ if (propCanRebalanceCluster.TryRead(ref reader, options, PropCanRebalanceCluster))
+ {
+ continue;
+ }
+
+ if (propCanRebalanceClusterDecisions.TryRead(ref reader, options, PropCanRebalanceClusterDecisions))
+ {
+ continue;
+ }
+
+ if (propCanRebalanceToOtherNode.TryRead(ref reader, options, PropCanRebalanceToOtherNode))
+ {
+ continue;
+ }
+
+ if (propCanRemainDecisions.TryRead(ref reader, options, PropCanRemainDecisions))
+ {
+ continue;
+ }
+
+ if (propCanRemainOnCurrentNode.TryRead(ref reader, options, PropCanRemainOnCurrentNode))
+ {
+ continue;
+ }
+
+ if (propClusterInfo.TryRead(ref reader, options, PropClusterInfo))
+ {
+ continue;
+ }
+
+ if (propConfiguredDelay.TryRead(ref reader, options, PropConfiguredDelay))
+ {
+ continue;
+ }
+
+ if (propConfiguredDelayInMillis.TryRead(ref reader, options, PropConfiguredDelayInMillis))
+ {
+ continue;
+ }
+
+ if (propCurrentNode.TryRead(ref reader, options, PropCurrentNode))
+ {
+ continue;
+ }
+
+ if (propCurrentState.TryRead(ref reader, options, PropCurrentState))
+ {
+ continue;
+ }
+
+ if (propIndex.TryRead(ref reader, options, PropIndex))
+ {
+ continue;
+ }
+
+ if (propMoveExplanation.TryRead(ref reader, options, PropMoveExplanation))
+ {
+ continue;
+ }
+
+ if (propNodeAllocationDecisions.TryRead(ref reader, options, PropNodeAllocationDecisions))
+ {
+ continue;
+ }
+
+ if (propNote.TryRead(ref reader, options, PropNote))
+ {
+ continue;
+ }
+
+ if (propPrimary.TryRead(ref reader, options, PropPrimary))
+ {
+ continue;
+ }
+
+ if (propRebalanceExplanation.TryRead(ref reader, options, PropRebalanceExplanation))
+ {
+ continue;
+ }
+
+ if (propRemainingDelay.TryRead(ref reader, options, PropRemainingDelay))
+ {
+ continue;
+ }
+
+ if (propRemainingDelayInMillis.TryRead(ref reader, options, PropRemainingDelayInMillis))
+ {
+ continue;
+ }
+
+ if (propShard.TryRead(ref reader, options, PropShard))
+ {
+ continue;
+ }
+
+ if (propUnassignedInfo.TryRead(ref reader, options, PropUnassignedInfo))
+ {
+ 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 AllocationExplainResponse
+ {
+ AllocateExplanation = propAllocateExplanation.Value
+,
+ AllocationDelay = propAllocationDelay.Value
+,
+ AllocationDelayInMillis = propAllocationDelayInMillis.Value
+,
+ CanAllocate = propCanAllocate.Value
+,
+ CanMoveToOtherNode = propCanMoveToOtherNode.Value
+,
+ CanRebalanceCluster = propCanRebalanceCluster.Value
+,
+ CanRebalanceClusterDecisions = propCanRebalanceClusterDecisions.Value
+,
+ CanRebalanceToOtherNode = propCanRebalanceToOtherNode.Value
+,
+ CanRemainDecisions = propCanRemainDecisions.Value
+,
+ CanRemainOnCurrentNode = propCanRemainOnCurrentNode.Value
+,
+ ClusterInfo = propClusterInfo.Value
+,
+ ConfiguredDelay = propConfiguredDelay.Value
+,
+ ConfiguredDelayInMillis = propConfiguredDelayInMillis.Value
+,
+ CurrentNode = propCurrentNode.Value
+,
+ CurrentState = propCurrentState.Value
+,
+ Index = propIndex.Value
+,
+ MoveExplanation = propMoveExplanation.Value
+,
+ NodeAllocationDecisions = propNodeAllocationDecisions.Value
+,
+ Note = propNote.Value
+,
+ Primary = propPrimary.Value
+,
+ RebalanceExplanation = propRebalanceExplanation.Value
+,
+ RemainingDelay = propRemainingDelay.Value
+,
+ RemainingDelayInMillis = propRemainingDelayInMillis.Value
+,
+ Shard = propShard.Value
+,
+ UnassignedInfo = propUnassignedInfo.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, AllocationExplainResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAllocateExplanation, value.AllocateExplanation);
+ writer.WriteProperty(options, PropAllocationDelay, value.AllocationDelay);
+ writer.WriteProperty(options, PropAllocationDelayInMillis, value.AllocationDelayInMillis);
+ writer.WriteProperty(options, PropCanAllocate, value.CanAllocate);
+ writer.WriteProperty(options, PropCanMoveToOtherNode, value.CanMoveToOtherNode);
+ writer.WriteProperty(options, PropCanRebalanceCluster, value.CanRebalanceCluster);
+ writer.WriteProperty(options, PropCanRebalanceClusterDecisions, value.CanRebalanceClusterDecisions);
+ writer.WriteProperty(options, PropCanRebalanceToOtherNode, value.CanRebalanceToOtherNode);
+ writer.WriteProperty(options, PropCanRemainDecisions, value.CanRemainDecisions);
+ writer.WriteProperty(options, PropCanRemainOnCurrentNode, value.CanRemainOnCurrentNode);
+ writer.WriteProperty(options, PropClusterInfo, value.ClusterInfo);
+ writer.WriteProperty(options, PropConfiguredDelay, value.ConfiguredDelay);
+ writer.WriteProperty(options, PropConfiguredDelayInMillis, value.ConfiguredDelayInMillis);
+ writer.WriteProperty(options, PropCurrentNode, value.CurrentNode);
+ writer.WriteProperty(options, PropCurrentState, value.CurrentState);
+ writer.WriteProperty(options, PropIndex, value.Index);
+ writer.WriteProperty(options, PropMoveExplanation, value.MoveExplanation);
+ writer.WriteProperty(options, PropNodeAllocationDecisions, value.NodeAllocationDecisions);
+ writer.WriteProperty(options, PropNote, value.Note);
+ writer.WriteProperty(options, PropPrimary, value.Primary);
+ writer.WriteProperty(options, PropRebalanceExplanation, value.RebalanceExplanation);
+ writer.WriteProperty(options, PropRemainingDelay, value.RemainingDelay);
+ writer.WriteProperty(options, PropRemainingDelayInMillis, value.RemainingDelayInMillis);
+ writer.WriteProperty(options, PropShard, value.Shard);
+ writer.WriteProperty(options, PropUnassignedInfo, value.UnassignedInfo);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(AllocationExplainResponseConverter))]
public sealed partial class AllocationExplainResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("allocate_explanation")]
public string? AllocateExplanation { get; init; }
- [JsonInclude, JsonPropertyName("allocation_delay")]
public Elastic.Clients.Elasticsearch.Serverless.Duration? AllocationDelay { get; init; }
- [JsonInclude, JsonPropertyName("allocation_delay_in_millis")]
public long? AllocationDelayInMillis { get; init; }
- [JsonInclude, JsonPropertyName("can_allocate")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanAllocate { get; init; }
- [JsonInclude, JsonPropertyName("can_move_to_other_node")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanMoveToOtherNode { get; init; }
- [JsonInclude, JsonPropertyName("can_rebalance_cluster")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRebalanceCluster { get; init; }
- [JsonInclude, JsonPropertyName("can_rebalance_cluster_decisions")]
public IReadOnlyCollection? CanRebalanceClusterDecisions { get; init; }
- [JsonInclude, JsonPropertyName("can_rebalance_to_other_node")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRebalanceToOtherNode { get; init; }
- [JsonInclude, JsonPropertyName("can_remain_decisions")]
public IReadOnlyCollection? CanRemainDecisions { get; init; }
- [JsonInclude, JsonPropertyName("can_remain_on_current_node")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.Decision? CanRemainOnCurrentNode { get; init; }
- [JsonInclude, JsonPropertyName("cluster_info")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterInfo? ClusterInfo { get; init; }
- [JsonInclude, JsonPropertyName("configured_delay")]
public Elastic.Clients.Elasticsearch.Serverless.Duration? ConfiguredDelay { get; init; }
- [JsonInclude, JsonPropertyName("configured_delay_in_millis")]
public long? ConfiguredDelayInMillis { get; init; }
- [JsonInclude, JsonPropertyName("current_node")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.CurrentNode? CurrentNode { get; init; }
- [JsonInclude, JsonPropertyName("current_state")]
public string CurrentState { get; init; }
- [JsonInclude, JsonPropertyName("index")]
public string Index { get; init; }
- [JsonInclude, JsonPropertyName("move_explanation")]
public string? MoveExplanation { get; init; }
- [JsonInclude, JsonPropertyName("node_allocation_decisions")]
public IReadOnlyCollection? NodeAllocationDecisions { get; init; }
- [JsonInclude, JsonPropertyName("note")]
public string? Note { get; init; }
- [JsonInclude, JsonPropertyName("primary")]
public bool Primary { get; init; }
- [JsonInclude, JsonPropertyName("rebalance_explanation")]
public string? RebalanceExplanation { get; init; }
- [JsonInclude, JsonPropertyName("remaining_delay")]
public Elastic.Clients.Elasticsearch.Serverless.Duration? RemainingDelay { get; init; }
- [JsonInclude, JsonPropertyName("remaining_delay_in_millis")]
public long? RemainingDelayInMillis { get; init; }
- [JsonInclude, JsonPropertyName("shard")]
public int Shard { get; init; }
- [JsonInclude, JsonPropertyName("unassigned_info")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.UnassignedInformation? UnassignedInfo { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs
index 6c4a5a88c82..29892443165 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterInfoResponse.g.cs
@@ -18,24 +18,96 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class ClusterInfoResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropClusterName = System.Text.Json.JsonEncodedText.Encode("cluster_name");
+ private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http");
+ private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest");
+ private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script");
+ private static readonly System.Text.Json.JsonEncodedText PropThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool");
+
+ public override ClusterInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propClusterName = default;
+ LocalJsonProperty propHttp = default;
+ LocalJsonProperty propIngest = default;
+ LocalJsonProperty propScript = default;
+ LocalJsonProperty?> propThreadPool = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propClusterName.TryRead(ref reader, options, PropClusterName))
+ {
+ continue;
+ }
+
+ if (propHttp.TryRead(ref reader, options, PropHttp))
+ {
+ continue;
+ }
+
+ if (propIngest.TryRead(ref reader, options, PropIngest))
+ {
+ continue;
+ }
+
+ if (propScript.TryRead(ref reader, options, PropScript))
+ {
+ continue;
+ }
+
+ if (propThreadPool.TryRead(ref reader, options, PropThreadPool))
+ {
+ 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 ClusterInfoResponse
+ {
+ ClusterName = propClusterName.Value
+,
+ Http = propHttp.Value
+,
+ Ingest = propIngest.Value
+,
+ Script = propScript.Value
+,
+ ThreadPool = propThreadPool.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, ClusterInfoResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropClusterName, value.ClusterName);
+ writer.WriteProperty(options, PropHttp, value.Http);
+ writer.WriteProperty(options, PropIngest, value.Ingest);
+ writer.WriteProperty(options, PropScript, value.Script);
+ writer.WriteProperty(options, PropThreadPool, value.ThreadPool);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(ClusterInfoResponseConverter))]
public sealed partial class ClusterInfoResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("cluster_name")]
public string ClusterName { get; init; }
- [JsonInclude, JsonPropertyName("http")]
public Elastic.Clients.Elasticsearch.Serverless.Nodes.Http? Http { get; init; }
- [JsonInclude, JsonPropertyName("ingest")]
public Elastic.Clients.Elasticsearch.Serverless.Nodes.Ingest? Ingest { get; init; }
- [JsonInclude, JsonPropertyName("script")]
public Elastic.Clients.Elasticsearch.Serverless.Nodes.Scripting? Script { get; init; }
- [JsonInclude, JsonPropertyName("thread_pool")]
public IReadOnlyDictionary? ThreadPool { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs
index 12d77b02a34..b70f1ad6d9a 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/ClusterStatsResponse.g.cs
@@ -18,14 +18,111 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class ClusterStatsResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropClusterName = System.Text.Json.JsonEncodedText.Encode("cluster_name");
+ private static readonly System.Text.Json.JsonEncodedText PropClusterUuid = System.Text.Json.JsonEncodedText.Encode("cluster_uuid");
+ private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices");
+ private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes");
+ private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes");
+ private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status");
+ private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp");
+
+ public override ClusterStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propClusterName = default;
+ LocalJsonProperty propClusterUuid = default;
+ LocalJsonProperty propIndices = default;
+ LocalJsonProperty propNodes = default;
+ LocalJsonProperty propNodeStats = default;
+ LocalJsonProperty propStatus = default;
+ LocalJsonProperty propTimestamp = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propClusterName.TryRead(ref reader, options, PropClusterName))
+ {
+ continue;
+ }
+
+ if (propClusterUuid.TryRead(ref reader, options, PropClusterUuid))
+ {
+ continue;
+ }
+
+ if (propIndices.TryRead(ref reader, options, PropIndices))
+ {
+ continue;
+ }
+
+ if (propNodes.TryRead(ref reader, options, PropNodes))
+ {
+ continue;
+ }
+
+ if (propNodeStats.TryRead(ref reader, options, PropNodeStats))
+ {
+ continue;
+ }
+
+ if (propStatus.TryRead(ref reader, options, PropStatus))
+ {
+ continue;
+ }
+
+ if (propTimestamp.TryRead(ref reader, options, PropTimestamp))
+ {
+ 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 ClusterStatsResponse
+ {
+ ClusterName = propClusterName.Value
+,
+ ClusterUuid = propClusterUuid.Value
+,
+ Indices = propIndices.Value
+,
+ Nodes = propNodes.Value
+,
+ NodeStats = propNodeStats.Value
+,
+ Status = propStatus.Value
+,
+ Timestamp = propTimestamp.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, ClusterStatsResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropClusterName, value.ClusterName);
+ writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid);
+ writer.WriteProperty(options, PropIndices, value.Indices);
+ writer.WriteProperty(options, PropNodes, value.Nodes);
+ writer.WriteProperty(options, PropNodeStats, value.NodeStats);
+ writer.WriteProperty(options, PropStatus, value.Status);
+ writer.WriteProperty(options, PropTimestamp, value.Timestamp);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(ClusterStatsResponseConverter))]
public sealed partial class ClusterStatsResponse : ElasticsearchResponse
{
///
@@ -33,7 +130,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Name of the cluster, based on the cluster name setting.
///
///
- [JsonInclude, JsonPropertyName("cluster_name")]
public string ClusterName { get; init; }
///
@@ -41,7 +137,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Unique identifier for the cluster.
///
///
- [JsonInclude, JsonPropertyName("cluster_uuid")]
public string ClusterUuid { get; init; }
///
@@ -49,7 +144,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Contains statistics about indices with shards assigned to selected nodes.
///
///
- [JsonInclude, JsonPropertyName("indices")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterIndices Indices { get; init; }
///
@@ -57,7 +151,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Contains statistics about nodes selected by the request’s node filters.
///
///
- [JsonInclude, JsonPropertyName("nodes")]
public Elastic.Clients.Elasticsearch.Serverless.Cluster.ClusterNodes Nodes { get; init; }
///
@@ -65,7 +158,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Contains statistics about the number of nodes selected by the request’s node filters.
///
///
- [JsonInclude, JsonPropertyName("_nodes")]
public Elastic.Clients.Elasticsearch.Serverless.NodeStatistics? NodeStats { get; init; }
///
@@ -73,7 +165,6 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Health status of the cluster, based on the state of its primary and replica shards.
///
///
- [JsonInclude, JsonPropertyName("status")]
public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; }
///
@@ -81,6 +172,5 @@ public sealed partial class ClusterStatsResponse : ElasticsearchResponse
/// Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed.
///
///
- [JsonInclude, JsonPropertyName("timestamp")]
public long Timestamp { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs
index e0f3c244fef..8d636827853 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs
@@ -18,14 +18,51 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class DeleteComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged");
+
+ public override DeleteComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propAcknowledged = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAcknowledged.TryRead(ref reader, options, PropAcknowledged))
+ {
+ 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 DeleteComponentTemplateResponse
+ {
+ Acknowledged = propAcknowledged.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, DeleteComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAcknowledged, value.Acknowledged);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(DeleteComponentTemplateResponseConverter))]
public sealed partial class DeleteComponentTemplateResponse : ElasticsearchResponse
{
///
@@ -33,6 +70,5 @@ public sealed partial class DeleteComponentTemplateResponse : ElasticsearchRespo
/// For a successful response, this value is always true. On failure, an exception is returned instead.
///
///
- [JsonInclude, JsonPropertyName("acknowledged")]
public bool Acknowledged { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs
index 01f99ea2bce..02f306dd8aa 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs
@@ -18,20 +18,74 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class GetClusterSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropDefaults = System.Text.Json.JsonEncodedText.Encode("defaults");
+ private static readonly System.Text.Json.JsonEncodedText PropPersistent = System.Text.Json.JsonEncodedText.Encode("persistent");
+ private static readonly System.Text.Json.JsonEncodedText PropTransient = System.Text.Json.JsonEncodedText.Encode("transient");
+
+ public override GetClusterSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty?> propDefaults = default;
+ LocalJsonProperty> propPersistent = default;
+ LocalJsonProperty> propTransient = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propDefaults.TryRead(ref reader, options, PropDefaults))
+ {
+ continue;
+ }
+
+ if (propPersistent.TryRead(ref reader, options, PropPersistent))
+ {
+ continue;
+ }
+
+ if (propTransient.TryRead(ref reader, options, PropTransient))
+ {
+ 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 GetClusterSettingsResponse
+ {
+ Defaults = propDefaults.Value
+,
+ Persistent = propPersistent.Value
+,
+ Transient = propTransient.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, GetClusterSettingsResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropDefaults, value.Defaults);
+ writer.WriteProperty(options, PropPersistent, value.Persistent);
+ writer.WriteProperty(options, PropTransient, value.Transient);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(GetClusterSettingsResponseConverter))]
public sealed partial class GetClusterSettingsResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("defaults")]
public IReadOnlyDictionary? Defaults { get; init; }
- [JsonInclude, JsonPropertyName("persistent")]
public IReadOnlyDictionary Persistent { get; init; }
- [JsonInclude, JsonPropertyName("transient")]
public IReadOnlyDictionary Transient { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs
index 949e435bcb1..9b3062fb043 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs
@@ -18,16 +18,52 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class GetComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropComponentTemplates = System.Text.Json.JsonEncodedText.Encode("component_templates");
+
+ public override GetComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty> propComponentTemplates = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propComponentTemplates.TryRead(ref reader, options, PropComponentTemplates))
+ {
+ 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 GetComponentTemplateResponse
+ {
+ ComponentTemplates = propComponentTemplates.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, GetComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropComponentTemplates, value.ComponentTemplates);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(GetComponentTemplateResponseConverter))]
public sealed partial class GetComponentTemplateResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("component_templates")]
public IReadOnlyCollection ComponentTemplates { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs
index 609d064dd95..2ca8e700a19 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/HealthResponse.g.cs
@@ -18,14 +18,221 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class HealthResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropActivePrimaryShards = System.Text.Json.JsonEncodedText.Encode("active_primary_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropActiveShards = System.Text.Json.JsonEncodedText.Encode("active_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropActiveShardsPercentAsNumber = System.Text.Json.JsonEncodedText.Encode("active_shards_percent_as_number");
+ private static readonly System.Text.Json.JsonEncodedText PropClusterName = System.Text.Json.JsonEncodedText.Encode("cluster_name");
+ private static readonly System.Text.Json.JsonEncodedText PropDelayedUnassignedShards = System.Text.Json.JsonEncodedText.Encode("delayed_unassigned_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices");
+ private static readonly System.Text.Json.JsonEncodedText PropInitializingShards = System.Text.Json.JsonEncodedText.Encode("initializing_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropNumberOfDataNodes = System.Text.Json.JsonEncodedText.Encode("number_of_data_nodes");
+ private static readonly System.Text.Json.JsonEncodedText PropNumberOfInFlightFetch = System.Text.Json.JsonEncodedText.Encode("number_of_in_flight_fetch");
+ private static readonly System.Text.Json.JsonEncodedText PropNumberOfNodes = System.Text.Json.JsonEncodedText.Encode("number_of_nodes");
+ private static readonly System.Text.Json.JsonEncodedText PropNumberOfPendingTasks = System.Text.Json.JsonEncodedText.Encode("number_of_pending_tasks");
+ private static readonly System.Text.Json.JsonEncodedText PropRelocatingShards = System.Text.Json.JsonEncodedText.Encode("relocating_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status");
+ private static readonly System.Text.Json.JsonEncodedText PropTaskMaxWaitingInQueue = System.Text.Json.JsonEncodedText.Encode("task_max_waiting_in_queue");
+ private static readonly System.Text.Json.JsonEncodedText PropTaskMaxWaitingInQueueMillis = System.Text.Json.JsonEncodedText.Encode("task_max_waiting_in_queue_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out");
+ private static readonly System.Text.Json.JsonEncodedText PropUnassignedPrimaryShards = System.Text.Json.JsonEncodedText.Encode("unassigned_primary_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropUnassignedShards = System.Text.Json.JsonEncodedText.Encode("unassigned_shards");
+
+ public override HealthResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty propActivePrimaryShards = default;
+ LocalJsonProperty propActiveShards = default;
+ LocalJsonProperty propActiveShardsPercentAsNumber = default;
+ LocalJsonProperty propClusterName = default;
+ LocalJsonProperty propDelayedUnassignedShards = default;
+ LocalJsonProperty?> propIndices = default;
+ LocalJsonProperty propInitializingShards = default;
+ LocalJsonProperty propNumberOfDataNodes = default;
+ LocalJsonProperty propNumberOfInFlightFetch = default;
+ LocalJsonProperty propNumberOfNodes = default;
+ LocalJsonProperty propNumberOfPendingTasks = default;
+ LocalJsonProperty propRelocatingShards = default;
+ LocalJsonProperty propStatus = default;
+ LocalJsonProperty propTaskMaxWaitingInQueue = default;
+ LocalJsonProperty propTaskMaxWaitingInQueueMillis = default;
+ LocalJsonProperty propTimedOut = default;
+ LocalJsonProperty propUnassignedPrimaryShards = default;
+ LocalJsonProperty propUnassignedShards = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propActivePrimaryShards.TryRead(ref reader, options, PropActivePrimaryShards))
+ {
+ continue;
+ }
+
+ if (propActiveShards.TryRead(ref reader, options, PropActiveShards))
+ {
+ continue;
+ }
+
+ if (propActiveShardsPercentAsNumber.TryRead(ref reader, options, PropActiveShardsPercentAsNumber))
+ {
+ continue;
+ }
+
+ if (propClusterName.TryRead(ref reader, options, PropClusterName))
+ {
+ continue;
+ }
+
+ if (propDelayedUnassignedShards.TryRead(ref reader, options, PropDelayedUnassignedShards))
+ {
+ continue;
+ }
+
+ if (propIndices.TryRead(ref reader, options, PropIndices))
+ {
+ continue;
+ }
+
+ if (propInitializingShards.TryRead(ref reader, options, PropInitializingShards))
+ {
+ continue;
+ }
+
+ if (propNumberOfDataNodes.TryRead(ref reader, options, PropNumberOfDataNodes))
+ {
+ continue;
+ }
+
+ if (propNumberOfInFlightFetch.TryRead(ref reader, options, PropNumberOfInFlightFetch))
+ {
+ continue;
+ }
+
+ if (propNumberOfNodes.TryRead(ref reader, options, PropNumberOfNodes))
+ {
+ continue;
+ }
+
+ if (propNumberOfPendingTasks.TryRead(ref reader, options, PropNumberOfPendingTasks))
+ {
+ continue;
+ }
+
+ if (propRelocatingShards.TryRead(ref reader, options, PropRelocatingShards))
+ {
+ continue;
+ }
+
+ if (propStatus.TryRead(ref reader, options, PropStatus))
+ {
+ continue;
+ }
+
+ if (propTaskMaxWaitingInQueue.TryRead(ref reader, options, PropTaskMaxWaitingInQueue))
+ {
+ continue;
+ }
+
+ if (propTaskMaxWaitingInQueueMillis.TryRead(ref reader, options, PropTaskMaxWaitingInQueueMillis))
+ {
+ continue;
+ }
+
+ if (propTimedOut.TryRead(ref reader, options, PropTimedOut))
+ {
+ continue;
+ }
+
+ if (propUnassignedPrimaryShards.TryRead(ref reader, options, PropUnassignedPrimaryShards))
+ {
+ continue;
+ }
+
+ if (propUnassignedShards.TryRead(ref reader, options, PropUnassignedShards))
+ {
+ 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 HealthResponse
+ {
+ ActivePrimaryShards = propActivePrimaryShards.Value
+,
+ ActiveShards = propActiveShards.Value
+,
+ ActiveShardsPercentAsNumber = propActiveShardsPercentAsNumber.Value
+,
+ ClusterName = propClusterName.Value
+,
+ DelayedUnassignedShards = propDelayedUnassignedShards.Value
+,
+ Indices = propIndices.Value
+,
+ InitializingShards = propInitializingShards.Value
+,
+ NumberOfDataNodes = propNumberOfDataNodes.Value
+,
+ NumberOfInFlightFetch = propNumberOfInFlightFetch.Value
+,
+ NumberOfNodes = propNumberOfNodes.Value
+,
+ NumberOfPendingTasks = propNumberOfPendingTasks.Value
+,
+ RelocatingShards = propRelocatingShards.Value
+,
+ Status = propStatus.Value
+,
+ TaskMaxWaitingInQueue = propTaskMaxWaitingInQueue.Value
+,
+ TaskMaxWaitingInQueueMillis = propTaskMaxWaitingInQueueMillis.Value
+,
+ TimedOut = propTimedOut.Value
+,
+ UnassignedPrimaryShards = propUnassignedPrimaryShards.Value
+,
+ UnassignedShards = propUnassignedShards.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, HealthResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropActivePrimaryShards, value.ActivePrimaryShards);
+ writer.WriteProperty(options, PropActiveShards, value.ActiveShards);
+ writer.WriteProperty(options, PropActiveShardsPercentAsNumber, value.ActiveShardsPercentAsNumber);
+ writer.WriteProperty(options, PropClusterName, value.ClusterName);
+ writer.WriteProperty(options, PropDelayedUnassignedShards, value.DelayedUnassignedShards);
+ writer.WriteProperty(options, PropIndices, value.Indices);
+ writer.WriteProperty(options, PropInitializingShards, value.InitializingShards);
+ writer.WriteProperty(options, PropNumberOfDataNodes, value.NumberOfDataNodes);
+ writer.WriteProperty(options, PropNumberOfInFlightFetch, value.NumberOfInFlightFetch);
+ writer.WriteProperty(options, PropNumberOfNodes, value.NumberOfNodes);
+ writer.WriteProperty(options, PropNumberOfPendingTasks, value.NumberOfPendingTasks);
+ writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards);
+ writer.WriteProperty(options, PropStatus, value.Status);
+ writer.WriteProperty(options, PropTaskMaxWaitingInQueue, value.TaskMaxWaitingInQueue);
+ writer.WriteProperty(options, PropTaskMaxWaitingInQueueMillis, value.TaskMaxWaitingInQueueMillis);
+ writer.WriteProperty(options, PropTimedOut, value.TimedOut);
+ writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards);
+ writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(HealthResponseConverter))]
public sealed partial class HealthResponse : ElasticsearchResponse
{
///
@@ -33,7 +240,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of active primary shards.
///
///
- [JsonInclude, JsonPropertyName("active_primary_shards")]
public int ActivePrimaryShards { get; init; }
///
@@ -41,7 +247,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The total number of active primary and replica shards.
///
///
- [JsonInclude, JsonPropertyName("active_shards")]
public int ActiveShards { get; init; }
///
@@ -49,7 +254,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The ratio of active shards in the cluster expressed as a percentage.
///
///
- [JsonInclude, JsonPropertyName("active_shards_percent_as_number")]
public double ActiveShardsPercentAsNumber { get; init; }
///
@@ -57,7 +261,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The name of the cluster.
///
///
- [JsonInclude, JsonPropertyName("cluster_name")]
public string ClusterName { get; init; }
///
@@ -65,10 +268,7 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of shards whose allocation has been delayed by the timeout settings.
///
///
- [JsonInclude, JsonPropertyName("delayed_unassigned_shards")]
public int DelayedUnassignedShards { get; init; }
- [JsonInclude, JsonPropertyName("indices")]
- [ReadOnlyIndexNameDictionaryConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Cluster.IndexHealthStats))]
public IReadOnlyDictionary? Indices { get; init; }
///
@@ -76,7 +276,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of shards that are under initialization.
///
///
- [JsonInclude, JsonPropertyName("initializing_shards")]
public int InitializingShards { get; init; }
///
@@ -84,7 +283,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of nodes that are dedicated data nodes.
///
///
- [JsonInclude, JsonPropertyName("number_of_data_nodes")]
public int NumberOfDataNodes { get; init; }
///
@@ -92,7 +290,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of unfinished fetches.
///
///
- [JsonInclude, JsonPropertyName("number_of_in_flight_fetch")]
public int NumberOfInFlightFetch { get; init; }
///
@@ -100,7 +297,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of nodes within the cluster.
///
///
- [JsonInclude, JsonPropertyName("number_of_nodes")]
public int NumberOfNodes { get; init; }
///
@@ -108,7 +304,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of cluster-level changes that have not yet been executed.
///
///
- [JsonInclude, JsonPropertyName("number_of_pending_tasks")]
public int NumberOfPendingTasks { get; init; }
///
@@ -116,9 +311,7 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of shards that are under relocation.
///
///
- [JsonInclude, JsonPropertyName("relocating_shards")]
public int RelocatingShards { get; init; }
- [JsonInclude, JsonPropertyName("status")]
public Elastic.Clients.Elasticsearch.Serverless.HealthStatus Status { get; init; }
///
@@ -126,7 +319,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The time since the earliest initiated task is waiting for being performed.
///
///
- [JsonInclude, JsonPropertyName("task_max_waiting_in_queue")]
public Elastic.Clients.Elasticsearch.Serverless.Duration? TaskMaxWaitingInQueue { get; init; }
///
@@ -134,7 +326,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The time expressed in milliseconds since the earliest initiated task is waiting for being performed.
///
///
- [JsonInclude, JsonPropertyName("task_max_waiting_in_queue_millis")]
public long TaskMaxWaitingInQueueMillis { get; init; }
///
@@ -142,7 +333,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// If false the response returned within the period of time that is specified by the timeout parameter (30s by default)
///
///
- [JsonInclude, JsonPropertyName("timed_out")]
public bool TimedOut { get; init; }
///
@@ -150,7 +340,6 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of primary shards that are not allocated.
///
///
- [JsonInclude, JsonPropertyName("unassigned_primary_shards")]
public int UnassignedPrimaryShards { get; init; }
///
@@ -158,6 +347,5 @@ public sealed partial class HealthResponse : ElasticsearchResponse
/// The number of shards that are not allocated.
///
///
- [JsonInclude, JsonPropertyName("unassigned_shards")]
public int UnassignedShards { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs
index d4cd024db8e..dbad8cde7cf 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PendingTasksResponse.g.cs
@@ -18,16 +18,52 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class PendingTasksResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks");
+
+ public override PendingTasksResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty> propTasks = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propTasks.TryRead(ref reader, options, PropTasks))
+ {
+ 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 PendingTasksResponse
+ {
+ Tasks = propTasks.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, PendingTasksResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropTasks, value.Tasks);
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(PendingTasksResponseConverter))]
public sealed partial class PendingTasksResponse : ElasticsearchResponse
{
- [JsonInclude, JsonPropertyName("tasks")]
public IReadOnlyCollection Tasks { get; init; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs
index 6b23a00a031..3a6fc13e92d 100644
--- a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs
@@ -18,14 +18,51 @@
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Next;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport.Products.Elasticsearch;
using System;
using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
using System.Text.Json.Serialization;
namespace Elastic.Clients.Elasticsearch.Serverless.Cluster;
+internal sealed partial class PutComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged");
+
+ public override PutComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonProperty